From 8ffd71441d2d4d294d112c0f162f4d475cd4763d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kowalczyk?= Date: Mon, 12 Oct 2020 03:33:36 +0200 Subject: [PATCH] [LibOS] regression: Remove test_204_system This test depended on the host system binaries, which isn't a good idea for reliable tests. Also, we already have Bash test in `Examples/` which runs in CI, so there's not too much value in having this one here. --- LibOS/shim/test/regression/.gitignore | 1 - LibOS/shim/test/regression/Makefile | 7 +--- .../test/regression/echo.manifest.template | 31 ----------------- LibOS/shim/test/regression/manifest.template | 3 -- .../shim/test/regression/sh.manifest.template | 34 ------------------- LibOS/shim/test/regression/system.c | 12 ------- LibOS/shim/test/regression/test_libos.py | 6 +--- 7 files changed, 2 insertions(+), 92 deletions(-) delete mode 100644 LibOS/shim/test/regression/echo.manifest.template delete mode 100644 LibOS/shim/test/regression/sh.manifest.template delete mode 100644 LibOS/shim/test/regression/system.c diff --git a/LibOS/shim/test/regression/.gitignore b/LibOS/shim/test/regression/.gitignore index 9a22d617..f362288e 100644 --- a/LibOS/shim/test/regression/.gitignore +++ b/LibOS/shim/test/regression/.gitignore @@ -80,7 +80,6 @@ /stat_invalid_args /str_close_leak /syscall -/system /tcp_ipv6_v6only /tcp_msg_peek /testfile diff --git a/LibOS/shim/test/regression/Makefile b/LibOS/shim/test/regression/Makefile index 173d4b32..262e98b3 100644 --- a/LibOS/shim/test/regression/Makefile +++ b/LibOS/shim/test/regression/Makefile @@ -75,7 +75,6 @@ c_executables = \ stat_invalid_args \ str_close_leak \ syscall \ - system \ tcp_ipv6_v6only \ tcp_msg_peek \ udp \ @@ -89,7 +88,6 @@ manifests = \ manifest \ argv_from_file.manifest \ attestation.manifest \ - echo.manifest \ env_from_file.manifest \ env_from_host.manifest \ eventfd.manifest \ @@ -110,21 +108,18 @@ manifests = \ multi_pthread_exitless.manifest \ openmp.manifest \ proc_path.manifest \ - sh.manifest \ shared_object.manifest exec_target = \ $(c_executables) \ $(cxx_executables) \ argv_from_file.manifest \ - echo.manifest \ env_from_file.manifest \ env_from_host.manifest \ file_check_policy_allow_all_but_log.manifest \ file_check_policy_strict.manifest \ init_fail2.manifest \ - multi_pthread_exitless.manifest \ - sh.manifest + multi_pthread_exitless.manifest target = \ $(exec_target) \ diff --git a/LibOS/shim/test/regression/echo.manifest.template b/LibOS/shim/test/regression/echo.manifest.template deleted file mode 100644 index e36fe7ef..00000000 --- a/LibOS/shim/test/regression/echo.manifest.template +++ /dev/null @@ -1,31 +0,0 @@ -# This file is used by test_204_system test - -loader.exec = file:/bin/echo -loader.argv0_override = echo -loader.insecure__use_cmdline_argv = 1 - -loader.preload = file:../../src/libsysdb.so -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/$(ARCH_LIBDIR) -loader.debug_type = none -loader.syscall_symbol = syscalldb - -fs.mount.graphene_lib.type = chroot -fs.mount.graphene_lib.path = /lib -fs.mount.graphene_lib.uri = file:../../../../Runtime - -fs.mount.host_lib.type = chroot -fs.mount.host_lib.path = $(ARCH_LIBDIR) -fs.mount.host_lib.uri = file:$(ARCH_LIBDIR) - -fs.mount.host_usr_lib.type = chroot -fs.mount.host_usr_lib.path = /usr/$(ARCH_LIBDIR) -fs.mount.host_usr_lib.uri = file:/usr/$(ARCH_LIBDIR) - -fs.mount.bin.type = chroot -fs.mount.bin.path = /bin -fs.mount.bin.uri = file:/bin - -sgx.trusted_files.ld = file:../../../../Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:../../../../Runtime/libc.so.6 - -sgx.static_address = 1 diff --git a/LibOS/shim/test/regression/manifest.template b/LibOS/shim/test/regression/manifest.template index cd8a430e..676df003 100644 --- a/LibOS/shim/test/regression/manifest.template +++ b/LibOS/shim/test/regression/manifest.template @@ -36,6 +36,3 @@ sgx.allowed_files.tmp_dir = file:tmp/ sgx.thread_num = 6 sgx.static_address = 1 - -sgx.trusted_files.sh = file:/bin/sh -sgx.trusted_children.sh = file:sh.sig diff --git a/LibOS/shim/test/regression/sh.manifest.template b/LibOS/shim/test/regression/sh.manifest.template deleted file mode 100644 index 47d9d712..00000000 --- a/LibOS/shim/test/regression/sh.manifest.template +++ /dev/null @@ -1,34 +0,0 @@ -# This file is used by test_204_system test - -loader.exec = file:/bin/sh -loader.argv0_override = sh -loader.insecure__use_cmdline_argv = 1 - -loader.preload = file:../../src/libsysdb.so -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/$(ARCH_LIBDIR) -loader.debug_type = none -loader.syscall_symbol = syscalldb - -fs.mount.graphene_lib.type = chroot -fs.mount.graphene_lib.path = /lib -fs.mount.graphene_lib.uri = file:../../../../Runtime - -fs.mount.host_lib.type = chroot -fs.mount.host_lib.path = $(ARCH_LIBDIR) -fs.mount.host_lib.uri = file:$(ARCH_LIBDIR) - -fs.mount.host_usr_lib.type = chroot -fs.mount.host_usr_lib.path = /usr/$(ARCH_LIBDIR) -fs.mount.host_usr_lib.uri = file:/usr/$(ARCH_LIBDIR) - -fs.mount.bin.type = chroot -fs.mount.bin.path = /bin -fs.mount.bin.uri = file:/bin - -sgx.trusted_files.ld = file:../../../../Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:../../../../Runtime/libc.so.6 - -sgx.trusted_files.echo = file:/bin/echo -sgx.trusted_children.echo = file:echo.sig - -sgx.static_address = 1 diff --git a/LibOS/shim/test/regression/system.c b/LibOS/shim/test/regression/system.c deleted file mode 100644 index 6ecc7ce3..00000000 --- a/LibOS/shim/test/regression/system.c +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - -int main(int argc, char const* argv[]) { - int ret = system("echo hello from system"); - if (ret) { - /* something went wrong with system() execution */ - return 1; - } - - return 0; -} diff --git a/LibOS/shim/test/regression/test_libos.py b/LibOS/shim/test/regression/test_libos.py index f500720e..3009b426 100644 --- a/LibOS/shim/test/regression/test_libos.py +++ b/LibOS/shim/test/regression/test_libos.py @@ -153,11 +153,7 @@ class TC_01_Bootstrap(RegressionTestCase): self.assertIn('child exited with status: 0', stdout) self.assertIn('test completed successfully', stdout) - def test_204_system(self): - stdout, _ = self.run_binary(['system'], timeout=60) - self.assertIn('hello from system', stdout) - - def test_205_exec_fork(self): + def test_204_exec_fork(self): stdout, _ = self.run_binary(['exec_fork'], timeout=60) self.assertNotIn('Handled SIGCHLD', stdout) self.assertIn('Set up handler for SIGCHLD', stdout)