From 43e9523f28b7d4ab4c2fa0ab8f5c7bdd431e53d8 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 17 Jul 2021 15:14:59 +0100 Subject: test: update pid limit tests to account for new increased limit --- tests/test_nsjail.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/test_nsjail.py') diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index 8955b4a..ec5c56f 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -50,7 +50,16 @@ class NsJailTests(unittest.TestCase): def test_subprocess_resource_unavailable(self): code = dedent(""" import subprocess - print(subprocess.check_output('kill -9 6', shell=True).decode()) + + # Max PIDs is 5. + for _ in range(6): + print(subprocess.Popen( + [ + '/usr/local/bin/python3', + '-c', + 'import time; time.sleep(1)' + ], + ).pid) """).strip() result = self.nsjail.python3(code) -- cgit v1.2.3