Remove the apps directory from the repo

Replace with a submodule to include all of the test applications.
This commit is contained in:
Don Porter
2019-06-11 20:31:06 -04:00
parent 5a5b42fff8
commit 7262d6000e
205 changed files with 11 additions and 13589 deletions
+3 -6
View File
@@ -1,9 +1,6 @@
[submodule "LibOS/shim/test/apps/gcc/test_files"]
path = LibOS/shim/test/apps/gcc/test_files
url = https://github.com/oscarlab/gcc_test_files.git
[submodule "LibOS/shim/test/apps/lmbench/lmbench-2.5"]
path = LibOS/shim/test/apps/lmbench/lmbench-2.5
url = https://github.com/oscarlab/lmbench-2.5.git
[submodule "Pal/src/host/Linux-SGX/sgx-driver"]
path = Pal/src/host/Linux-SGX/sgx-driver
url = https://github.com/oscarlab/graphene-sgx-driver.git
[submodule "LibOS/shim/test/apps"]
path = LibOS/shim/test/apps
url = https://github.com/oscarlab/graphene-tests.git
-11
View File
@@ -1,11 +0,0 @@
/httpd-2.4.3/*
/result-*
/obj/*
/OUTPUT
/.libs/*
/apr-1.4.6/*
/apr-util-1.5.1/*
/php-5.6.6/*
/mod_auth_basic_sandbox.la
/mod_auth_basic_sandbox.lo
/mod_auth_basic_sandbox.slo
-154
View File
@@ -1,154 +0,0 @@
HOST ?= $(firstword $(shell ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' -m 1 | cut -d: -f2))
PORT ?= 8001
NPROCS := 1
OS := $(shell uname -s)
ifeq ($(OS),Linux)
NPROCS := $(shell grep -c ^processor /proc/cpuinfo)
endif
PREFORK_WORKERS := $(shell expr $(NPROCS) + 1)
HTTPD_DIR = httpd-2.4.3
APR_DIR = apr-1.4.6
APRUTIL_DIR = apr-util-1.5.1
PHP_DIR = php-5.6.6
INSTALL_DIR = $(PWD)/obj
SRC_DIRS = $(HTTPD_DIR) $(APR_DIR) $(APRUTIL_DIR) $(PHP_DIR)
HTDOC=$(INSTALL_DIR)/htdocs
exec_target = httpd.manifest
target = build-apache build-modules build-conf test-data
clean-extra = clean-apache
extra_rules = -e 's:\$$(HOST):$(HOST):g' -e 's:\$$(PORT):$(PORT):g'
level = ../../
include ../../Makefile
.PHONY: build-apache build-modules build-conf
build-apache: $(INSTALL_DIR)/bin/httpd $(INSTALL_DIR)/modules/libphp5.so
ifeq ($(DEBUG),1)
MAKE_FLAGS = CC="gcc -g"
APXS_FLAGS = -S CC="gcc -g"
endif
%: %.tar.gz
tar -xmzf $<
%: %.tar.bz2
tar -xmjf $<
$(INSTALL_DIR)/lib/libapr-1.so.0: $(APR_DIR)
#cd $< && patch -p1 < ../disable-epoll.patch
cd $< && ./configure --prefix=$(INSTALL_DIR)
cd $< && $(MAKE) -j$(NPROCS) $(MAKE_FLAGS)
cd $< && $(MAKE) install
$(INSTALL_DIR)/lib/libaprutil-1.so.0: $(APRUTIL_DIR) $(INSTALL_DIR)/lib/libapr-1.so.0
cd $< && ./configure --prefix=$(INSTALL_DIR) --with-apr=$(INSTALL_DIR)
cd $< && $(MAKE) -j$(NPROCS) $(MAKE_FLAGS)
cd $< && $(MAKE) install
$(INSTALL_DIR)/bin/httpd $(INSTALL_DIR)/bin/apxs: $(INSTALL_DIR)/lib/libapr-1.so.0 $(INSTALL_DIR)/lib/libaprutil-1.so.0
[ -d $(HTTPD_DIR) ] || tar -xzf $(HTTPD_DIR).tar.gz
[ -f $(HTTPD_DIR)/Makefile ] || ( \
cd $(HTTPD_DIR) && ./configure --prefix=$(INSTALL_DIR) --with-apr=$(INSTALL_DIR) \
--with-apr-util=$(INSTALL_DIR) --with-mpm=prefork)
cd $(HTTPD_DIR) && $(MAKE) -j$(NPROCS) $(MAKE_FLAGS)
cd $(HTTPD_DIR) && $(MAKE) install
$(INSTALL_DIR)/modules/libphp5.so: $(PHP_DIR) $(INSTALL_DIR)/bin/apxs
cd $< && ./configure --prefix=$(INSTALL_DIR) --with-apxs2=$(INSTALL_DIR)/bin/apxs \
--disable-cgi --disable-cli --disable-soap
cd $< && $(MAKE) -j$(NPROCS) $(MAKE_FLAGS)
cd $< && $(MAKE) install
build-modules: $(INSTALL_DIR)/modules/mod_auth_basic_sandbox.so
$(INSTALL_DIR)/modules/mod_auth_basic_sandbox.so: mod_auth_basic_sandbox.c $(INSTALL_DIR)/bin/apxs
$(INSTALL_DIR)/bin/apxs $(APXS_FLAGS) \
-S CFLAGS="-I$(SHIMDIR)/../include" \
-S LDFLAGS="-L. -l:$(RUNTIME)/liblibos.so.1" -c -i -A $<
build-conf:
[ -f $(INSTALL_DIR)/conf/httpd.conf.old ] || \
mv $(INSTALL_DIR)/conf/httpd.conf $(INSTALL_DIR)/conf/httpd.conf.old
sed -e "s/Listen 80/#Listen 80/g" \
-e "s/User daemon/#User root/g" \
-e "s/Group daemon/#Group root/g" \
-e "s/#EnableMMAP off/EnableMMAP off/g" \
-e "s/#EnableSendfile on/EnableSendfile on/g" \
-e "s/DirectoryIndex index.html/DirectoryIndex index.html index.php/g" \
-e "s/^[ ]*CustomLog/#CustomLog/g" \
$(INSTALL_DIR)/conf/httpd.conf.old > $(INSTALL_DIR)/conf/httpd.conf.new
echo "\n\
<IfModule mpm_prefork_module>\n\
StartServers $(PREFORK_WORKERS)\n\
MinSpareServers 1\n\
MaxSpareServers $(PREFORK_WORKERS)\n\
MaxConnectionsPerChild 0\n\
</IfModule>\n" >> $(INSTALL_DIR)/conf/httpd.conf.new
echo "\n\
<IfModule mime_module>\n\
AddType application/x-httpd-php .php\n\
</IfModule>\n" >> $(INSTALL_DIR)/conf/httpd.conf.new
cd $(INSTALL_DIR)/conf && ln -sf httpd.conf.new httpd.conf
clean-server:
rm -f $(INSTALL_DIR)/logs/httpd-$(HOST)-$(PORT).pid
start-native-server: clean-server
@echo "Listen on $(HOST):$(PORT)"
$(PREFIX) $(INSTALL_DIR)/bin/httpd -D FOREGROUND -C "ServerName $(HOST)" -C "Listen $(HOST):$(PORT)" -C "PidFile logs/httpd-$(HOST)-$(PORT).pid"
start-graphene-server: clean-server
@echo "Listen on $(HOST):$(PORT)"
$(PREFIX) ./httpd.manifest -D FOREGROUND -C "ServerName $(HOST)" -C "Listen $(HOST):$(PORT)" -C "PidFile logs/httpd-$(HOST)-$(PORT).pid"
random-data = $(foreach n,1 2 3 4 5 6 7 8 9 10,2K.$n.html) \
$(foreach n,1 2 3 4 5,10K.$n.html) \
$(foreach n,1 2 3 4 5,100K.$n.html) \
$(foreach n,1 2 3,1M.$n.html) \
$(foreach n,1 2 3,10M.$n.html) \
$(foreach n,1 2 3,100.$n.html)
test-data = $(HTDOC)/oscar-web $(HTDOC)/oscar-web-static \
$(addprefix $(HTDOC)/random/,$(random-data)) \
$(HTDOC)/auth/secret.html $(HTDOC)/auth/.htaccess
$(HTDOC)/%: $(PWD)/../web-data/%.tar.gz
[ -d "$@" ] || (mkdir -p $@ && cd $(HTDOC) && tar -xzf $^)
$(HTDOC)/random/%.html:
[ -d $(HTDOC)/random ] || mkdir -p $(HTDOC)/random
dd if=/dev/urandom of=$@ count=1 bs=$(basename $(basename $(notdir $@)))
$(HTDOC)/auth:
mkdir -p $@
$(HTDOC)/auth/secret.html: $(HTDOC)/auth
echo "This is the secret" > $@
$(HTDOC)/auth/.htpasswd: $(INSTALL_DIR)/bin/htpasswd $(HTDOC)/auth
$< -b -c $@ test test
$(HTDOC)/auth/.htaccess: $(HTDOC)/auth/.htpasswd
echo "AuthName \"Login\"\n\
AuthType Basic\n\
AuthUserFile $(HTDOC)/auth/.htpasswd\n\
AuthGroupFile /dev/null\n\
require user test" > $@
test-data: $(test-data)
distclean: clean
rm -rf $(INSTALL_DIR) $(SRC_DIRS)
clean-apache:
rm -rf $(test-data) $(addprefix mod_auth_basic_sandbox,.so .la .lo .o .slo)
Binary file not shown.
Binary file not shown.
@@ -1,42 +0,0 @@
#!/usr/bin/env bash
PROTOCOL=${PROTOCOL:=http}
declare -A THROUGHPUTS
declare -A LATENCIES
LOOP=5
DOWNLOAD_HOST=$1
DOWNLOAD_FILE=random/10K.1.html
REQUESTS=10000
CONCURRENCY_LIST="1 2 4 8 16 32 64 128 256"
RESULT=result-$(date +%y%m%d-%H%M%S)
URL="$PROTOCOL://$DOWNLOAD_HOST/$DOWNLOAD_FILE"
touch $RESULT
RUN=0
while [ $RUN -lt $LOOP ]
do
for CONCURRENCY in $CONCURRENCY_LIST
do
rm -f OUTPUT
echo "ab -n $REQUESTS -c $CONCURRENCY $URL"
ab -n $REQUESTS -c $CONCURRENCY $URL >> OUTPUT
sleep 5
THROUGHPUT=$(grep -m1 "Requests per second:" OUTPUT | awk '{ print $4 }')
LATENCY=$(grep -m1 "Time per request:" OUTPUT | awk '{ print $4 }')
THROUGHPUTS[$CONCURRENCY]="${THROUGHPUTS[$CONCURRENCY]} $THROUGHPUT"
LATENCIES[$CONCURRENCY]="${LATENCIES[$CONCURRENCY]} $LATENCY"
echo "concurrency=$CONCURRENCY, throughput=$THROUGHPUT, latency=$LATENCY"
done
RUN=$(expr $RUN + 1)
done
for CONCURRENCY in $CONCURRENCY_LIST
do
THROUGHPUT=$(echo ${THROUGHPUTS[$CONCURRENCY]} | tr " " "\n" | sort -n | awk '{a[NR]=$0}END{if(NR%2==1)print a[int(NR/2)+1];else print(a[NR/2-1]+a[NR/2])/2}')
LATENCY=$(echo ${LATENCIES[$CONCURRENCY]} | tr " " "\n" | sort -n | awk '{a[NR]=$0}END{if(NR%2==1)print a[int(NR/2)+1];else print(a[NR/2-1]+a[NR/2])/2}')
echo "$THROUGHPUT,$LATENCY" >> $RESULT
done
echo "Result file: $RESULT"
@@ -1 +0,0 @@
../lighttpd/benchmark-http.sh
@@ -1,21 +0,0 @@
diff -ruNp apr-1.4.6/configure apr-1.4.6.new/configure
--- apr-1.4.6/configure 2012-02-07 18:17:57.000000000 -0500
+++ apr-1.4.6.new/configure 2013-10-09 19:41:16.603262382 -0400
@@ -20307,6 +20307,8 @@ _ACEOF
fi
done
+# disable epoll support
+if [ yes = no ]; then
# Check for the Linux epoll interface; epoll* may be available in libc
# but return ENOSYS on a pre-2.6 kernel, so do a run-time check.
@@ -20387,6 +20389,8 @@ $as_echo "#define HAVE_EPOLL_CREATE1 1"
fi
+fi
+
# test for dup3
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dup3 support" >&5
$as_echo_n "checking for dup3 support... " >&6; }
Binary file not shown.
@@ -1,55 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:obj/bin/httpd
loader.execname = httpd
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.debug_type = none
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.cwd.type = chroot
fs.mount.cwd.path = $(PWD)
fs.mount.cwd.uri = file:
# allow to bind on port for listening
net.allow_bind.1 = $(HOST):$(PORT)
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libresolv = file:$(LIBCDIR)/libresolv.so.2
sgx.trusted_files.libnssdns = file:/lib/x86_64-linux-gnu/libnss_dns.so.2
sgx.trusted_files.libnssfiles = file:/lib/x86_64-linux-gnu/libnss_files.so.2
sgx.trusted_files.libnsscompact = file:/lib/x86_64-linux-gnu/libnss_compat.so.2
sgx.trusted_files.libnssnis = file:/lib/x86_64-linux-gnu/libnss_nis.so.2
sgx.trusted_files.libpcre = file:/lib/x86_64-linux-gnu/libpcre.so.3
sgx.trusted_files.libapr = file:obj/lib/libapr-1.so.0
sgx.trusted_files.libaprutil = file:obj/lib/libaprutil-1.so.0
sgx.trusted_files.libexpat = file:/lib/x86_64-linux-gnu/libexpat.so.1
sgx.trusted_files.libcrypt = file:/lib/x86_64-linux-gnu/libcrypt.so.1
sgx.trusted_files.libxml2 = file:/usr/lib/x86_64-linux-gnu/libxml2.so.2
sgx.trusted_files.libz = file:/lib/x86_64-linux-gnu/libz.so.1
sgx.trusted_files.liblzma = file:/lib/x86_64-linux-gnu/liblzma.so.5
sgx.trusted_files.libnsl = file:/lib/x86_64-linux-gnu/libnsl.so.1
sgx.trusted_files.libicuuc = file:/usr/lib/x86_64-linux-gnu/libicuuc.so.55
sgx.trusted_files.libicudata = file:/usr/lib/x86_64-linux-gnu/libicudata.so.55
sgx.trusted_files.libstdcpp = file:/usr/lib/x86_64-linux-gnu/libstdc++.so.6
sgx.trusted_files.libgcc_c = file:/lib/x86_64-linux-gnu/libgcc_s.so.1
sgx.allowed_files.modules = file:obj/modules
sgx.allowed_files.conf = file:obj/conf
sgx.allowed_files.htdocs = file:obj/htdocs
sgx.allowed_files.logs = file:obj/logs
@@ -1,337 +0,0 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "apr_strings.h"
#include "apr_md5.h" /* for apr_password_validate */
#include "apr_lib.h" /* for apr_isspace */
#include "apr_base64.h" /* for apr_base64_decode et al */
#define APR_WANT_STRFUNC /* for strcasecmp */
#include "apr_want.h"
#include "apr_network_io.h"
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"
#include "ap_provider.h"
#include "mod_auth.h"
#include "shim_unistd.h"
typedef struct {
authn_provider_list *providers;
char *dir;
int authoritative;
} auth_basic_config_rec;
static void *create_auth_basic_dir_config(apr_pool_t *p, char *d)
{
auth_basic_config_rec *conf = apr_pcalloc(p, sizeof(*conf));
conf->dir = d;
/* Any failures are fatal. */
conf->authoritative = 1;
return conf;
}
static const char *add_authn_provider(cmd_parms *cmd, void *config,
const char *arg)
{
auth_basic_config_rec *conf = (auth_basic_config_rec*)config;
authn_provider_list *newp;
newp = apr_pcalloc(cmd->pool, sizeof(authn_provider_list));
newp->provider_name = arg;
/* lookup and cache the actual provider now */
newp->provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
newp->provider_name,
AUTHN_PROVIDER_VERSION);
if (newp->provider == NULL) {
/* by the time they use it, the provider should be loaded and
registered with us. */
return apr_psprintf(cmd->pool,
"Unknown Authn provider: %s",
newp->provider_name);
}
if (!newp->provider->check_password) {
/* if it doesn't provide the appropriate function, reject it */
return apr_psprintf(cmd->pool,
"The '%s' Authn provider doesn't support "
"Basic Authentication", newp->provider_name);
}
/* Add it to the list now. */
if (!conf->providers) {
conf->providers = newp;
}
else {
authn_provider_list *last = conf->providers;
while (last->next) {
last = last->next;
}
last->next = newp;
}
return NULL;
}
static const command_rec auth_basic_cmds[] =
{
AP_INIT_ITERATE("AuthBasicProvider", add_authn_provider, NULL, OR_AUTHCFG,
"specify the auth providers for a directory or location"),
AP_INIT_FLAG("AuthBasicAuthoritative", ap_set_flag_slot,
(void *)APR_OFFSETOF(auth_basic_config_rec, authoritative),
OR_AUTHCFG,
"Set to 'Off' to allow access control to be passed along to "
"lower modules if the UserID is not known to this module"),
{NULL}
};
module AP_MODULE_DECLARE_DATA auth_basic_module;
/* These functions return 0 if client is OK, and proper error status
* if not... either HTTP_UNAUTHORIZED, if we made a check, and it failed, or
* HTTP_INTERNAL_SERVER_ERROR, if things are so totally confused that we
* couldn't figure out how to tell if the client is authorized or not.
*
* If they return DECLINED, and all other modules also decline, that's
* treated by the server core as a configuration error, logged and
* reported as such.
*/
static void note_basic_auth_failure(request_rec *r)
{
apr_table_setn(r->err_headers_out,
(PROXYREQ_PROXY == r->proxyreq) ? "Proxy-Authenticate"
: "WWW-Authenticate",
apr_pstrcat(r->pool, "Basic realm=\"", ap_auth_name(r),
"\"", NULL));
}
static int hook_note_basic_auth_failure(request_rec *r, const char *auth_type)
{
if (strcasecmp(auth_type, "Basic"))
return DECLINED;
note_basic_auth_failure(r);
return OK;
}
static int get_basic_auth(request_rec *r, const char **user,
const char **pw)
{
const char *auth_line;
char *decoded_line;
int length;
/* Get the appropriate header */
auth_line = apr_table_get(r->headers_in, (PROXYREQ_PROXY == r->proxyreq)
? "Proxy-Authorization"
: "Authorization");
if (!auth_line) {
note_basic_auth_failure(r);
return HTTP_UNAUTHORIZED;
}
if (strcasecmp(ap_getword(r->pool, &auth_line, ' '), "Basic")) {
/* Client tried to authenticate using wrong auth scheme */
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01614)
"client used wrong authentication scheme: %s", r->uri);
note_basic_auth_failure(r);
return HTTP_UNAUTHORIZED;
}
/* Skip leading spaces. */
while (apr_isspace(*auth_line)) {
auth_line++;
}
decoded_line = apr_palloc(r->pool, apr_base64_decode_len(auth_line) + 1);
length = apr_base64_decode(decoded_line, auth_line);
/* Null-terminate the string. */
decoded_line[length] = '\0';
*user = ap_getword_nulls(r->pool, (const char**)&decoded_line, ':');
*pw = decoded_line;
/* set the user, even though the user is unauthenticated at this point */
r->user = (char *) *user;
return OK;
}
/* Determine user ID, and check if it really is that user, for HTTP
* basic authentication...
*/
static int authenticate_basic_user(request_rec *r)
{
auth_basic_config_rec *conf = ap_get_module_config(r->per_dir_config,
&auth_basic_module);
const char *sent_user, *sent_pw, *current_auth;
int res;
authn_status auth_result;
authn_provider_list *current_provider;
/* Are we configured to be Basic auth? */
current_auth = ap_auth_type(r);
if (!current_auth || strcasecmp(current_auth, "Basic")) {
return DECLINED;
}
/* We need an authentication realm. */
if (!ap_auth_name(r)) {
ap_log_rerror(APLOG_MARK, APLOG_ERR,
0, r, APLOGNO(01615) "need AuthName: %s", r->uri);
return HTTP_INTERNAL_SERVER_ERROR;
}
r->ap_auth_type = (char*)current_auth;
res = get_basic_auth(r, &sent_user, &sent_pw);
if (res) {
return res;
}
current_provider = conf->providers;
do {
const authn_provider *provider;
/* For now, if a provider isn't set, we'll be nice and use the file
* provider.
*/
if (!current_provider) {
provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
AUTHN_DEFAULT_PROVIDER,
AUTHN_PROVIDER_VERSION);
if (!provider || !provider->check_password) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01616)
"No Authn provider configured");
auth_result = AUTH_GENERAL_ERROR;
break;
}
apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, AUTHN_DEFAULT_PROVIDER);
}
else {
provider = current_provider->provider;
apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, current_provider->provider_name);
}
auth_result = provider->check_password(r, sent_user, sent_pw);
apr_table_unset(r->notes, AUTHN_PROVIDER_NAME_NOTE);
/* Something occured. Stop checking. */
if (auth_result != AUTH_USER_NOT_FOUND) {
break;
}
/* If we're not really configured for providers, stop now. */
if (!conf->providers) {
break;
}
current_provider = current_provider->next;
} while (current_provider);
if (auth_result != AUTH_GRANTED) {
int return_code;
/* If we're not authoritative, then any error is ignored. */
if (!(conf->authoritative) && auth_result != AUTH_DENIED) {
return DECLINED;
}
switch (auth_result) {
case AUTH_DENIED:
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01617)
"user %s: authentication failure for \"%s\": "
"Password Mismatch",
sent_user, r->uri);
return_code = HTTP_UNAUTHORIZED;
break;
case AUTH_USER_NOT_FOUND:
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01618)
"user %s not found: %s", sent_user, r->uri);
return_code = HTTP_UNAUTHORIZED;
break;
case AUTH_GENERAL_ERROR:
default:
/* We'll assume that the module has already said what its error
* was in the logs.
*/
return_code = HTTP_INTERNAL_SERVER_ERROR;
break;
}
/* If we're returning 403, tell them to try again. */
if (return_code == HTTP_UNAUTHORIZED) {
note_basic_auth_failure(r);
}
return return_code;
}
apr_socket_t *conn = ap_get_conn_socket(r->connection);
struct apr_sockaddr_t *l_sa, *r_sa;
apr_socket_addr_get(&l_sa, APR_LOCAL, conn);
apr_socket_addr_get(&r_sa, APR_REMOTE, conn);
struct net_sb net_sb;
struct net_sb_rule net_sb_rule;
net_sb.nrules = 1;
net_sb.rules = &net_sb_rule;
net_sb_rule.l_addrlen = l_sa->ipaddr_len;
net_sb_rule.l_addr = l_sa->ipaddr_ptr;
net_sb_rule.r_addrlen = r_sa->ipaddr_len;
net_sb_rule.r_addr = r_sa->ipaddr_ptr;
if (sandbox_create(SANDBOX_FS|SANDBOX_NET|SANDBOX_RPC,
ap_document_root(r),
&net_sb) < 0)
return HTTP_INTERNAL_SERVER_ERROR;
return OK;
}
static void register_hooks(apr_pool_t *p)
{
ap_hook_check_authn(authenticate_basic_user, NULL, NULL, APR_HOOK_MIDDLE,
AP_AUTH_INTERNAL_PER_CONF);
ap_hook_note_auth_failure(hook_note_basic_auth_failure, NULL, NULL,
APR_HOOK_MIDDLE);
}
AP_DECLARE_MODULE(auth_basic_sandbox) =
{
STANDARD20_MODULE_STUFF,
create_auth_basic_dir_config, /* dir config creater */
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
auth_basic_cmds, /* command apr_table_t */
register_hooks /* register hooks */
};
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
/OUTPUT
/testdir/x
-32
View File
@@ -1,32 +0,0 @@
BASH_DIR = bash-4.1
manifests = $(addsuffix .manifest,bash ls cp rm cat date)
exec_target = $(manifests)
level = ../../
include ../../Makefile
$(bash_src): $(BASH_DIR).tar.gz
tar -xmzf $<
$(bash_src)/bash: $(BASH_DIR)
cd $(BASH_DIR) && ./configure --without-gnu-malloc
cd $(BASH_DIR) && $(MAKE) CC="gcc -g"
bash-local: $(BASH_DIR)/bash
cp $< bash-local
regression:
@echo "\n\nBuilding Bash Manifests"
@$(MAKE) >> /dev/null 2>&1
@echo "\n\nRun bash_test.sh:"
-./bash.manifest bash_test.sh 2
-grep -q "hello 2" OUTPUT
@rm OUTPUT
distclean: clean-manifests
rm -rf $(bash_src)
rm -rf bash result $(test_targets)
Binary file not shown.
@@ -1,54 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:/bin/bash
loader.execname = /bin/bash
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.env.PATH = /bin:/usr/bin
loader.env.USERNAME = root
loader.env.HOME = /
loader.debug_type = none
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.bin.type = chroot
fs.mount.bin.path = /bin
fs.mount.bin.uri = file:/bin
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
sys.brk.size = 256K
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libnss1 = file:$(LIBCDIR)/libnss_dns.so.2
sgx.trusted_files.libnss2 = file:/lib/x86_64-linux-gnu/libnss_compat.so.2
sgx.trusted_files.libnss3 = file:/lib/x86_64-linux-gnu/libnss_files.so.2
sgx.trusted_files.libtinfo = file:/lib/x86_64-linux-gnu/libtinfo.so.5
sgx.trusted_files.ls = file:/bin/ls
sgx.trusted_files.cp = file:/bin/cp
sgx.trusted_files.rm = file:/bin/rm
sgx.trusted_files.date = file:/bin/date
sgx.trusted_files.cat = file:/bin/cat
sgx.trusted_children.ls = file:ls.sig
sgx.trusted_children.cp = file:cp.sig
sgx.trusted_children.rm = file:rm.sig
sgx.trusted_children.cat = file:cat.sig
sgx.trusted_children.date = file:date.sig
sgx.allowed_files.test1 = file:bash_test.sh
sgx.allowed_files.test2 = file:OUTPUT
sgx.allowed_files.test3 = file:somefile
sgx.allowed_files.testdir = file:testdir
-14
View File
@@ -1,14 +0,0 @@
#!/usr/bin/env bash
times=$1
[ $times -gt 0 2> /dev/null ] || times=300
for (( c=1; c<=$times; c++ ))
do
echo "hello $c"
cp somefile testdir/somefile
rm -rf testdir/somefile
ls testdir/
cat somefile > testdir/x
date
done > OUTPUT
@@ -1,15 +0,0 @@
loader.preload = file:$(SHIMPATH)
loader.exec = file:/bin/cat
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu
loader.debug_type = none
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
# sgx-related
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.allowed_files.test3 = file:somefile
sgx.allowed_files.testdir = file:testdir
@@ -1,25 +0,0 @@
loader.preload = file:$(SHIMPATH)
loader.exec = file:/bin/cp
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu
loader.debug_type = none
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
fs.mount.hostlib.type = chroot
fs.mount.hostlib.path = /lib/x86_64-linux-gnu
fs.mount.hostlib.uri = file:/lib/x86_64-linux-gnu
# sgx-related
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libselinux = file:/lib/x86_64-linux-gnu/libselinux.so.1
sgx.trusted_files.libacl = file:/lib/x86_64-linux-gnu/libacl.so.1
sgx.trusted_files.libpcre = file:/lib/x86_64-linux-gnu/libpcre.so.3
sgx.trusted_files.libattr = file:/lib/x86_64-linux-gnu/libattr.so.1
sgx.allowed_files.test3 = file:somefile
sgx.allowed_files.testdir = file:testdir
@@ -1,14 +0,0 @@
loader.preload = file:$(SHIMPATH)
loader.exec = file:/bin/date
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu
loader.debug_type = none
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
# sgx-related
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.allowed_files.test2 = file:OUTPUT
Binary file not shown.
@@ -1,24 +0,0 @@
loader.preload = file:$(SHIMPATH)
loader.exec = file:/bin/ls
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu
loader.debug_type = none
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
fs.mount.hostlib.type = chroot
fs.mount.hostlib.path = /lib/x86_64-linux-gnu
fs.mount.hostlib.uri = file:/lib/x86_64-linux-gnu
# sgx-related
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libselinux = file:/lib/x86_64-linux-gnu/libselinux.so.1
sgx.trusted_files.libacl = file:/lib/x86_64-linux-gnu/libacl.so.1
sgx.trusted_files.libpcre = file:/lib/x86_64-linux-gnu/libpcre.so.3
sgx.trusted_files.libattr = file:/lib/x86_64-linux-gnu/libattr.so.1
sgx.allowed_files.test2 = file:OUTPUT
@@ -1,14 +0,0 @@
loader.preload = file:$(SHIMPATH)
loader.exec = file:/bin/rm
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu
loader.debug_type = none
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
# sgx-related
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.allowed_files.testdir = file:testdir
View File
-362
View File
@@ -1,362 +0,0 @@
version="1.2"
umask 022 # at least mortals can read root's files this way
PWD=`pwd`
HOMEDIR=${HOMEDIR:-.}
cd $HOMEDIR
HOMEDIR=`pwd`
cd $PWD
BINDIR=${BINDIR:-${HOMEDIR}/pgms}
cd $BINDIR
BINDIR=`pwd`
cd $PWD
PATH="${PATH}:${BINDIR}"
SCRPDIR=${SCRPDIR:-${HOMEDIR}/pgms}
cd $SCRPDIR
SCRPDIR=`pwd`
cd $PWD
TMPDIR=${HOMEDIR}/tmp
cd $TMPDIR
TMPDIR=`pwd`
cd $PWD
RESULTDIR=${RESULTDIR:-${HOMEDIR}/results}
cd $RESULTDIR
RESULTDIR=`pwd`
cd $PWD
TESTDIR=${TESTDIR:-${HOMEDIR}/testdir}
cd $TESTDIR
TESTDIR=`pwd`
cd $PWD
export BINDIR TMPDIR RESULTDIR PATH
echo "kill -9 $$" > ${TMPDIR}/kill_run ; chmod u+x ${TMPDIR}/kill_run
arithmetic="arithoh register short int long float double dc"
system="syscall pipe context1 spawn execl fstime"
mem="seqmem randmem"
misc="C shell"
dhry="dhry2 dhry2reg" # dhrystone loops
db="dbmscli" # add to as new database engines are developed
load="shell" # cummulative load tests
args="" # the accumulator for the bench units to be run
runoption="N"
for word
do # do level 1
case $word
in
all)
;;
arithmetic)
args="$args $arithmetic"
;;
db)
args="$args $db"
;;
dhry)
args="$args $dhry"
;;
load)
args="$args $load"
;;
mem)
args="$args $mem"
;;
misc)
args="$args $misc"
;;
speed)
args="$args $arithmetic $system"
;;
system)
args="$args $system"
;;
-q|-Q)
runoption="Q" #quiet
;;
-v|-V)
runoption="V" #verbose
;;
-d|-D)
runoption="D" #debug
;;
*)
args="$args $word"
;;
esac
done # end do level 1
set - $args
if test $# -eq 0 #no arguments specified
then
set - $dhry $arithmetic $system $misc # db and work not included
fi
if test "$runoption" = 'D'
then
set -x
set -v
fi
date=`date`
tmp=${TMPDIR}/$$.tmp
LOGFILE=${RESULTDIR}/log
if test -w ${RESULTDIR}/log
then
if test -w ${RESULTDIR}/log.accum
then
cat ${RESULTDIR}/log >> ${RESULTDIR}/log.accum
rm ${RESULTDIR}/log
else
mv ${RESULTDIR}/log ${RESULTDIR}/log.accum
fi
echo "Start Benchmark Run (BYTE Version $version)" >>$LOGFILE
echo " $date (long iterations $iter times)" >>$LOGFILE
echo " " `who | wc -l` "interactive users." >>$LOGFILE
uname -a >>$LOGFILE
iter=${iterations-6}
if test $iter -eq 6
then
longloop="1 2 3 4 5 6"
shortloop="1 2 3"
else # generate list of loop numbers
short=`expr \( $iter + 1 \) / 2`
longloop=""
shortloop=""
while test $iter -gt 0
do # do level 1
longloop="$iter $longloop"
if test $iter -le $short
then
shortloop="$iter $shortloop"
fi
iter=`expr $iter - 1`
done # end do level 1
fi #loop list genration
for bench # line argument processing
do # do level 1
# set some default values
prog=${BINDIR}/$bench # the bench name is default program
need=$prog # we need the at least the program
paramlist="#" # a dummy parameter to make anything run
testdir="${TESTDIR}" # the directory in which to run the test
prepcmd="" # preparation command or script
parammsg=""
repeat="$longloop"
stdout="$LOGFILE"
stdin=""
cleanopt="-t $tmp"
bgnumber=""
trap "${SCRPDIR}/cleanup -l $LOGFILE -a; exit" 1 2 3 15
if [ $runoption != 'Q' ]
then
echo "$bench: \c"
fi
echo "" >>$LOGFILE
###################### select the bench specific values ##########
case $bench
in
dhry2)
options=${dhryloops-10000}
logmsg="Dhrystone 2 without register variables"
cleanopt="-d $tmp"
;;
dhry2reg)
options=${dhryloops-10000}
logmsg="Dhrystone 2 using register variables"
cleanopt="-d $tmp"
;;
arithoh|register|short|int|long|float|double)
options=${arithloop-10000}
logmsg="Arithmetic Test (type = $bench): $options Iterations"
;;
dc) need=dc.dat
prog=dc
options=""
stdin=dc.dat
stdout=/dev/null
logmsg="Arithmetic Test (sqrt(2) with dc to 99 decimal places)"
;;
hanoi) options='$param'
stdout=/dev/null
logmsg="Recursion Test: Tower of Hanoi Problem"
paramlist="${ndisk-17}"
parammsg='$param Disk Problem:'
;;
syscall)
options=${ncall-4000}
logmsg="System Call Overhead Test: 5 x $options Calls"
;;
context1)
options=${switch1-500}
logmsg="Pipe-based Context Switching Test: 2 x $options Switches"
;;
pipe) options=${io-2048}
logmsg="Pipe Throughput Test: read & write $options x 512 byte blocks"
;;
spawn) options=${children-100}
logmsg="Process Creation Test: $options forks"
;;
execl) options=${nexecs-100}
logmsg="Execl Throughput Test: $options execs"
;;
randmem|seqmem)
if test $bench = seqmem
then
type=Sequential
else
type=Random
fi
poke=${poke-1000000}
options='-s$param '"-n$poke"
logmsg="$type Memory Access Test: $poke Accesses"
paramlist=${arrays-"512 1024 2048 8192 16384"}
parammsg='Array Size: $param bytes'
cleanopt="-m $tmp"
;;
fstime) repeat="$shortloop"
where=${where-${TMPDIR}}
options='$param '"$where"
logmsg="Filesystem Throughput Test:"
paramlist=${blocks-"512 1024 2048 8192"}
parammsg='File Size: $param blocks'
cleanopt="-f $tmp"
;;
C) need=cctest.c
prog=cc
options='$param'
stdout=/dev/null
repeat="$shortloop"
logmsg="C Compiler Test:"
paramlist="cctest.c"
parammsg='cc $param'
rm -f a.out
;;
dbmscli)
repeat="$shortloop"
need="db.dat"
prepcmd='${BINDIR}/dbprep ${testdir}/db.dat 10000'
paramlist=${clients-"1 2 4 8"}
parammsg='$param client processes. (filesize `cat ${testdir}/db.dat|wc -c` bytes)'
logmsg="Client/Server Database Engine:"
options='${testdir}/db.dat $param 0 1000' # $param clients;
# 0 sleep; 1000 iterations
;;
shell)
prog="multi.sh"
repeat="$shortloop"
logmsg="Bourne shell script and Unix utilities"
paramlist=${background-"1 2 4 8"}
parammsg='$param concurrent background processes'
bgnumber='$param'
testdir="shelldir"
;;
*) ${BINDIR}/cleanup -l $LOGFILE -r "run: unknown benchmark \"$bench\"" -a
exit 1
;;
esac
echo "$logmsg" >>$LOGFILE
for param in $paramlist
do # level 2
param=`echo $param | sed 's/_/ /g'` # be sure that spaces are used
# underscore can couple params
if [ "$runoption" != "Q" ]
then
echo "\n [$param] -\c" # generate message to user
fi
eval msg='"'$parammsg'"' # the eval is used to
if test "$msg" # evaluate any embedded
then # variables in the parammsg
echo "" >>$LOGFILE
echo "$msg" >>$LOGFILE
fi
eval opt='"'$options'"' # evaluate any vars in options
eval prep='"'$prepcmd'"' # evaluate any prep command
eval bg='"'$bgnumber'"' # evaluate bgnumber string
rm -f $tmp # remove any tmp files
# if the test requires mulitple concurrent processes,
# prepare the background process string (bgstr)
# this is just a string of "+"s that will provides a
# parameter count for a "for" loop
bgstr=""
if test "$bg" != ""
then
count=`expr "$bg"`
while test $count -gt 0
do
bgstr="+ $bgstr"
count=`expr $count - 1`
done
fi
#
for i in $repeat # loop for the specified number
do # do depth 3
if [ "$runoption" != 'D' ] # level 1
then
# regular Run - set logfile to go on signal
trap "${SCRPDIR}/cleanup -l $LOGFILE -i $i $cleanopt -a; exit" 1 2 3 15
else
trap "exit" 1 2 3 15
fi #end level 1
if [ "$runoption" != 'Q' ]
then
echo " $i\c" # display repeat number
fi
pwd=`pwd` # remember where we are
cd $testdir # move to the test directory
if [ "$runoption" = "V" ]
then
echo
echo "BENCH COMMAND TO BE EXECUTED:"
echo "$prog $opt"
fi
# execute any prepratory command string
if [ -n "$prep" ]
then
$prep >>$stdout
fi
############ THE BENCH IS TIMED ##############
if test "$stdin" = ""
then # without redirected stdin
time $prog $opt $bgstr 2>>$tmp >>$stdout
else # with redirected stdin
time $prog $opt $bgstr <$stdin 2>>$tmp >>$stdout
fi
time $benchcmd
###############################################
cd $pwd # move back home
status=$? # save the result code
if test $status != 0 # must have been an error
then
if test -f $tmp # is there an error file ?
then
cp $tmp ${TMPDIR}/save.$bench.$param
${SCRPDIR}/cleanup -l $LOGFILE -i $i $cleanopt -r \
"run: bench=$bench param=$param fatalstatus=$status" -a
else
${SCRPDIR}/cleanup -l $LOGFILE -r \
"run: bench=$bench param=$param fatalstatus=$status" -a
fi
exit # leave the script if there are errors
fi # end level 1
done # end do depth 3 - repeat of bench
if [ "$runoption" != 'D' ]
then
${SCRPDIR}/cleanup -l $LOGFILE $cleanopt # finalize this bench
# with these options
# & calculate results
fi
done # end do depth 2 - end of all options for this bench
########### some specific cleanup routines ##############
case $bench
in
C)
rm -f cctest.o a.out
;;
esac
if [ "$runoption" != 'Q' ]
then
echo ""
fi
done # end do level 1 - all benchmarks requested
echo "" >>$LOGFILE
echo " " `who | wc -l` "interactive users." >>$LOGFILE
echo "End Benchmark Run ($date) ...." >>$LOGFILE
if [ "$runoption" != 'Q' ]
then
pg $LOGFILE
fi
exit
-21
View File
@@ -1,21 +0,0 @@
#!/usr/bin/env bash
###############################################################################
# The BYTE UNIX Benchmarks - Release 3
# Module: tst.sh SID: 3.4 5/15/91 19:30:24
#
###############################################################################
# Bug reports, patches, comments, suggestions should be sent to:
#
# Ben Smith or Rick Grehan at BYTE Magazine
# ben@bytepb.UUCP rick_g@bytepb.UUCP
#
###############################################################################
# Modification Log:
#
###############################################################################
ID="@(#)tst.sh:3.4 -- 5/15/91 19:30:24";
sort >sort.$$ <./sort.src
od sort.$$ | sort -n -k 1 > od.$$
grep the sort.$$ | tee grep.$$ | wc > wc.$$
rm sort.$$ grep.$$ od.$$ wc.$$
-26
View File
@@ -1,26 +0,0 @@
#!/usr/bin/env bash
###############################################################################
# The BYTE UNIX Benchmarks - Release 3
# Module: multi.sh SID: 3.4 5/15/91 19:30:24
#
###############################################################################
# Bug reports, patches, comments, suggestions should be sent to:
#
# Ben Smith or Rick Grehan at BYTE Magazine
# ben@bytepb.UUCP rick_g@bytepb.UUCP
#
###############################################################################
# Modification Log:
#
###############################################################################
ID="@(#)multi.sh:3.4 -- 5/15/91 19:30:24";
instance=1
for (( c=1; c<2; c++ ))
do
while [ $instance -le $1 ]; do
/bin/bash "./tst.sh" &
instance=`expr $instance + 1`
done
wait
done
-28
View File
@@ -1,28 +0,0 @@
exec_target = busybox.manifest busybox_nofork.manifest
target = busybox busybox_gdb busybox_nofork busybox_nofork_gdb
level = ../../
include ../../Makefile
BUSYBOX_DIR = busybox-1.23.1
ifeq ($(DEBUG),1)
MAKE_FLAGS = CC="gcc -g"
endif
busybox busybox_gdb: config-graphene
[ -d $(BUSYBOX_DIR) ] || tar -xjf $(BUSYBOX_DIR).tar.bz2
cp config-graphene $(BUSYBOX_DIR)/.config
cd $(BUSYBOX_DIR) && $(MAKE) $(MAKE_FLAGS)
cp $(BUSYBOX_DIR)/busybox busybox
cp $(BUSYBOX_DIR)/busybox_unstripped busybox_gdb
busybox_nofork busybox_nofork_gdb: $(BUSYBOX_DIR) config-graphene-nofork
[ -d $(BUSYBOX_DIR) ] || tar -xjf $(BUSYBOX_DIR).tar.bz2
cp config-graphene-nofork $(BUSYBOX_DIR)/.config
cd $(BUSYBOX_DIR) && $(MAKE) $(MAKE_FLAGS)
cp $(BUSYBOX_DIR)/busybox busybox_nofork
cp $(BUSYBOX_DIR)/busybox_unstripped busybox_nofork_gdb
distclean: clean
rm -rf $(BUSYBOX_DIR)
Binary file not shown.
@@ -1,26 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:busybox
loader.execname = busybox
loader.env.PATH = /:/usr/sbin:/usr/bin:/sbin:/bin
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu
loader.env.USERNAME =
loader.env.HOME =
loader.env.PWD =
loader.env.HOSTNAME = test
loader.debug_type = none
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libcrypt = file:/lib/x86_64-linux-gnu/libcrypt.so.1
@@ -1,26 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:busybox_nofork
loader.execname = busybox_nofork
loader.env.PATH = /:/usr/sbin:/usr/bin:/sbin:/bin
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu
loader.env.USERNAME =
loader.env.HOME =
loader.env.PWD =
loader.env.HOSTNAME = test
loader.debug_type = none
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib64
fs.mount.lib2.uri = file:/lib
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libcrypt = file:/lib/x86_64-linux-gnu/libcrypt.so.1
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-12
View File
@@ -1,12 +0,0 @@
manifests = curl.manifest
target =
exec_target = $(manifests)
clean-extra += clean-tmp
level = ../../
include ../../Makefile
clean-tmp:
rm -f curl.manifest.sgx
@@ -1,91 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:/usr/bin/curl
loader.execname = /usr/bin/curl
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.env.PATH = /usr/bin:/bin
loader.env.USERNAME =
loader.env.HOME =
loader.env.PWD =
loader.debug_type = none
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.bin.type = chroot
fs.mount.bin.path = /bin
fs.mount.bin.uri = file:/bin
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.etc.type = chroot
fs.mount.etc.path = /etc
fs.mount.etc.uri = file:
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
sys.stack.size = 256K
sys.brk.size = 4M
glibc.heap_size = 16M
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.liburil = file:$(LIBCDIR)/libutil.so.1
sgx.trusted_files.libz = file:/lib/x86_64-linux-gnu/libz.so.1
sgx.trusted_files.libnss1 = file:/lib/x86_64-linux-gnu/libnss_compat.so.2
sgx.trusted_files.libnss2 = file:/lib/x86_64-linux-gnu/libnss_files.so.2
sgx.trusted_files.libnss3 = file:/lib/x86_64-linux-gnu/libnss_nis.so.2
sgx.trusted_files.libnss4 = file:$(LIBCDIR)/libnss_dns.so.2
sgx.trusted_files.libssl = file:/lib/x86_64-linux-gnu/libssl.so.1.0.0
sgx.trusted_files.libcrypto = file:/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
sgx.trusted_files.libresolv = file:$(LIBCDIR)/libresolv.so.2
sgx.trusted_files.libcurl = file:/usr/lib/x86_64-linux-gnu/libcurl.so.4
sgx.trusted_files.libidn = file:/usr/lib/x86_64-linux-gnu/libidn.so.11
sgx.trusted_files.librtmp = file:/usr/lib/x86_64-linux-gnu/librtmp.so.0
sgx.trusted_files.libgssapi_krb5 = file:/usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2
sgx.trusted_files.liblber = file:/usr/lib/x86_64-linux-gnu/liblber-2.4.so.2
sgx.trusted_files.libldap_r = file:/usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2
sgx.trusted_files.libgnutls = file:/usr/lib/x86_64-linux-gnu/libgnutls.so.26
sgx.trusted_files.libgcrypt = file:/lib/x86_64-linux-gnu/libgcrypt.so.11
sgx.trusted_files.libk5crypto = file:/usr/lib/x86_64-linux-gnu/libk5crypto.so.3
sgx.trusted_files.libcom_err = file:/lib/x86_64-linux-gnu/libcom_err.so.2
sgx.trusted_files.libkrb5support = file:/usr/lib/x86_64-linux-gnu/libkrb5support.so.0
sgx.trusted_files.libsasl2 = file:/usr/lib/x86_64-linux-gnu/libsasl2.so.2
sgx.trusted_files.libgssapi = file:/usr/lib/x86_64-linux-gnu/libgssapi.so.3
sgx.trusted_files.libtasn1 = file:/usr/lib/x86_64-linux-gnu/libtasn1.so.6
sgx.trusted_files.libp11kit = file:/usr/lib/x86_64-linux-gnu/libp11-kit.so.0
sgx.trusted_files.libgpgerror = file:/lib/x86_64-linux-gnu/libgpg-error.so.0
sgx.trusted_files.libkeyutils = file:/lib/x86_64-linux-gnu/libkeyutils.so.1
sgx.trusted_files.libheimntlm = file:/usr/lib/x86_64-linux-gnu/libheimntlm.so.0
sgx.trusted_files.libkrb5 = file:/usr/lib/x86_64-linux-gnu/libkrb5.so.3
sgx.trusted_files.libkrb5_26 = file:/usr/lib/x86_64-linux-gnu/libkrb5.so.26
sgx.trusted_files.libasn1 = file:/usr/lib/x86_64-linux-gnu/libasn1.so.8
sgx.trusted_files.libroken = file:/usr/lib/x86_64-linux-gnu/libroken.so.18
sgx.trusted_files.libffi = file:/usr/lib/x86_64-linux-gnu/libffi.so.6
sgx.trusted_files.libwind = file:/usr/lib/x86_64-linux-gnu/libwind.so.0
sgx.trusted_files.libheimbase = file:/usr/lib/x86_64-linux-gnu/libheimbase.so.1
sgx.trusted_files.libhx509 = file:/usr/lib/x86_64-linux-gnu/libhx509.so.5
sgx.trusted_files.libsqlite3 = file:/usr/lib/x86_64-linux-gnu/libsqlite3.so.0
sgx.trusted_files.libcrypt = file:/lib/x86_64-linux-gnu/libcrypt.so.1
sgx.trusted_files.libhcrypto = file:/usr/lib/x86_64-linux-gnu/libhcrypto.so.4
sgx.trusted_files.libnsl = file:/lib/x86_64-linux-gnu/libnsl.so.1
sgx.trusted_files.hosts = file:hosts
sgx.trusted_files.resolv = file:resolv.conf
sgx.trusted_files.gai = file:gai.conf
sgx.allowed_files.tmp = file:/tmp
-65
View File
@@ -1,65 +0,0 @@
# Configuration for getaddrinfo(3).
#
# So far only configuration for the destination address sorting is needed.
# RFC 3484 governs the sorting. But the RFC also says that system
# administrators should be able to overwrite the defaults. This can be
# achieved here.
#
# All lines have an initial identifier specifying the option followed by
# up to two values. Information specified in this file replaces the
# default information. Complete absence of data of one kind causes the
# appropriate default information to be used. The supported commands include:
#
# reload <yes|no>
# If set to yes, each getaddrinfo(3) call will check whether this file
# changed and if necessary reload. This option should not really be
# used. There are possible runtime problems. The default is no.
#
# label <mask> <value>
# Add another rule to the RFC 3484 label table. See section 2.1 in
# RFC 3484. The default is:
#
#label ::1/128 0
#label ::/0 1
#label 2002::/16 2
#label ::/96 3
#label ::ffff:0:0/96 4
#label fec0::/10 5
#label fc00::/7 6
#label 2001:0::/32 7
#
# This default differs from the tables given in RFC 3484 by handling
# (now obsolete) site-local IPv6 addresses and Unique Local Addresses.
# The reason for this difference is that these addresses are never
# NATed while IPv4 site-local addresses most probably are. Given
# the precedence of IPv6 over IPv4 (see below) on machines having only
# site-local IPv4 and IPv6 addresses a lookup for a global address would
# see the IPv6 be preferred. The result is a long delay because the
# site-local IPv6 addresses cannot be used while the IPv4 address is
# (at least for the foreseeable future) NATed. We also treat Teredo
# tunnels special.
#
# precedence <mask> <value>
# Add another rule to the RFC 3484 precedence table. See section 2.1
# and 10.3 in RFC 3484. The default is:
#
#precedence ::1/128 50
#precedence ::/0 40
#precedence 2002::/16 30
#precedence ::/96 20
#precedence ::ffff:0:0/96 10
#
# For sites which prefer IPv4 connections change the last line to
#
#precedence ::ffff:0:0/96 100
#
# scopev4 <mask> <value>
# Add another rule to the RFC 6724 scope table for IPv4 addresses.
# By default the scope IDs described in section 3.2 in RFC 6724 are
# used. Changing these defaults should hardly ever be necessary.
# The defaults are equivalent to:
#
#scopev4 ::ffff:169.254.0.0/112 2
#scopev4 ::ffff:127.0.0.0/104 2
#scopev4 ::ffff:0.0.0.0/96 14
-8
View File
@@ -1,8 +0,0 @@
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
-2
View File
@@ -1,2 +0,0 @@
nameserver 8.8.8.8
nameserver 8.8.4.4
-3
View File
@@ -1,3 +0,0 @@
/test_files/bzip2
/test_files/gzip
/test_files/hello
-130
View File
@@ -1,130 +0,0 @@
test_files = test_files
exec_target = $(addsuffix .manifest,gcc as ld cc1 collect2)
clean-extra = clean-garbages
huge_rule = sys.stack.size = 64M\nsys.brk.size = 256M\nglibc.heap_size = 16M\nsgx.enclave_size = 2G
extra_rules = \
-e 's:\$$(DEBUGTYPE):$(if $(DEBUG),inline,none):g' \
-e 's:\$$(GCCDIR):$(patsubst %/cc1,%,$(shell gcc -print-file-name=cc1)):g' \
-e 's:\$$(HUGERULE):$(if $(HUGE),$(huge_rule),):g'
level = ../../
include ../../Makefile
GCC_VER = 4.8.4
BINUTILS_VER = 2.20.1
GMP_SRC = gmp-5.1.3
GMP_OBJ = libgmp.so.3
GMPXX_OBJ = libgmpxx.so.4
PPL_SRC = ppl-1.1
PPL_OBJ = libppl_c.so.2
MPFR_SRC = mpfr-3.1.2
MPFR_OBJ = libmpfr.so.1
MPC_SRC = mpc-1.0.1
MPC_OBJ = libmpc.so.2
LINK_LIBC =
GCC_FLAGS = \
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-gnu-ld \
--enable-languages=c,c++ --disable-shared --disable-multilib \
--with-gmp=$(PWD)/obj --with-mpfr=$(PWD)/obj --with-mpc=$(PWD)/obj --without-cloog \
--without-htmldir --without-pdfdir --without-docdir --without-datarootdir \
--disable-cloog-version-check --disable-stage1-languages --disable-objc-gc \
--disable-bootstrap --disable-maintainer-mode --disable-werror \
$(LINK_LIBC)
GCC_MAKE_FLAGS = \
LD_LIBRARY_PATH="$(PWD)/obj/lib:/usr/lib:/lib"
obj/bin/gcc: src/gcc-$(GCC_VER) obj/bin/ld $(addprefix obj/lib/,$(GMP_OBJ) $(GMPXX_OBJ) $(PPL_OBJ) $(MPFR_OBJ) $(MPC_OBJ))
cd $< && ./configure --prefix=$(PWD)/obj $(GCC_FLAGS)
$(MAKE) -C $< $(GCC_MAKE_FLAGS)
$(MAKE) -C $< install
src/gcc-$(GCC_VER): gcc-$(GCC_VER).tar.bz2 src
cd src && tar -xjf ../$<
obj/bin/ld: src/binutils-$(BINUTILS_VER)
cd $< && ./configure --prefix=$(PWD)/obj $(GCC_FLAGS) --enable-shared
$(MAKE) -C $< $(GCC_MAKE_FLAGS)
$(MAKE) -C $< install
src/binutils-$(BINUTILS_VER): binutils-$(BINUTILS_VER).tar.bz2 src
cd src && tar -xmjf ../$<
obj/lib/$(GMP_OBJ) obj/lib/$(GMPXX_OBJ): src/$(GMP_SRC)
cd $< && ./configure --prefix=$(PWD)/obj --enable-cxx --enable-shared \
$(LINK_LIBC)
$(MAKE) -C $<
$(MAKE) -C $< install
src/$(GMP_SRC): $(GMP_SRC).tar.bz2 src
cd src && tar -xmjf ../$<
obj/lib/$(PPL_OBJ): src/$(PPL_SRC) obj/lib/$(GMP_OBJ)
cd $< && ./configure --prefix=$(PWD)/obj --with-libgmp-prefix=$(PWD)/obj --enable-shared \
$(LINK_LIBC) CXXFLAGS=-fpermissive
$(MAKE) -C $<
$(MAKE) -C $< install
src/$(PPL_SRC): $(PPL_SRC).tar.gz src
cd src && tar -xmzf ../$<
obj/lib/$(MPFR_OBJ): src/$(MPFR_SRC) obj/lib/$(GMP_OBJ)
cd $< && ./configure --prefix=$(PWD)/obj --enable-shared \
$(LINK_LIBC) CXXFLAGS=-D__gmp_const=const
$(MAKE) -C $<
$(MAKE) -C $< install
src/$(MPFR_SRC): $(MPFR_SRC).tar.bz2 src
cd src && tar -xmjf ../$<
obj/lib/$(MPC_OBJ): src/$(MPC_SRC)
cd $< && ./configure --prefix=$(PWD)/obj --with-gmp=$(PWD)/obj --enable-shared \
$(LINK_LIBC)
$(MAKE) -C $<
$(MAKE) -C $< install
src/$(MPC_SRC): $(MPC_SRC).tar.gz src
cd src && tar -xmzf ../$<
regression:
@echo "\n\nBuilding GCC..."
@$(MAKE) >> /dev/null 2>&1
@echo "\n\nCompile hello.c:"
-./gcc.manifest test_files/helloworld.c -o test_files/hello
@chmod 755 test_files/hello
-./test_files/hello
@rm -f test_files/hello
@echo "\n\nCompile bzip2.c:"
-./gcc.manifest test_files/bzip2.c -o test_files/bzip2
@chmod 755 test_files/bzip2
@[ ! -f bzip2.tmp ] || rm -f bzip2.tmp
@cp -f test_files/bzip2 test_files/bzip2.copy
-./test_files/bzip2 -z test_files/bzip2.copy
-./test_files/bzip2 -d test_files/bzip2.copy.bz2
diff -q test_files/bzip2 test_files/bzip2.copy
@rm -f test_files/bzip2 test_file/bzip2.copy
@echo "\n\nCompile gzip.c:"
-./gcc.manifest test_files/gzip.c -o test_files/gzip
@chmod 755 test_files/gzip
@cp -f test_files/gzip test_files/gzip.copy
-./test_files/gzip test_files/gzip.copy
-./test_files/gzip -d test_files/gzip.copy.gz
diff -q test_files/gzip test_files/gzip.copy
@rm -f test_files/gzip test_files/gzip.copy
src:
mkdir -p src
distclean: clean
rm -rf src obj
clean-garbages:
rm -rf cc*.s cc*.c cc*.ld cc*.le cc*.o a.out
@@ -1,36 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:/usr/bin/as
loader.execname = /usr/bin/as
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.env.PATH = /bin:/usr/bin
loader.debug_type = $(DEBUGTYPE)
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libz = file:/lib/x86_64-linux-gnu/libz.so.1
sgx.trusted_files.libopcodes = file:/usr/lib/x86_64-linux-gnu/libopcodes-2.26.1-system.so
sgx.trusted_files.libbfd = file:/usr/lib/x86_64-linux-gnu/libbfd-2.26.1-system.so
sgx.allowed_files.tmp = file:/tmp
sgx.allowed_files.test_files = file:test_files
Binary file not shown.
@@ -1,43 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:$(GCCDIR)/cc1
loader.execname = cc1
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.env.PATH = /bin:/usr/bin
loader.debug_type = $(DEBUGTYPE)
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
$(HUGERULE)
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libz = file:/lib/x86_64-linux-gnu/libz.so.1
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.isl = file:/usr/lib/x86_64-linux-gnu/libisl.so.15
sgx.trusted_files.mpc = file:/usr/lib/x86_64-linux-gnu/libmpc.so.3
sgx.trusted_files.mpfr = file:/usr/lib/x86_64-linux-gnu/libmpfr.so.4
sgx.trusted_files.gmp = file:/usr/lib/x86_64-linux-gnu/libgmp.so.10
sgx.allowed_files.tmp = file:/tmp
sgx.allowed_files.test_files = file:test_files
sgx.allowed_files.inc = file:/usr/include
sgx.allowed_files.gccinc = file:$(GCCDIR)/include
sgx.allowed_files.gccincfixed = file:$(GCCDIR)/include-fixed
@@ -1,37 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:$(GCCDIR)/collect2
loader.execname = collect2
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.env.PATH = /bin:/usr/bin
loader.debug_type = $(DEBUGTYPE)
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.linker = file:/usr/bin/ld
sgx.allowed_files.tmp = file:/tmp
sgx.allowed_files.test_files = file:test_files
sgx.trusted_children.linker = file:ld.sig
Binary file not shown.
@@ -1,43 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:/usr/bin/gcc
loader.execname = /usr/bin/gcc
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.env.PATH = /bin:/usr/bin
loader.debug_type = $(DEBUGTYPE)
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
sgx.enclave_size = 1G
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.cc1 = file:$(GCCDIR)/cc1
sgx.trusted_files.collect2 = file:$(GCCDIR)/collect2
sgx.trusted_files.as = file:/usr/bin/as
sgx.allowed_files.tmp = file:/tmp
sgx.allowed_files.test_files = file:test_files
sgx.trusted_children.cc1 = file:cc1.sig
sgx.trusted_children.collect2 = file:collect2.sig
sgx.trusted_children.as = file:as.sig
Binary file not shown.
@@ -1,47 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:/usr/bin/ld
loader.execname = /usr/bin/ld
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.env.PATH = /bin:/usr/bin
loader.debug_type = $(DEBUGTYPE)
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
sgx.enclave_size = 512M
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libz = file:/lib/x86_64-linux-gnu/libz.so.1
sgx.trusted_files.libbfd = file:/usr/lib/x86_64-linux-gnu/libbfd-2.26.1-system.so
sgx.trusted_files.liblto = file:$(GCCDIR)/liblto_plugin.so
sgx.trusted_files.libgcc = file:$(GCCDIR)/libgcc_s.so
sgx.trusted_files.libgcca = file:$(GCCDIR)/libgcc.a
sgx.trusted_files.crtend = file:$(GCCDIR)/crtend.o
sgx.trusted_files.crtbegin = file:$(GCCDIR)/crtbegin.o
sgx.allowed_files.tmp = file:/tmp
sgx.allowed_files.test_files = file:test_files
sgx.allowed_files.aout = file:a.out
sgx.allowed_files.hostdebug = file:/usr/lib/debug/usr/lib/x86_64-linux-gnu
sgx.allowed_files.hostusrlib = file:/usr/lib/x86_64-linux-gnu
sgx.allowed_files.hostlib = file:/lib/x86_64-linux-gnu
Binary file not shown.
Binary file not shown.
Binary file not shown.
-10
View File
@@ -1,10 +0,0 @@
/ab.*
/result-*
/OUTPUT
/build/
/html/
/lighttpd.conf
/lighttpd-*.conf
/lighttpd-*/
/server.pem
/dhparam.pem
-126
View File
@@ -1,126 +0,0 @@
manifests = lighttpd.manifest lighttpd-angel.manifest
SRCDIR = lighttpd-1.4.30
HOST = $(firstword $(shell ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' -m 1 | cut -d: -f2))
PORT = 8000
CORES = 4
THREADS = 25
conf_files = lighttpd-server.conf lighttpd.conf lighttpd-multithreaded.conf lighttpd-ssl.conf
target = build-lighttpd $(conf_files) test-data
exec_target = $(manifests)
clean-extra = clean-others
extra_rules = -e 's:\$$(HOST):$(HOST):g' -e 's:\$$(PORT):$(PORT):g'
level = ../../
include ../../Makefile
.PHONY: build-lighttpd
build-lighttpd: build/sbin/lighttpd
build/sbin/lighttpd: $(SRCDIR)
cd $(SRCDIR) && ./configure --prefix=$(PWD)/build \
--with-openssl --without-pcre --without-zlib --without-bzip2
$(MAKE) -C $(SRCDIR)
$(MAKE) -C $(SRCDIR) install
$(SRCDIR): %: %.tar.gz
tar -xmzf $<
lighttpd-server.conf:
rm -rf $@
echo "server.document-root = \"$(PWD)/html\"" >> $@
echo "server.port = $(PORT)" >> $@
echo "server.bind = \"$(HOST)\"" >> $@
lighttpd.conf:
rm -rf $@
echo "include \"lighttpd-server.conf\"" >> $@
echo "include \"lighttpd-generic.conf\"" >> $@
lighttpd-multithreaded.conf:
rm -rf $@
echo "include \"lighttpd-server.conf\"" >> $@
echo "server.max-worker = $(THREADS)" >> $@
echo "include \"lighttpd-generic.conf\"" >> $@
lighttpd-ssl.conf: server.pem dhparam.pem
rm -rf $@
echo "include \"lighttpd-server.conf\"" >> $@
echo "include \"lighttpd-generic.conf\"" >> $@
echo "" >> $@
echo "\$$SERVER[\"socket\"] == \"0.0.0.0:443\" {" >> $@
echo "ssl.engine = \"enable\"" >> $@
echo "ssl.pemfile = \"server.pem\"" >> $@
echo "ssl.cipher-list = \"ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA\"" >> $@
echo "ssl.honor-cipher-order = \"enable\"" >> $@
echo "ssl.dh-file = \"dhparam.pem\"" >> $@
echo "ssl.ec-curve = \"secp384r1\"" >> $@
echo "}" >> $@
server.pem:
openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes -subj "/cn=lighttpd/o=oscar/dc=cs/dc=stonybrook/dc=edu/"
dhparam.pem:
openssl dhparam -out dhparam.pem 2048
.PHONY: start-native-server
start-native-server:
$(PREFIX) build/sbin/lighttpd -D -m build/lib -f \
$(if $(CONF),$(CONF),lighttpd.conf)
.PHONY: start-multithreaded-native-server
start-multithreaded-native-server:
$(PREFIX) build/sbin/lighttpd -D -m build/lib -f \
$(if $(CONF),$(CONF),lighttpd-multithreaded.conf)
.PHONY: start-ssl-native-server
start-ssl-native-server:
$(PREFIX) build/sbin/lighttpd -D -m build/lib -f \
$(if $(CONF),$(CONF),lighttpd-ssl.conf)
.PHONY: start-graphene-server
start-graphene-server:
$(PREFIX) ./lighttpd.manifest -D -m /lighttpd -f \
$(if $(CONF),$(CONF),lighttpd.conf)
.PHONY: start-multithreaded-graphene-server
start-multithreaded-graphene-server:
$(PREFIX) ./lighttpd.manifest -D -m /lighttpd -f \
$(if $(CONF),$(CONF),lighttpd-multithreaded.conf)
.PHONY: start-ssl-graphene-server
start-ssl-graphene-server:
$(PREFIX) ./lighttpd.manifest -D -m /lighttpd -f \
$(if $(CONF),$(CONF),lighttpd-ssl.conf)
random-data = $(foreach n,1 2 3 4 5 6 7 8 9 10,2K.$n.html) \
$(foreach n,1 2 3 4 5,10K.$n.html) \
$(foreach n,1 2 3 4 5,100K.$n.html) \
$(foreach n,1 2 3,1M.$n.html) \
$(foreach n,1 2 3,10M.$n.html) \
$(foreach n,1 2 3,100.$n.html)
test-data = html/oscar-web html/oscar-web-static html/random \
$(addprefix html/random/,$(random-data))
html/%: ../web-data/%.tar.gz
[ -d "$@" ] || (cd $(dir $@) && tar -xzf ../$^)
html/random:
mkdir -p $@
html/random/%.html: html/random
dd if=/dev/urandom of=$@ count=1 bs=$(basename $(basename $(notdir $@)))
test-data: $(test-data)
.PHONY: distclean
distclean: clean
rm -rf build $(SRCDIR)
.PHONY: clean-others
clean-others:
rm -rf $(conf_files) $(test-data)
-88
View File
@@ -1,88 +0,0 @@
Running lighttpd tests is conceptually straightforward. You start a
server, then make requests from a remote host. There are some good
websites/blogs that discuss properly benchmarking a webserver. We want
to test how efficiently Graphene handles requests, not the speed of
the network stack in the OS. So we are using very small static files.
See the wiki page for more details.
7/23/13:
To start a server in graphene,
make start-graphene-server
To start a server on any other platform,
make start-native-server
Now that your server is up and running, it is time to test it. From a
remote host, you can use the run-apachebench.sh script to programatically submit
requests at various loads. The usage of that script is as follows:
./run-apachebench.sh <ip-of-server> <port-of-server> <concurrency-level>
The script will append the output to a file "ab.n<N>.c<C>"
The output will look something like this:
*** BEGIN OUTPUT ***
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 130.245.153.32 (be patient)
Server Software: lighttpd/1.4.30
Server Hostname: 130.245.153.32
Server Port: 8000
Document Path: /random/100.1.html
Document Length: 100 bytes
Concurrency Level: 100
Time taken for tests: 4.110 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 16650000 bytes
HTML transferred: 5000000 bytes
Requests per second: 12164.64 [#/sec] (mean)
Time per request: 8.221 [ms] (mean)
Time per request: 0.082 [ms] (mean, across all concurrent requests)
Transfer rate: 3955.88 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 1 8 8.7 7 202
Waiting: 1 8 8.7 7 202
Total: 2 8 8.7 8 203
Percentage of the requests served within a certain time (ms)
50% 8
66% 8
75% 8
80% 8
90% 8
95% 8
98% 8
99% 8
100% 203 (longest request)
*** END OUTPUT ***
The number we were reporting is the transfer rate. So for this
example, the we would report a bandwidth of 3.95588 Mbytes/second.
NOTES:
To run kvm and lxc, you need to set up a bridge. But you do not want
extraneous interfaces when you are not using them, so make
sure to bring them down before testing native linux or graphene.
If you are within kvm or lxc, your ip will not be that of your
host. Make sure your ip matches the ip in the conf file.
If you have a lot of time and want to do a good job, throw out the top
and the low numbers, and report the mean of your large sample.
@@ -1,46 +0,0 @@
#!/usr/bin/env bash
## On Ubuntu, this script requires apache2-utils for the ab binary.
# Run like: ./benchmark-http.sh server
# where server is the host/port running the web server
declare -A THROUGHPUTS
declare -A LATENCIES
LOOP=5
DOWNLOAD_HOST=$1
DOWNLOAD_FILE=random/10K.1.html
REQUESTS=10000
CONCURRENCY_LIST="1 2 4 8 16 32 64 128 256"
OPTIONS="-k"
RESULT=result-$(date +%y%m%d-%H%M%S)
touch $RESULT
RUN=0
while [ $RUN -lt $LOOP ]
do
for CONCURRENCY in $CONCURRENCY_LIST
do
rm -f OUTPUT
echo "ab $OPTIONS -n $REQUESTS -c $CONCURRENCY http://$DOWNLOAD_HOST/$DOWNLOAD_FILE"
ab $OPTIONS -n $REQUESTS -c $CONCURRENCY http://$DOWNLOAD_HOST/$DOWNLOAD_FILE > OUTPUT || exit $?
sleep 5
THROUGHPUT=$(grep -m1 "Requests per second:" OUTPUT | awk '{ print $4 }')
LATENCY=$(grep -m1 "Time per request:" OUTPUT | awk '{ print $4 }')
THROUGHPUTS[$CONCURRENCY]="${THROUGHPUTS[$CONCURRENCY]} $THROUGHPUT"
LATENCIES[$CONCURRENCY]="${LATENCIES[$CONCURRENCY]} $LATENCY"
echo "concurrency=$CONCURRENCY, throughput=$THROUGHPUT, latency=$LATENCY"
done
RUN=$(expr $RUN + 1)
done
for CONCURRENCY in $CONCURRENCY_LIST
do
THROUGHPUT=$(echo ${THROUGHPUTS[$CONCURRENCY]} | tr " " "\n" | sort -n | awk '{a[NR]=$0}END{if(NR%2==1)print a[int(NR/2)+1];else print(a[NR/2-1]+a[NR/2])/2}')
LATENCY=$(echo ${LATENCIES[$CONCURRENCY]} | tr " " "\n" | sort -n | awk '{a[NR]=$0}END{if(NR%2==1)print a[int(NR/2)+1];else print(a[NR/2-1]+a[NR/2])/2}')
echo "$THROUGHPUT,$LATENCY" >> $RESULT
done
echo "Result file: $RESULT"
@@ -1 +0,0 @@
Test OK!
@@ -1 +0,0 @@
<? echo "Test OK!" ?>
Binary file not shown.
@@ -1,52 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:build/sbin/lighttpd-angel
loader.env.LD_LIBRARY_PATH = /lib:/lighttpd
loader.debug_type = none
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
fs.mount.build.type = chroot
fs.mount.build.path = /lighttpd
fs.mount.build.uri = file:build/lib
fs.mount.html.type = chroot
fs.mount.html.path = $(PWD)/html
fs.mount.html.uri = file:html
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
# allow to bind on port for listening
net.rules.1 = $(HOST):$(PORT):0.0.0.0:0-65535
sys.stack.size = 256K
sys.brk.size = 4M
glibc.heap_size = 16M
sgx.thread_num = 28
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.lib1 = file:build/lib/mod_indexfile.so
sgx.trusted_files.lib2 = file:build/lib/mod_dirlisting.so
sgx.trusted_files.lib3 = file:build/lib/mod_staticfile.so
sgx.trusted_files.conf1 = file:lighttpd.conf
sgx.trusted_files.conf2 = file:lighttpd-generic.conf
sgx.trusted_files.conf3 = file:lighttpd-server.conf
sgx.trusted_files.conf4 = file:lighttpd-multithreaded.conf
sgx.allowed_files.html = file:html
@@ -1,64 +0,0 @@
server.event-handler = "select"
#server.event-handler = "linux-sysepoll"
server.max-keep-alive-requests = 0
index-file.names = ( "index.html", "index.php" )
mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".wma" => "audio/x-ms-wma",
".wax" => "audio/x-ms-wax",
".ogg" => "application/ogg",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xbm" => "image/x-xbitmap",
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".php" => "text/html",
".js" => "text/javascript",
".asc" => "text/plain",
".c" => "text/plain",
".cpp" => "text/plain",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
".txt" => "text/plain",
".spec" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf",
".wmv" => "video/x-ms-wmv",
".bz2" => "application/x-bzip",
".tbz" => "application/x-bzip-compressed-tar",
".tar.bz2" => "application/x-bzip-compressed-tar",
# make the default mime type application/octet-stream.
"" => "application/octet-stream",
)
@@ -1,63 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:build/sbin/lighttpd
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/lighttpd
loader.debug_type = none
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
fs.mount.lib64.type = chroot
fs.mount.lib64.path = /lib/x86_64-linux-gnu
fs.mount.lib64.uri = file:/lib/x86_64-linux-gnu
fs.mount.build.type = chroot
fs.mount.build.path = /lighttpd
fs.mount.build.uri = file:build/lib
fs.mount.html.type = chroot
fs.mount.html.path = $(PWD)/html
fs.mount.html.uri = file:html
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
# allow to bind on port for listening
net.allow_bind.1 = $(HOST):$(PORT)
sys.stack.size = 256K
sys.brk.size = 4M
glibc.heap_size = 16M
sgx.thread_num = 28
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libssl = file:/lib/x86_64-linux-gnu/libssl.so.1.0.0
sgx.trusted_files.libcrypto = file:/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
sgx.trusted_files.lib1 = file:build/lib/mod_indexfile.so
sgx.trusted_files.lib2 = file:build/lib/mod_dirlisting.so
sgx.trusted_files.lib3 = file:build/lib/mod_staticfile.so
sgx.trusted_files.conf1 = file:lighttpd.conf
sgx.trusted_files.conf2 = file:lighttpd-generic.conf
sgx.trusted_files.conf3 = file:lighttpd-server.conf
sgx.trusted_files.conf4 = file:lighttpd-multithreaded.conf
sgx.trusted_files.conf5 = file:lighttpd-ssl.conf
sgx.trusted_files.server_key = file:server.pem
sgx.trusted_files.server_dh_key = file:dhparam.pem
sgx.allowed_files.html = file:html
-1
View File
@@ -1 +0,0 @@
/lmbench-2.5/bin/
-53
View File
@@ -1,53 +0,0 @@
LMBENCHDIR = lmbench-2.5
LINUXDIR = $(LMBENCHDIR)/bin/linux/
host_files = /bin/sh /usr/include/x86_64-linux-gnu/sys/types.h
lmbench_tests = $(addprefix $(LINUXDIR),lat_syscall lat_connect lat_fcntl \
lat_select lat_fs lat_mmap lat_fifo lat_mem_rd lat_msg \
lat_tcp lat_udp lat_unix_connect lat_pagefault \
bw_tcp bw_mem bw_unix lat_proc lat_ctx lat_rpc \
lat_unix lat_sig lat_http lat_pipe \
bw_pipe bw_file_rd bw_mmap_rd lmhttp lmdd)
manifests = $(addprefix $(LINUXDIR),$(patsubst %.template,%,$(wildcard *.manifest.template)) manifest)
target = $(lmbench_tests)
clean-extra = clean-lmbench
level = ../../
include ../../Makefile
export CC
export CFLAGS
$(LINUXDIR)Makefile: Makefile.lmbench
ln -sf ../../../$< $@
build-manifest: $(LINUXDIR) $(LINUXDIR)Makefile
$(MAKE) -C $(LINUXDIR)
$(lmbench_tests): $(LINUXDIR) build-manifest
$(LINUXDIR): $(wildcard $(LMBENCHDIR)/src/*.c) $(wildcard $(LMBENCHDIR)/src/*.h)
$(MAKE) -C $(LMBENCHDIR)/src OS=linux
lmbench_config = $(LINUXDIR)$(shell $(LMBENCHDIR)/scripts/config)
$(lmbench_config):
cd $(LMBENCHDIR)/scripts && env OS=linux ./config-run
test-native: $(lmbench_tests) $(lmbench_config)
cd $(LMBENCHDIR)/scripts && env OS=linux ./results
test-graphene: all $(lmbench_config)
cd $(LMBENCHDIR)/scripts && \
env LOADER=./pal_loader OS=linux RESULTS=results/graphene \
./results
regression: all
cp -f $(LMBENCHDIR)/lmbench-regression $(LMBENCHDIR)/bin/linux
cd $(LMBENCHDIR)/bin/linux && \
env LOADER=./pal_loader OS=linux \
./lmbench-regression
clean-lmbench:
$(MAKE) -C $(LMBENCHDIR) clean
@@ -1,22 +0,0 @@
manifests = $(patsubst ../../../%.template,%,$(wildcard ../../../*.manifest.template)) manifest
lmbench_tests = lat_syscall lat_connect lat_fcntl \
lat_select lat_fs lat_mmap lat_fifo lat_mem_rd lat_msg \
lat_tcp lat_udp lat_unix_connect lat_pagefault \
bw_tcp bw_mem bw_unix lat_proc lat_ctx lat_rpc \
lat_unix lat_sig lat_http lat_pipe \
bw_pipe bw_file_rd bw_mmap_rd lmhttp lmdd \
sh.manifest hello.manifest
exec_target = $(lmbench_tests)
target = $(manifests)
level = ../../../../../
include ../../../../../Makefile
sh.manifest.sgx: /tmp/hello
/tmp/hello: hello
cp -f $< $@
$(addsuffix .template,$(manifests)): %: ../../../%
ln -sf $< $@
@@ -1,18 +0,0 @@
loader.preload = file:$(SHIMPATH)
loader.exec = file:hello
loader.env.LD_LIBRARY_PATH = /lib:/lib64
loader.debug_type = none
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:
sys.brk.size = 32M
sys.stack.size = 4M
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
@@ -1,45 +0,0 @@
loader.preload = file:$(SHIMPATH)
loader.env.LD_LIBRARY_PATH = /lib:/lib64
loader.debug_type = none
fs.mount.tmp1.type = chroot
fs.mount.tmp1.path = /tmp
fs.mount.tmp1.uri = file:/tmp
fs.mount.tmp2.type = chroot
fs.mount.tmp2.path = /var/tmp
fs.mount.tmp2.uri = file:/var/tmp
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
fs.mount.bin.type = chroot
fs.mount.bin.path = /bin/sh
fs.mount.bin.uri = file:/bin/sh
fs.mount.inc.type = chroot
fs.mount.inc.path = /usr/include/x86_64-linux-gnu/sys/types.h
fs.mount.inc.uri = file:/usr/include/x86_64-linux-gnu/sys/types.h
net.allow_bind.1 = 0.0.0.0:31233-31237
net.allow_bind.2 = 0.0.0.0:34297-34298
net.allow_peer.1 = 127.0.0.1:0-65535
glibc.heap_size = 16M
sys.brk.size = 32M
sys.stack.size = 4M
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.sh = file:/bin/sh
sgx.allowed_files.tmp1 = file:/tmp
sgx.allowed_files.tmp2 = file:/var/tmp
sgx.allowed_files.inc = file:/usr/include/x86_64-linux-gnu/sys/types.h
sgx.trusted_children.hello = file:hello.sig
sgx.trusted_children.sh = file:sh.sig
@@ -1,28 +0,0 @@
loader.preload = file:$(SHIMPATH)
loader.exec = file:/bin/sh
loader.env.LD_LIBRARY_PATH = /lib:/lib64
loader.debug_type = none
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
glibc.heap_size = 16M
sys.brk.size = 32M
sys.stack.size = 4M
sgx.enclave_size = 512M
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.hello = file:/tmp/hello
sgx.trusted_children.hello = file:hello.sig
-8
View File
@@ -1,8 +0,0 @@
/Broken.csv
/Failed.csv
/Passed.csv
/opt/
/run_output
/syscalls.graphene
/ltp-full-*.tar.xz
/ltp-full-*/
-88
View File
@@ -1,88 +0,0 @@
epoll_wait01
fcntl15
fcntl15_64
flock03
fork07
fork08
inotify06
fanotify06
linkat01
lseek10
mkdir01
mkdir09
mknod03
mknod08
mount05
mremap01
msgctl07
msgrcv03
msgrcv04
msgrcv06
open12
open14
openat03
pselect02
pselect02_64
preadv01
preadv01_64
preadv02
preadv02_64
pwritev01
pwritev01_64
pwritev02
pwritev02_64
rename04
rename14
rmdir05
rt_sigaction02
rt_sigprocmask02
rt_sigqueueinfo01
semctl03
semctl06
semop03
sendfile04
sendfile04_64
sendmsg02
setpgid03
sighold02
sigrelse01
stat06
stat06_64
times03
truncate02
truncate02_64
unlink07
unlink08
waitid02
writev02
writev05
getresuid02
getresuid03
epoll-ltp
epoll_pwait01
fork06
fork12
fork14
getitimer02
getresgid02
getresgid03
getrusage02
gettimeofday01
gettimeofday02
kill02
kill06
kill08
kill10
kill12
nosleep04
nanosleep04
pipe07
process_vm_readv02
process_vm_readv03
process_vm01 -r
prot_hsymlinks
setitimer02
set_robust_list01
signal01
trace05
waitpid04
-47
View File
@@ -1,47 +0,0 @@
Flaky tests
-----------
These should be debugged, or revisited after memory debugging PRs are merged
waitpid03,1 and 2 - fails about 20% of the time
preadv01 - fails intermittently in CI - perhaps an unrelated bug?
preadv01,2
preadv01,3
preadv01,4
waitpid02 - Gets a segfault in debug build fairly often
waitpid02,1
waitpid02,2
waitpid02,3
clock_nanosleep01,11 - Pretty prone to hanging, don't think it is a timeout
sendfile05,1 - pretty prone to a segfault, perhaps an unrelated issue
Internal memory fault at 0x8 (IP = +0x34f1a, VMID = 3902099696, TID = 1)
Prone to hanging - I think a memory corruption issue that may have a pending fix
recvfrom01,1
recvfrom01,2
futex_wait03,1 (see https://github.com/oscarlab/graphene/pull/180#issuecomment-368970338)
Intermittent seg fault
kill03,1
Intermittent hang
send01,1
send01,2
sendto01,1
sendto01,2
sendto01,3
recv01,1
recv01,2
Intermittent failure on Linux host
poll02,1
Intermittent failure on Linux debug host
recvmsg01,1
recvmsg01,2
-50
View File
@@ -1,50 +0,0 @@
SRCURL = https://github.com/linux-test-project/ltp/releases/download/
SRCVERSION = 20170116
SRCDIR = ltp-full-$(SRCVERSION)
BUILDDIR = opt/ltp
TESTCASEDIR = $(BUILDDIR)/testcases/bin
target = $(BUILDDIR)/bin/run_in_graphene.awk $(TESTCASEDIR)/pal_loader build-manifest
exec_target =
clean-extra = clean-build
level = ../../
include ../../Makefile
$(SRCDIR).tar.xz:
wget $(SRCURL)/$(SRCVERSION)/$@
$(SRCDIR)/configure: $(SRCDIR).tar.xz
tar -xmJf $<
$(BUILDDIR)/runltp: $(SRCDIR)/configure
cd $(SRCDIR) && ./configure
cd $(SRCDIR) && make all
cd $(SRCDIR) && make "DESTDIR=$(PWD)" SKIP_IDCHECK=1 install
patch -d $(dir $@) < runltp.patch
$(BUILDDIR)/bin/run_in_graphene.awk: run_in_graphene.awk $(BUILDDIR)/runltp
cp -f $< $@
$(TESTCASEDIR)/pal_loader: $(BUILDDIR)/runltp
ln -sf $(call relative-to,$(dir $@),../../../Runtime/pal_loader) $@
build-manifest: $(TESTCASEDIR)/manifest.template $(TESTCASEDIR)/Makefile
cd $(TESTCASEDIR) && make
$(TESTCASEDIR)/manifest.template: manifest.template
cp -f $< $@
$(TESTCASEDIR)/Makefile: Makefile.testcases
ln -sf ../../../../$< $@
regression:
@echo "\n\nBuilding LTP..."
@$(MAKE) >> /dev/null 2>&1
@echo "\n\nLTP tests for system calls:"
./syscalls.sh
clean-build:
rm -rf $(BUILDDIR)
@@ -1,19 +0,0 @@
manifests = $(wildcard ../../../../*.manifest.template) manifest
testcases = $(filter-out $(wildcard *.*) $(patsubst %/,%,$(wildcard */)) Makefile manifest pal_loader,$(wildcard *))
exec_target = $(testcases)
target = $(manifests) $(testcases) etc/nsswitch.conf etc/passwd
level = ../../../../../../
include ../../../../../../Makefile
$(addsuffix .template,$(manifests)): %: ../../../../%
ln -sf $< $@
etc/nsswitch.conf:
mkdir -p etc
echo "passwd: compat\ngroup: compat\nshadow: compat\nhosts: files" > $@
etc/passwd:
mkdir -p etc
echo "root:x:0:0:root:/root:/bin/bash\nnobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin" > $@
File diff suppressed because it is too large Load Diff
-29
View File
@@ -1,29 +0,0 @@
LTP FOR GRAPHENE
----------------
Running LTP test cases in Graphene :
1) run 'make' in LibOS/shim/test/apps/ltp
2) cd Graphene/LibOS/shim/test/regression
3) make regression
The above command will start running LTP system call test cases in Graphene.
It works in 2 steps:
1) Creates a testfile (Graphene/LibOS/shim/test/apps/ltp/syscalls.graphene) with all the LTP system call test cases to run, excluding the ones mentioned in Graphene/LibOS/shim/test/apps/ltp/BLOCKED. “BLOCKED” contains all the test cases which are hanging in the Graphene and thus are excluded from regression tests.
2) Calls Graphene/LibOS/shim/test/apps/ltp/fetch.py It runs the LTP test cases and display output on the terminal.
Some LTP testcases hangs in Graphene. This python script sets a timeout for each testcase referring the file 'TIMEOUTS'. Default timeout is set 20 seconds in the script.
It also shows, new passed testcases (passed testcases which are not in Graphene/LibOS/shim/test/apps/ltp/PASSED) and new failed testcases (failed testcases which are in PASSED).
It also creates files run_output, Failed.csv, Passed.csv, Blocked.csv under Graphene/LibOS/shim/test/apps/ltp for reference.
Results are of 4 types :
[Pass] -> Testcase passed
[Failed] -> Testcase failed
[Hanged] -> Testcase hanged and thereafter killed
[Broken] -> Either system call is not implemented in Graphene or test preparation failed
To run a single testcase, execute the following commands:
cd <LTP_REPO>/opt/ltp/testcases/bin/
<GRAPHENE_DIR>/Runtime/pal_loader <TEST_BINARY>
In this way, one can debug one particular syscall testcase.
As you fix bugs, keep updating PASSED BLOCKED lists.
-60
View File
@@ -1,60 +0,0 @@
testcase,timeout
alarm01,5
alarm02,40
alarm03,40
alarm05,40
alarm06,16
brk01,40
chmod02,40
clock_nanosleep01,40
clone03,40
clone05,30
clone06,40
dup204,40
exit01,40
faccessat01,80
fchdir02,40
fchmod07,40
fchmodat01,40
fcntl02_64,40
fcntl08_64,40
fcntl13_64,40
fork02,40
futex_wait_bitset02,40
fsync03,40
gethostname01,40
getgid03,40
getpid02,40
gettid01,40
msgsnd01,40
mprotect04,40
newuname01,40
kill09,80
lseek02,40
poll01,40
pread01_64,40
pread01,40
pread02,40
preadv01,80
pwrite01_64,40
pwrite04_64,40
pwritev01,40
read01,40
readdir01,40
readv01,40
semop04,40
sendfile03_64,40
setuid01,40
setuid02,40
sockioctl01,40
sigaltstack02,40
socket01,40
socket02,40
stat05_64,40
sync01,40
syscall01,80
wait401,40
waitpid03,80
waitpid05,240
write03,40
write05,40
-17
View File
@@ -1,17 +0,0 @@
#!/usr/bin/awk -f
BEGIN{
while(getline < "BLOCKED") {
test = $1$2$3
blocked[test]
}
}
NF && ! /^#/ {
test = $2$3
if(!(test in blocked)) {
s=$1 "_graphene ./pal_loader"
for (i=2; i<=NF; i++) {
s = s " " $i
}
print s
}
}
@@ -1,35 +0,0 @@
#!/usr/bin/awk -f
BEGIN{
while(getline < "BLOCKED") {
test = $1$2$3
blocked[test]
}
if (SGX) {
pal_str = "./pal_loader SGX"
} else {
pal_str = "./pal_loader"
}
}
NF && ! /^#/ {
test = $2$3
if($1=="splice02") {
s = pal_str
for (i=2; i<=NF; i++) {
s = s " " $i
if($i=="|") {
i++
s = s " " pal_str " " $i
}
}
print s
}
else if(! (test in blocked)) {
s = pal_str
for (i=2; i<=NF; i++) {
s = s " " $i
}
print s
}
}
-181
View File
@@ -1,181 +0,0 @@
import subprocess
import csv
import os
import time
import signal
import tempfile
import multiprocessing
import sys
def run(cmd, timeout, test):
try:
timeout = timeout * 100
result = {}
result['test'] = test
outfile = tempfile.NamedTemporaryFile(mode='w+b')
p = subprocess.Popen(cmd, shell=True, stdout=outfile, stderr=subprocess.STDOUT, preexec_fn=os.setsid, close_fds=True)
result['curtime'] = time.time()
result['endtime'] = result['curtime'] + timeout
sleep_time = 0
finish = False
while sleep_time < timeout:
if p.poll() is not None:
finish = True
break
sleep_time += 1
time.sleep(.01)
result['finish'] = finish
outfile.seek(0)
result['output'] = outfile.readlines()
return result
except Exception as e:
print str(e)
return None
finally:
if p is not None and p.poll() is None:
print 'killing %s' % test
os.killpg(os.getpgid(p.pid), signal.SIGKILL)
def finish(result):
try:
test = result['test']
if not result['finish']:
print CRED + "[Hanged ] " + test + CEND
current_hanged[test] = 1
else:
reported = False
count = 1
for output in result['output']:
tokens = output.split()
if len(tokens) < 2:
continue
# Drop this line so that we get consistent offsets
if output == "WARNING: no physical memory support, process creation may be slow.\n":
continue
if tokens[1].isdigit():
test_subtest = test + "," + tokens[1]
count = int(tokens[1]) + 1
else:
test_subtest = test + "," + str(count)
count = count + 1
if "TINFO" in output or test_subtest in current_passed or test_subtest in current_failed or test in current_hanged or test_subtest in current_broken:
continue
if output:
output = output.strip()
print >>f1, output
if "TFAIL" in output:
print >>failed_tests_fh, test_subtest
print CRED + "[Fail ] " + test_subtest + CEND
current_failed[test_subtest] = 1
reported = True
elif "TPASS" in output or "PASS:" in output:
print >>passed_tests_fh, test_subtest
print CGREEN + "[Pass ] " + test_subtest + CEND
current_passed[test_subtest] = 1
reported = True
elif "TCONF" in output or "TBROK" in output or "BROK" in output or "error" in output:
print >>broken_tests_fh, test_subtest
# Syscall not implemented or test preparation failed
print "[Broken(a) ] " + test_subtest + CEND
current_broken[test_subtest] = 1
reported = True
if (not reported):
print >>broken_tests_fh, test
print CRED + "[Broken(b) ] " + test + CEND
for output in result['output']:
print output
current_broken[test] = 1
except Exception as e:
print str(e)
CRED = '\033[91m'
CGREEN = '\033[92m'
CEND = '\033[0m'
DEFAULT_TIMEOUT = 30
resultfile = "run_output"
stablePass = "PASSED"
timeouts = "TIMEOUTS"
failed_tests_file = "Failed.csv"
passed_tests_file = "Passed.csv"
broken_tests_file = "Broken.csv"
f1 = open(resultfile, 'w')
failed_tests_fh = open(failed_tests_file, 'w', 0)
passed_tests_fh = open(passed_tests_file, 'w', 0)
broken_tests_fh = open(broken_tests_file, 'w', 0)
failed_tests_fh.write("Test,Subtest number,Status\n")
passed_tests_fh.write("Test,Subtest number\n")
broken_tests_fh.write("Test,Subtest number,Status\n")
current_passed = dict()
current_failed = dict()
current_broken = dict()
current_hanged = dict()
timeouts_dict = dict()
with open(timeouts, 'rb') as csvfile:
test_timeout = csv.reader(csvfile)
test_timeout.next()
for row in test_timeout:
test = row[0]
timeout = row[1]
timeouts_dict[test] = int(timeout)
os.chdir("opt/ltp/testcases/bin")
pool = multiprocessing.Pool()
with open('../../../../syscalls.graphene') as testcases:
for line in testcases:
line = line.strip('\r\n\t')
tokens = line.split( )
if (tokens[1] == "SGX") :
test = tokens[2]
else :
test = tokens[1]
if test=="seq":
test = tokens[6] #splice02
try:
timeout = timeouts_dict[test]
except KeyError:
timeout = DEFAULT_TIMEOUT
pool.apply_async(run, args=([line], timeout, test), callback=finish)
os.chdir("../../../..")
pool.close()
pool.join()
stable_passed = dict()
with open(stablePass, 'rb') as csvfile:
test_subtest = csv.reader(csvfile)
test_subtest.next()
for row in test_subtest:
tst = row[0] + "," + row[1]
stable_passed[tst] = 1
print "\n\nRESULT [Difference] :\n---------------------\n"
rv = 0
for test in sorted(stable_passed):
if not test in current_passed:
print CRED + "Test '" + test + "' did not pass in the current run!!" + CEND
rv = -1
for test in sorted(current_passed):
if not test in stable_passed:
print CGREEN + "Test '" + test + "' passed in the current run!!" + CEND
print "\n"
sys.exit(rv)
@@ -1,38 +0,0 @@
loader.preload = file:$(SHIMPATH)
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib64
loader.env.PATH = /bin:/usr/bin:.
loader.env.LD_PRELOAD = /usr/lib/x86_64-linux-gnu/coreutils/libstdbuf.so
loader.env._STDBUF_O = L
loader.debug_type = none
fs.mount.shm.type = chroot
fs.mount.shm.path = /dev/shm
fs.mount.shm.uri = file:/tmp
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
fs.mount.lib64.type = chroot
fs.mount.lib64.path = /lib/x86_64-linux-gnu
fs.mount.lib64.uri = file:/lib/x86_64-linux-gnu
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
sys.brk.size = 32M
sys.stack.size = 4M
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libstdbuf = file:/usr/lib/x86_64-linux-gnu/coreutils/libstdbuf.so
sgx.allowed_files.tmp = file:/tmp
@@ -1,19 +0,0 @@
#!/usr/bin/awk -f
BEGIN{
getline < "PASSED"
while(getline < "PASSED") {
split($1$2$3, a, ",")
test = a[1]
passed[test]
}
}
NF && ! /^#/ {
test = $2$3
if(test in passed) {
s=$1 "_graphene ./pal_loader"
for (i=2; i<=NF; i++) {
s = s " " $i
}
print s
}
}
@@ -1,30 +0,0 @@
#!/usr/bin/awk -f
#
# Script for adding necessary valgrind calls before commands.
#
# Copyright (C) 2016 Stony Brook University.
# This file is part of Graphene library OS.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Chia-Che Tsai, Fall 2016
#
NF && ! /^#/ && ! /epoll/ {
s=$1 "_graphene ./pal_loader"
for (i = 2; i <= NF; i++) {
s = s " " $i
}
print s
}
-18
View File
@@ -1,18 +0,0 @@
--- runltp.old 2016-10-24 17:04:25.557950335 -0400
+++ runltp 2016-10-24 18:20:37.168448299 -0400
@@ -813,6 +813,15 @@ main()
fi
fi
+ ## Running all test in Graphene if $GRAPHENE_RUN = 1
+ if [ $GRAPHENE_RUN ]; then
+ awk -f ${LTPROOT}/bin/run_in_graphene.awk \
+ ${TMP}/alltests > \
+ ${TMP}/alltests.tmp
+ cp ${TMP}/alltests.tmp ${TMP}/alltests
+ rm -rf ${TMP}/alltests.tmp
+ fi
+
## Valgrind Check will work only when Kernel Fault Injection is not expected,
## We do not want to test Faults when valgrind is running
if [ $VALGRIND_CHECK ]; then
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
cd `dirname $0`
export LTPROOT=$PWD"/opt/ltp"
awk -v SGX=$SGX_RUN -f edit_sys_tests.awk $LTPROOT/runtest/syscalls > syscalls.graphene
cd $LTPROOT/../..
python fetch.py
-52
View File
@@ -1,52 +0,0 @@
manifests = make.manifest
graphene_dirs = LibOS/shim/src LibOS/shim/include Pal/lib Pal/include Pal/src
graphene_target = $(addprefix graphene/,$(graphene_dirs))
graphene_libs = $(addprefix graphene/Pal/src/,libpal.so libpal.a)
target = configure $(graphene_target) $(graphene_libs)
exec_target = $(manifests)
clean-extra = clean-tests
huge_rule = sys.stack.size = 64M\nsys.brk.size = 256M\nglibc.heap_size = 16M\nsgx.enclave_size = 2G
extra_rules = \
-e 's:\$$(DEBUGTYPE):$(if $(DEBUG),inline,none):g' \
-e 's:\$$(GCCDIR):$(patsubst %/cc1,%,$(shell gcc -print-file-name=cc1)):g' \
-e 's:\$$(HUGERULE):$(if $(HUGE),$(huge_rule),):g'
level = ../../
include ../../Makefile
test_tarballs = oggenc-1.4 bzip2-1.0.6
test_targets = $(test_tarballs) helloworld graphene
make_src = make-3.82
$(make_src) $(test_tarballs): %: %.tar.gz
[ -d $@ ] || tar -zmxf $<
$(make_src)/make:
cd $(make_src) && ./configure
cd $(make_src) && $(MAKE) CC="gcc -g"
$(graphene_target): graphene/%: ../../../../../%
cd $< && git checkout-index -a -f --prefix=$(PWD)/graphene/
$(graphene_libs): graphene/%: ../../../../../%
mkdir -p $(dir $@)
ln -sf $(shell readlink -f $<) $@
configure: $(test_targets)
for d in $(test_targets); do \
if [ ! -f $$d/Makefile ] && [ -f $$d/configure ]; then \
cd $$d; ./configure; cd ..; \
fi; \
done
distclean: clean-manifests clean-tests
rm -rf $(make_src) $(MAKE) result $(test_tarballs) $(graphene_target) $(graphene_libs)
clean-tests:
for d in $(test_targets); do ([ ! -d $$d ] || $(MAKE) -C $$d clean); done
Binary file not shown.
@@ -1,7 +0,0 @@
SRCDIR = LibOS/shim/src
all:
[ ! -d $(SRCDIR) ] || $(MAKE) -C $(SRCDIR)
clean:
[ ! -d $(SRCDIR) ] || $(MAKE) -C $(SRCDIR) clean
@@ -1,5 +0,0 @@
helloworld: helloworld.c
gcc -o helloworld helloworld.c
clean:
rm -rf helloworld
@@ -1,9 +0,0 @@
/* a simple helloworld test */
#include <stdio.h>
int main(int argc, char ** argv)
{
printf("Hello world (%s)!\n", argv[0]);
return 0;
}
Binary file not shown.
@@ -1,34 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:/usr/bin/make
loader.execname = make
loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.env.PATH = /bin:/usr/bin
loader.debug_type = $(DEBUGTYPE)
fs.start_dir = $(PWD)
fs.mount.lib1.type = chroot
fs.mount.lib1.path = /lib
fs.mount.lib1.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.bin.type = chroot
fs.mount.bin.path = /bin
fs.mount.bin.uri = file:/bin
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
fs.mount.pwd.type = chroot
fs.mount.pwd.path = $(PWD)
fs.mount.pwd.uri = file:$(PWD)
Binary file not shown.
-41
View File
@@ -1,41 +0,0 @@
manifests = memcached.manifest
SRCDIR = memcached-master
HOST = $(firstword $(shell ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' -m 1 | cut -d: -f2))
PORT = 8000
CORES = 4
MAXMEM = 256
MAXTHREADS = 16
target = memcached $(manifests)
exec_target = memcached
clean-extra = clean-build
extra_rules = \
-e 's:\$$(HOST):$(HOST):g' \
-e 's:\$$(PORT):$(PORT):g' \
-e 's:\$$(MEMSIZE):$(shell expr $(MAXMEM) + $(MAXMEM))M:g' \
-e 's:\$$(THREADNUM):$(shell expr 2 + $(MAXTHREADS)):g'
level = ../../
include ../../Makefile
master.zip:
wget https://github.com/memcached/memcached/archive/master.zip
$(SRCDIR)/configure: master.zip
unzip master.zip
cd $(SRCDIR) && ./autogen.sh
$(SRCDIR)/memcached: $(SRCDIR)/configure
cd $(SRCDIR) && ./configure
cd $(SRCDIR) && make
memcached: $(SRCDIR)/memcached
cp -f $< $@
clean-build:
rm -rf $(BUILDDIR)
distclean: clean
rm -rf $(SRCDIR)
@@ -1,54 +0,0 @@
#!$(PAL)
loader.preload = file:$(SHIMPATH)
loader.exec = file:memcached
loader.env.LD_LIBRARY_PATH = /lib:/usr/lib:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu
loader.debug_type = none
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.usr.type = chroot
fs.mount.usr.path = /usr
fs.mount.usr.uri = file:/usr
fs.mount.passwd.type = chroot
fs.mount.passwd.path = /etc/passwd
fs.mount.passwd.uri = file:/etc/passwd
fs.mount.shadow.type = chroot
fs.mount.shadow.path = /etc/shadow
fs.mount.shadow.uri = file:/etc/shadow
fs.mount.tmp.type = chroot
fs.mount.tmp.path = /tmp
fs.mount.tmp.uri = file:/tmp
# allow to bind on port for listening
net.allow_bind.1 = $(HOST):$(PORT)
sys.stack.size = 1m
sys.brk.size = 64M
glibc.heap_size = 16M
sgx.enclave_size = $(MEMSIZE)
sgx.thread_num = $(THREADNUM)
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
sgx.trusted_files.libdl = file:$(LIBCDIR)/libdl.so.2
sgx.trusted_files.libm = file:$(LIBCDIR)/libm.so.6
sgx.trusted_files.libpthread = file:$(LIBCDIR)/libpthread.so.0
sgx.trusted_files.libnss1 = file:/lib/x86_64-linux-gnu/libnss_compat.so.2
sgx.trusted_files.libnss2 = file:/lib/x86_64-linux-gnu/libnss_files.so.2
sgx.trusted_files.libnss3 = file:/lib/x86_64-linux-gnu/libnss_nis.so.2
sgx.trusted_files.libnsl = file:/lib/x86_64-linux-gnu/libnsl.so.1
sgx.trusted_files.libevent = file:/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
sgx.allowed_files.passwd = file:/etc/passwd
sgx.allowed_files.shadow = file:/etc/shadow
-63
View File
@@ -1,63 +0,0 @@
manifests = nginx.manifest
SRCDIR = nginx-1.10.1
HOST = $(firstword $(shell ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' -m 1 | cut -d: -f2))
PORT = 8000
CORES = 4
THREADS = 25
conf_files = http.t
target = build-nginx $(conf_files) test-data
exec_target = $(manifests)
clean-extra = clean-others
extra_rules = -e 's:\$$(HOST):$(HOST):g' -e 's:\$$(PORT):$(PORT):g'
level = ../../
include ../../Makefile
build-nginx: build/sbin/nginx
build/sbin/nginx: $(SRCDIR)
cd $(SRCDIR) && ./configure --prefix=$(PWD)/build
$(MAKE) -C $(SRCDIR)
$(MAKE) -C $(SRCDIR) install
$(SRCDIR): %: %.tar.gz
tar -xmzf $<
$(conf_files): %.t: %.t.template
sed $(extra_rules) $< > $@
start-native-server:
$(PREFIX) build/sbin/nginx -c $(abspath http.t)
start-graphene-server:
$(PREFIX) ./nginx.manifest -c $(abspath http.t) -g "user root;"
random-data = $(foreach n,1 2 3 4 5 6 7 8 9 10,2K.$n.html) \
$(foreach n,1 2 3 4 5,10K.$n.html) \
$(foreach n,1 2 3 4 5,100K.$n.html) \
$(foreach n,1 2 3,1M.$n.html) \
$(foreach n,1 2 3,10M.$n.html) \
$(foreach n,1 2 3,100.$n.html)
test-data = build/html/oscar-web build/html/oscar-web-static build/html/random \
$(addprefix build/html/random/,$(random-data))
build/html/%: ../web-data/%.tar.gz
[ -d "$@" ] || (cd $(dir $@) && tar -xmzf ../../$^)
build/html/random:
mkdir -p $@
build/html/random/%.html: build/html/random
dd if=/dev/urandom of=$@ count=1 bs=$(basename $(basename $(notdir $@)))
test-data: $(test-data)
distclean: clean
rm -rf build $(SRCDIR)
clean-others:
rm -rf $(conf_files) $(test-data)

Some files were not shown because too many files have changed in this diff Show More