Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docker/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'not found: does not exist or no pull access',
'repository does not exist',
'was found but does not match the specified platform',
'failed to resolve reference',
]
)

Expand Down
26 changes: 0 additions & 26 deletions tests/integration/api_build_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,32 +349,6 @@ def test_build_with_extra_hosts(self):
assert '127.0.0.1\textrahost.local.test' in logs
assert '127.0.0.1\thello.world.test' in logs

@requires_experimental(until=None)
@requires_api_version('1.25')
def test_build_squash(self):
script = io.BytesIO('\n'.join([
'FROM busybox',
'RUN echo blah > /file_1',
'RUN echo blahblah > /file_2',
'RUN echo blahblahblah > /file_3'
]).encode('ascii'))

def build_squashed(squash):
tag = 'squash' if squash else 'nosquash'
stream = self.client.build(
fileobj=script, tag=tag, squash=squash
)
self.tmp_imgs.append(tag)
for _chunk in stream:
pass

return self.client.inspect_image(tag)

non_squashed = build_squashed(False)
squashed = build_squashed(True)
assert len(non_squashed['RootFS']['Layers']) == 4
assert len(squashed['RootFS']['Layers']) == 2

def test_build_stderr_data(self):
control_chars = ['\x1b[91m', '\x1b[0m']
snippet = 'Ancient Temple (Mystic Oriental Dream ~ Ancient Temple)'
Expand Down
47 changes: 0 additions & 47 deletions tests/integration/api_container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,53 +64,6 @@ def test_create_with_host_pid_mode(self):
assert 'PidMode' in host_config
assert host_config['PidMode'] == 'host'

def test_create_with_links(self):
res0 = self.client.create_container(
TEST_IMG, 'cat',
detach=True, stdin_open=True,
environment={'FOO': '1'})

container1_id = res0['Id']
self.tmp_containers.append(container1_id)

self.client.start(container1_id)

res1 = self.client.create_container(
TEST_IMG, 'cat',
detach=True, stdin_open=True,
environment={'FOO': '1'})

container2_id = res1['Id']
self.tmp_containers.append(container2_id)

self.client.start(container2_id)

# we don't want the first /
link_path1 = self.client.inspect_container(container1_id)['Name'][1:]
link_alias1 = 'mylink1'
link_env_prefix1 = link_alias1.upper()

link_path2 = self.client.inspect_container(container2_id)['Name'][1:]
link_alias2 = 'mylink2'
link_env_prefix2 = link_alias2.upper()

res2 = self.client.create_container(
TEST_IMG, 'env', host_config=self.client.create_host_config(
links={link_path1: link_alias1, link_path2: link_alias2},
network_mode='bridge'
)
)
container3_id = res2['Id']
self.tmp_containers.append(container3_id)
self.client.start(container3_id)
assert self.client.wait(container3_id)['StatusCode'] == 0

logs = self.client.logs(container3_id).decode('utf-8')
assert f'{link_env_prefix1}_NAME=' in logs
assert f'{link_env_prefix1}_ENV_FOO=1' in logs
assert f'{link_env_prefix2}_NAME=' in logs
assert f'{link_env_prefix2}_ENV_FOO=1' in logs

def test_create_with_restart_policy(self):
container = self.client.create_container(
TEST_IMG, ['sleep', '2'],
Expand Down
26 changes: 0 additions & 26 deletions tests/ssh/api_build_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,32 +340,6 @@ def test_build_with_extra_hosts(self):
assert '127.0.0.1\textrahost.local.test' in logs
assert '127.0.0.1\thello.world.test' in logs

@requires_experimental(until=None)
@requires_api_version('1.25')
def test_build_squash(self):
script = io.BytesIO('\n'.join([
'FROM busybox',
'RUN echo blah > /file_1',
'RUN echo blahblah > /file_2',
'RUN echo blahblahblah > /file_3'
]).encode('ascii'))

def build_squashed(squash):
tag = 'squash' if squash else 'nosquash'
stream = self.client.build(
fileobj=script, tag=tag, squash=squash
)
self.tmp_imgs.append(tag)
for _chunk in stream:
pass

return self.client.inspect_image(tag)

non_squashed = build_squashed(False)
squashed = build_squashed(True)
assert len(non_squashed['RootFS']['Layers']) == 4
assert len(squashed['RootFS']['Layers']) == 2

def test_build_stderr_data(self):
control_chars = ['\x1b[91m', '\x1b[0m']
snippet = 'Ancient Temple (Mystic Oriental Dream ~ Ancient Temple)'
Expand Down
Loading