diff options
author | 2019-06-27 17:53:09 -0700 | |
---|---|---|
committer | 2019-06-27 17:53:09 -0700 | |
commit | 905cdf11b3b76ebee672e54b4062e3904ed47072 (patch) | |
tree | 3b80431404b1d674ca9b1bb387986696845b56c7 | |
parent | Disable swap memory (diff) |
Test that the file system is mounted as read only
-rw-r--r-- | tests/test_nsjail.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index f1a60e6..bb176d9 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -55,6 +55,16 @@ class NsJailTests(unittest.TestCase): self.assertIn("Resource temporarily unavailable", result.stdout) self.assertEqual(result.stderr, None) + def test_read_only_file_system(self): + code = dedent(""" + open('hello', 'w').write('world') + """).strip() + + result = self.nsjail.python3(code) + self.assertEqual(result.returncode, 1) + self.assertIn("Read-only file system", result.stdout) + self.assertEqual(result.stderr, None) + def test_forkbomb_resource_unavailable(self): code = dedent(""" import os |