This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LibOS/regression] Add test for host root FS
Graphene supports a special "root FS" parameter in the manifest: "fs.root". This commit adds a test that uses this parameter.
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <dirent.h> | ||
#include <stdio.h> | ||
|
||
static int showdir(char* path) { | ||
struct dirent* de; | ||
|
||
DIR* dir = opendir(path); | ||
if (!dir) { | ||
printf("Could not open directory `%s`\n", path); | ||
return 1; | ||
} | ||
|
||
printf("Contents of directory `%s`:\n", path); | ||
while ((de = readdir(dir))) | ||
printf(" %s\n", de->d_name); | ||
printf("\n"); | ||
|
||
closedir(dir); | ||
return 0; | ||
} | ||
|
||
int main(int argc, char** argv) { | ||
if (showdir("/")) | ||
return 1; | ||
|
||
if (showdir("/var/")) | ||
return 1; | ||
|
||
puts("Test was successful"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
loader.preload = file:../../src/libsysdb.so | ||
loader.env.LD_LIBRARY_PATH = /lib | ||
loader.debug_type = none | ||
loader.syscall_symbol = syscalldb | ||
|
||
fs.root.type = chroot | ||
fs.root.path = / | ||
fs.root.uri = file:/ | ||
|
||
fs.mount.graphene_lib.type = chroot | ||
fs.mount.graphene_lib.path = /lib | ||
fs.mount.graphene_lib.uri = file:../../../../Runtime | ||
|
||
sgx.trusted_files.ld = file:../../../../Runtime/ld-linux-x86-64.so.2 | ||
sgx.trusted_files.libc = file:../../../../Runtime/libc.so.6 | ||
sgx.trusted_files.libdl = file:../../../../Runtime/libdl.so.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters