From 36a974a1a6267828b773de19ed298947c66c4945 Mon Sep 17 00:00:00 2001 From: Stefan Scherer Date: Wed, 10 Feb 2016 07:28:50 +0100 Subject: [PATCH] Fix TestAuthZPluginAllowEventStream for multiarch Signed-off-by: Stefan Scherer --- integration-cli/docker_cli_authz_unix_test.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/integration-cli/docker_cli_authz_unix_test.go b/integration-cli/docker_cli_authz_unix_test.go index 4ab83b9179..e2f3420bc5 100644 --- a/integration-cli/docker_cli_authz_unix_test.go +++ b/integration-cli/docker_cli_authz_unix_test.go @@ -13,13 +13,14 @@ import ( "bufio" "bytes" + "os/exec" + "strconv" + "time" + "github.com/docker/docker/pkg/authorization" "github.com/docker/docker/pkg/integration/checker" "github.com/docker/docker/pkg/plugins" "github.com/go-check/check" - "os/exec" - "strconv" - "time" ) const ( @@ -230,9 +231,11 @@ func (s *DockerAuthzSuite) TestAuthZPluginDenyResponse(c *check.C) { func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) { testRequires(c, DaemonIsLinux) - // Start the authorization plugin - err := s.d.Start("--authorization-plugin=" + testAuthZPlugin) - c.Assert(err, check.IsNil) + // start the daemon and load busybox to avoid pulling busybox from Docker Hub + c.Assert(s.d.StartWithBusybox(), check.IsNil) + // restart the daemon and enable the authorization plugin, otherwise busybox loading + // is blocked by the plugin itself + c.Assert(s.d.Restart("--authorization-plugin="+testAuthZPlugin), check.IsNil) s.ctrl.reqRes.Allow = true s.ctrl.resRes.Allow = true @@ -256,10 +259,8 @@ func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) { defer observer.Stop() // Create a container and wait for the creation events - _, err = s.d.Cmd("pull", "busybox") - c.Assert(err, check.IsNil) out, err := s.d.Cmd("run", "-d", "busybox", "top") - c.Assert(err, check.IsNil) + c.Assert(err, check.IsNil, check.Commentf(out)) containerID := strings.TrimSpace(out)