tests: jail_test fixes.

pull/607/head
David Wilson 6 years ago
parent f66611dc83
commit fb23ecae01

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

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

Loading…
Cancel
Save