diff --git a/Documentation/cloud-deployment.rst b/Documentation/cloud-deployment.rst index 76f575dc..985160ba 100644 --- a/Documentation/cloud-deployment.rst +++ b/Documentation/cloud-deployment.rst @@ -52,7 +52,7 @@ Building #. Build and run :program:`helloworld`:: - cd LibOS/shim/test/native + cd LibOS/shim/test/regression make SGX=1 sgx-tokens SGX=1 ../../../../Runtime/pal_loader helloworld diff --git a/Documentation/devel/debugging.rst b/Documentation/devel/debugging.rst index 5c649b50..34e29a39 100644 --- a/Documentation/devel/debugging.rst +++ b/Documentation/devel/debugging.rst @@ -39,7 +39,7 @@ After rebuilding Graphene with ``DEBUG=1``, you need to re-sign the manifest of the application. For instance, if you want to debug the ``helloworld`` program, run the following commands:: - cd LibOS/shim/test/native + cd LibOS/shim/test/regression make SGX=1 make SGX=1 sgx-tokens diff --git a/Documentation/devel/performance.rst b/Documentation/devel/performance.rst index 335e663b..1e0d42de 100644 --- a/Documentation/devel/performance.rst +++ b/Documentation/devel/performance.rst @@ -29,7 +29,7 @@ thread/process exit. Here is an example: :: - LibOS/shim/test/native$ SGX=1 perf stat graphene/Runtime/pal_loader helloworld + LibOS/shim/test/regression$ SGX=1 perf stat graphene/Runtime/pal_loader helloworld Hello world (helloworld)! ----- SGX stats for thread 87219 ----- # of EENTERs: 224 diff --git a/Documentation/quickstart.rst b/Documentation/quickstart.rst index 393b98c5..36026bc7 100644 --- a/Documentation/quickstart.rst +++ b/Documentation/quickstart.rst @@ -18,7 +18,7 @@ Quick start without SGX support #. Build and run :program:`helloworld`:: - cd LibOS/shim/test/native + cd LibOS/shim/test/regression make ./pal_loader helloworld @@ -81,7 +81,7 @@ second command should list the process status of :command:`aesm_service`. #. Build and run :program:`helloworld`:: - cd $GRAPHENE_DIR/LibOS/shim/test/native + cd $GRAPHENE_DIR/LibOS/shim/test/regression make SGX=1 sgx-tokens SGX=1 ./pal_loader helloworld diff --git a/LibOS/shim/test/native/.gitignore b/LibOS/shim/test/native/.gitignore index 2af81bbd..96efa279 100644 --- a/LibOS/shim/test/native/.gitignore +++ b/LibOS/shim/test/native/.gitignore @@ -22,7 +22,6 @@ /fs /futextest /get_time -/helloworld /helloworld_pthread /kill /malloc diff --git a/LibOS/shim/test/native/Makefile b/LibOS/shim/test/native/Makefile index 5f164484..fe1417bc 100644 --- a/LibOS/shim/test/native/Makefile +++ b/LibOS/shim/test/native/Makefile @@ -18,7 +18,6 @@ c_executables = \ fs \ futextest \ get_time \ - helloworld \ helloworld_pthread \ kill \ malloc \ diff --git a/LibOS/shim/test/native/helloworld.c b/LibOS/shim/test/native/helloworld.c deleted file mode 100644 index 138d90de..00000000 --- a/LibOS/shim/test/native/helloworld.c +++ /dev/null @@ -1,8 +0,0 @@ -/* a simple helloworld test */ - -#include - -int main(int argc, char** argv) { - printf("Hello world (%s)!\n", argv[0]); - return 0; -} diff --git a/LibOS/shim/test/native/system.c b/LibOS/shim/test/native/system.c index ad056fb5..77ec615a 100644 --- a/LibOS/shim/test/native/system.c +++ b/LibOS/shim/test/native/system.c @@ -1,7 +1,7 @@ #include int main(int argc, char** argv) { - if (system("./helloworld")) { + if (system("./helloworld_pthread")) { return 1; } return 0; diff --git a/LibOS/shim/test/regression/.gitignore b/LibOS/shim/test/regression/.gitignore index 37b7c33b..889c6aa6 100644 --- a/LibOS/shim/test/regression/.gitignore +++ b/LibOS/shim/test/regression/.gitignore @@ -62,6 +62,7 @@ /getsockname /getsockopt /groups +/helloworld /host_root_fs /init_fail /init_fail2 diff --git a/LibOS/shim/test/regression/Makefile b/LibOS/shim/test/regression/Makefile index 4ce2b572..3587d24f 100644 --- a/LibOS/shim/test/regression/Makefile +++ b/LibOS/shim/test/regression/Makefile @@ -41,6 +41,7 @@ c_executables = \ getsockname \ getsockopt \ groups \ + helloworld \ host_root_fs \ init_fail \ large_mmap \ diff --git a/LibOS/shim/test/regression/helloworld.c b/LibOS/shim/test/regression/helloworld.c new file mode 100644 index 00000000..105b300c --- /dev/null +++ b/LibOS/shim/test/regression/helloworld.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char** argv) { + printf("Hello world!\n"); + return 0; +} diff --git a/LibOS/shim/test/regression/test_libos.py b/LibOS/shim/test/regression/test_libos.py index d3ef42d7..be543686 100644 --- a/LibOS/shim/test/regression/test_libos.py +++ b/LibOS/shim/test/regression/test_libos.py @@ -20,6 +20,10 @@ class TC_00_Unittests(RegressionTestCase): self.assertIn('Test successful!', stdout) class TC_01_Bootstrap(RegressionTestCase): + def test_001_helloworld(self): + stdout, _ = self.run_binary(['helloworld']) + self.assertIn('Hello world!', stdout) + def test_100_basic_bootstrapping(self): stdout, _ = self.run_binary(['bootstrap'])