From 771256b305c8c06fca5eb1d041b60fbe093c0e1b Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 21 Aug 2017 17:52:43 +0300 Subject: [PATCH] TestRunSeccompProfileAllow32Bit: fix Since the update to Debian Stretch, this test fails. The reason is dynamic binary, which requires i386 ld.so for loading (and apparently it is no longer installed by default): > root@09d4b173c3dc:/go/src/github.com/docker/docker# file exit32-test > exit32-test: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=a0d3d6cb59788453b983f65f8dc6ac52920147b6, stripped > root@09d4b173c3dc:/go/src/github.com/docker/docker# ls -l /lib/ld-linux.so.2 > ls: cannot access '/lib/ld-linux.so.2': No such file or directory To fix, just add -static. Interestingly, ldd can'f figure it out. > root@a324f8edfcaa:/go/src/github.com/docker/docker# ldd exit32-test > not a dynamic executable Other tools (e.g. objdump) also show it's a dynamic binary. While at it, remove the extra "id" argument (a copy-paste error I guess). Signed-off-by: Kir Kolyshkin --- integration-cli/docker_cli_run_unix_test.go | 2 +- integration-cli/fixtures_linux_daemon_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index 2176f0b020..380450ca04 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -1060,7 +1060,7 @@ func (s *DockerSuite) TestRunSeccompProfileAllow32Bit(c *check.C) { testRequires(c, SameHostDaemon, seccompEnabled, IsAmd64) ensureSyscallTest(c) - icmd.RunCommand(dockerBinary, "run", "syscall-test", "exit32-test", "id").Assert(c, icmd.Success) + icmd.RunCommand(dockerBinary, "run", "syscall-test", "exit32-test").Assert(c, icmd.Success) } // TestRunSeccompAllowSetrlimit checks that 'docker run debian:jessie ulimit -v 1048510' succeeds. diff --git a/integration-cli/fixtures_linux_daemon_test.go b/integration-cli/fixtures_linux_daemon_test.go index 1508762060..6ac4511215 100644 --- a/integration-cli/fixtures_linux_daemon_test.go +++ b/integration-cli/fixtures_linux_daemon_test.go @@ -57,7 +57,7 @@ func ensureSyscallTest(c *check.C) { } if runtime.GOOS == "linux" && runtime.GOARCH == "amd64" { - out, err := exec.Command(gcc, "-s", "-m32", "-nostdlib", "../contrib/syscall-test/exit32.s", "-o", tmp+"/"+"exit32-test").CombinedOutput() + out, err := exec.Command(gcc, "-s", "-m32", "-nostdlib", "-static", "../contrib/syscall-test/exit32.s", "-o", tmp+"/"+"exit32-test").CombinedOutput() c.Assert(err, checker.IsNil, check.Commentf(string(out))) }