mirror of https://github.com/docker/docker-py.git
tests/exec: expect 127 exit code for missing executable
Docker Engine has always returned `126` when starting an exec fails due to a missing binary, but this was due to a bug in the daemon causing the correct exit code to be overwritten in some cases – see: https://github.com/moby/moby/issues/45795 Change tests to expect correct exit code (`127`). Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
parent
a3652028b1
commit
96ef4d3bee
|
@ -359,8 +359,11 @@ class ContainerTest(BaseIntegrationTest):
|
|||
"alpine", "sh -c 'sleep 60'", detach=True
|
||||
)
|
||||
self.tmp_containers.append(container.id)
|
||||
exec_output = container.exec_run("docker ps")
|
||||
assert exec_output[0] == 126
|
||||
exec_output = container.exec_run("non-existent")
|
||||
# older versions of docker return `126` in the case that an exec cannot
|
||||
# be started due to a missing executable. We're fixing this for the
|
||||
# future, so accept both for now.
|
||||
assert exec_output[0] == 127 or exec_output == 126
|
||||
|
||||
def test_kill(self):
|
||||
client = docker.from_env(version=TEST_API_VERSION)
|
||||
|
|
Loading…
Reference in New Issue