Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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)

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

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

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

Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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()