diff --git a/tests/integration_test.py b/tests/integration_test.py index 869d61e852..64f3af7e8f 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -32,6 +32,7 @@ # export; history; import_image; insert; port; push; tag; get; load; stats; DEFAULT_BASE_URL = os.environ.get('DOCKER_HOST') +EXEC_DRIVER_IS_NATIVE = True warnings.simplefilter('error') create_host_config = docker.utils.create_host_config @@ -312,6 +313,7 @@ def runTest(self): self.assertFalse(inspect_data['VolumesRW'][mount_dest]) +@unittest.skipIf(not EXEC_DRIVER_IS_NATIVE, 'Exec driver not native') class TestCreateContainerReadOnlyFs(BaseTestCase): def runTest(self): ctnr = self.client.create_container( @@ -325,6 +327,7 @@ def runTest(self): self.assertNotEqual(res, 0) +@unittest.skipIf(not EXEC_DRIVER_IS_NATIVE, 'Exec driver not native') class TestStartContainerReadOnlyFs(BaseTestCase): def runTest(self): # Presumably a bug in 1.5.0 @@ -581,7 +584,8 @@ def runTest(self): self.assertIn('State', container_info) state = container_info['State'] self.assertIn('ExitCode', state) - self.assertNotEqual(state['ExitCode'], 0) + if EXEC_DRIVER_IS_NATIVE: + self.assertNotEqual(state['ExitCode'], 0) self.assertIn('Running', state) self.assertEqual(state['Running'], False) @@ -598,7 +602,8 @@ def runTest(self): self.assertIn('State', container_info) state = container_info['State'] self.assertIn('ExitCode', state) - self.assertNotEqual(state['ExitCode'], 0) + if EXEC_DRIVER_IS_NATIVE: + self.assertNotEqual(state['ExitCode'], 0) self.assertIn('Running', state) self.assertEqual(state['Running'], False) @@ -614,7 +619,8 @@ def runTest(self): self.assertIn('State', container_info) state = container_info['State'] self.assertIn('ExitCode', state) - self.assertNotEqual(state['ExitCode'], 0) + if EXEC_DRIVER_IS_NATIVE: + self.assertNotEqual(state['ExitCode'], 0) self.assertIn('Running', state) self.assertEqual(state['Running'], False) @@ -630,7 +636,8 @@ def runTest(self): self.assertIn('State', container_info) state = container_info['State'] self.assertIn('ExitCode', state) - self.assertNotEqual(state['ExitCode'], 0) + if EXEC_DRIVER_IS_NATIVE: + self.assertNotEqual(state['ExitCode'], 0) self.assertIn('Running', state) self.assertEqual(state['Running'], False) @@ -978,6 +985,7 @@ def runTest(self): self.client.remove_container(id, force=True) +@unittest.skipIf(not EXEC_DRIVER_IS_NATIVE, 'Exec driver not native') class TestExecuteCommand(BaseTestCase): def runTest(self): container = self.client.create_container('busybox', 'cat', @@ -991,6 +999,7 @@ def runTest(self): self.assertEqual(res, expected) +@unittest.skipIf(not EXEC_DRIVER_IS_NATIVE, 'Exec driver not native') class TestExecuteCommandString(BaseTestCase): def runTest(self): container = self.client.create_container('busybox', 'cat', @@ -1004,6 +1013,7 @@ def runTest(self): self.assertEqual(res, expected) +@unittest.skipIf(not EXEC_DRIVER_IS_NATIVE, 'Exec driver not native') class TestExecuteCommandStreaming(BaseTestCase): def runTest(self): container = self.client.create_container('busybox', 'cat', @@ -1458,5 +1468,7 @@ def test_443(self): if __name__ == '__main__': c = docker.Client(base_url=DEFAULT_BASE_URL) c.pull('busybox') + exec_driver = c.info()['ExecutionDriver'] + EXEC_DRIVER_IS_NATIVE = exec_driver.startswith('native') c.close() unittest.main()