tests: jail_test fixes.

This commit is contained in:
David Wilson 2019-03-10 23:01:52 +00:00
parent f66611dc83
commit fb23ecae01
2 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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__':