Skip to content

Commit

Permalink
Fix TestInspectInt64 for run scenarios that return warnings
Browse files Browse the repository at this point in the history
Instead of returning only the container ID, starting a container may
also return a warning:

"WARNING: Your kernel does not support swap
limit capabilities, memory limited without
swap.\nff6ebd9f7a8d035d17bb9a61eb9d3f0a5d563160cc43471a9d7ac9f71945d061"

The test assumes that only the container ID is returned and uses the
entire message as the name for the inspect command. To avoid the need to
parse the container ID from the output after the run command, give the
container a name and use that instead.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
  • Loading branch information
clnperez committed Oct 19, 2015
1 parent 8005dbd commit ae29bd4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions integration-cli/docker_cli_inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ func (s *DockerSuite) TestInspectImage(c *check.C) {

func (s *DockerSuite) TestInspectInt64(c *check.C) {
testRequires(c, DaemonIsLinux)
out, _, err := dockerCmdWithError("run", "-d", "-m=300M", "busybox", "true")
if err != nil {
c.Fatalf("failed to run container: %v, output: %q", err, out)
}
out = strings.TrimSpace(out)

inspectOut, err := inspectField(out, "HostConfig.Memory")
dockerCmd(c, "run", "-d", "-m=300M", "--name", "inspectTest", "busybox", "true")
inspectOut, err := inspectField("inspectTest", "HostConfig.Memory")
c.Assert(err, check.IsNil)

if inspectOut != "314572800" {
Expand Down

0 comments on commit ae29bd4

Please sign in to comment.