diff options
author | 2022-11-21 11:38:24 -0500 | |
---|---|---|
committer | 2022-11-21 11:38:24 -0500 | |
commit | 2b20b854b027c1ba27aa85b1dcef96c4bfa7b6b9 (patch) | |
tree | a910578443a209006c2c471fe2762539e99c4aba /tests | |
parent | Set rlimit_fsize to unlimited (diff) |
Clarify resource unit test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_nsjail.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index c79c097..493e1f1 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -91,9 +91,9 @@ class NsJailTests(unittest.TestCase): result = self.eval_file(code) self.assertEqual(result.returncode, 1) self.assertIn("Resource temporarily unavailable", result.stdout) - # Also expect n-1 processes to be opened - res = result.stdout.split("T")[0].strip().split("\n") # ['2', '3', '4'] for n=4 - self.assertEqual(res, [*map(str, range(2, max_pids + 1))]) + # Expect n-1 processes to be opened by the presence of string like "2\n3\n4\n" + expected = "\n".join(map(str, range(2, max_pids + 1))) + self.assertIn(expected, result.stdout) self.assertEqual(result.stderr, None) def test_multiprocess_resource_limits(self): |