From fb23ecae0121ed588ed681f2cd97ebf2c110e7ad Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 10 Mar 2019 23:01:52 +0000 Subject: [PATCH] tests: jail_test fixes. --- tests/data/stubs/stub-jexec.py | 4 +--- tests/jail_test.py | 10 ++++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/data/stubs/stub-jexec.py b/tests/data/stubs/stub-jexec.py index 22028cf7..3f3e3bdc 100755 --- a/tests/data/stubs/stub-jexec.py +++ b/tests/data/stubs/stub-jexec.py @@ -11,7 +11,5 @@ os.environ['THIS_IS_STUB_JEXEC'] = '1' # This must be a child process and not exec() since Mitogen replaces its stderr # descriptor, causing the last user of the slave PTY to close it, resulting in # the master side indicating EIO. -print sys.argv -woeifj -subprocess.check_call(sys.argv[sys.argv.index('somejail') + 1:]) +subprocess.call(sys.argv[sys.argv.index('somejail') + 1:]) os._exit(0) diff --git a/tests/jail_test.py b/tests/jail_test.py index 0a0a21f8..7239d32f 100644 --- a/tests/jail_test.py +++ b/tests/jail_test.py @@ -17,14 +17,16 @@ class ConstructorTest(testlib.RouterMixin, testlib.TestCase): jexec_path=self.jexec_path, container='somejail', ) + stream = self.router.stream_by_id(context.context_id) + argv = eval(context.call(os.getenv, 'ORIGINAL_ARGV')) self.assertEquals(argv[:4], [ self.jexec_path, - '-u', - 'someuser', - '--', + 'somejail', + stream.conn.options.python_path, + '-c', ]) - self.assertEquals('1', context.call(os.getenv, 'THIS_IS_STUB_jail')) + self.assertEquals('1', context.call(os.getenv, 'THIS_IS_STUB_JEXEC')) if __name__ == '__main__':