mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix TestAuthZPluginAllowEventStream for multiarch
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
This commit is contained in:
parent
61efb4d084
commit
36a974a1a6
1 changed files with 10 additions and 9 deletions
|
@ -13,13 +13,14 @@ import (
|
||||||
|
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"os/exec"
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/docker/docker/pkg/authorization"
|
"github.com/docker/docker/pkg/authorization"
|
||||||
"github.com/docker/docker/pkg/integration/checker"
|
"github.com/docker/docker/pkg/integration/checker"
|
||||||
"github.com/docker/docker/pkg/plugins"
|
"github.com/docker/docker/pkg/plugins"
|
||||||
"github.com/go-check/check"
|
"github.com/go-check/check"
|
||||||
"os/exec"
|
|
||||||
"strconv"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -230,9 +231,11 @@ func (s *DockerAuthzSuite) TestAuthZPluginDenyResponse(c *check.C) {
|
||||||
func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) {
|
func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) {
|
||||||
testRequires(c, DaemonIsLinux)
|
testRequires(c, DaemonIsLinux)
|
||||||
|
|
||||||
// Start the authorization plugin
|
// start the daemon and load busybox to avoid pulling busybox from Docker Hub
|
||||||
err := s.d.Start("--authorization-plugin=" + testAuthZPlugin)
|
c.Assert(s.d.StartWithBusybox(), check.IsNil)
|
||||||
c.Assert(err, 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.reqRes.Allow = true
|
||||||
s.ctrl.resRes.Allow = true
|
s.ctrl.resRes.Allow = true
|
||||||
|
|
||||||
|
@ -256,10 +259,8 @@ func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) {
|
||||||
defer observer.Stop()
|
defer observer.Stop()
|
||||||
|
|
||||||
// Create a container and wait for the creation events
|
// 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")
|
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)
|
containerID := strings.TrimSpace(out)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue