diff options
author | 2022-11-19 11:35:32 -0500 | |
---|---|---|
committer | 2022-11-19 11:35:32 -0500 | |
commit | 932728308f6773bb525028281ccf1a598d20786b (patch) | |
tree | 09b0720393951e887d6a953713027341e27bd49b /tests/test_nsjail.py | |
parent | Remove unneeded chmods (diff) |
Remove /dev/shm mounts
Diffstat (limited to 'tests/test_nsjail.py')
-rw-r--r-- | tests/test_nsjail.py | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index c520330..cea96bd 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -261,21 +261,8 @@ class NsJailTests(unittest.TestCase): log.output, ) - def test_dev_shm_mounted(self): - code = dedent( - """ - with open('/dev/shm/test.bin', 'wb') as file: - file.write(bytes([255])) - """ - ).strip() - - result = self.nsjail.python3(code) - self.assertEqual("", result.stdout) - self.assertEqual(result.returncode, 0) - self.assertEqual(result.stderr, None) - def test_shm_and_tmp_not_mounted(self): - for path in ("/run/shm", "/tmp"): + for path in ("/dev/shm", "/run/shm", "/tmp"): with self.subTest(path=path): code = dedent( f""" @@ -289,7 +276,7 @@ class NsJailTests(unittest.TestCase): self.assertIn("No such file or directory", result.stdout) self.assertEqual(result.stderr, None) - def test_multiprocessing_shared_memory(self): + def test_multiprocessing_shared_memory_disabled(self): code = dedent( """ from multiprocessing.shared_memory import SharedMemory @@ -301,8 +288,8 @@ class NsJailTests(unittest.TestCase): ).strip() result = self.nsjail.python3(code) - self.assertEqual(result.returncode, 0) - self.assertEqual("", result.stdout) + self.assertEqual(result.returncode, 1) + self.assertIn("Function not implemented", result.stdout) self.assertEqual(result.stderr, None) def test_numpy_import(self): |