Selaa lähdekoodia

[LibOS] regression: Run bootstrap_static and bootstrap_pie

Add bootstrap_static for SGX and bootstrap_pie tests to test_libos.py as
they now work correctly (after adding VDSO support).
Isaku Yamahata 4 vuotta sitten
vanhempi
commit
0cb0db9e35
1 muutettua tiedostoa jossa 16 lisäystä ja 0 poistoa
  1. 16 0
      LibOS/shim/test/regression/test_libos.py

+ 16 - 0
LibOS/shim/test/regression/test_libos.py

@@ -34,6 +34,22 @@ class TC_00_Bootstrap(RegressionTestCase):
         self.assertIn('argv[3] = c', stdout)
         self.assertIn('argv[4] = d', stdout)
 
+    @unittest.skipUnless(HAS_SGX,
+        'This test is only meaningful on SGX PAL because only SGX catches raw '
+        'syscalls and redirects to Graphene\'s LibOS. If we will add seccomp to '
+        'Linux PAL, then we should allow this test on Linux PAL as well.')
+    def test_102_basic_bootstrapping_static(self):
+        # bootstrap_static
+        stdout, stderr = self.run_binary(['bootstrap_static'])
+        self.assertIn('Hello world (file:bootstrap_static)!', stdout)
+
+    def test_103_basic_bootstrapping_pie(self):
+        # bootstrap_pie
+        stdout, stderr = self.run_binary(['bootstrap_pie'])
+        self.assertIn('User program started', stdout)
+        self.assertIn('Local Address in Executable: 0x', stdout)
+        self.assertIn('argv[0] = file:bootstrap_pie', stdout)
+
     def test_110_basic_bootstrapping_cxx(self):
         stdout, stderr = self.run_binary(['bootstrap-c++'])