integration-cli: fix tests with memory limit
If you don't have cgroup swap memory support, `dockerCmd`'s output in these tests will be polluted by a warning from the daemon and will fail the tests. No need to have memory swap support for these tests to run as it will be reset to -1 and everything will continue correctly. Signed-off-by: Antonio Murdaca <runcom@linux.com>
This commit is contained in:
parent
e61abac5fa
commit
0b8b8ed9e9
|
@ -227,7 +227,7 @@ func (s *DockerSuite) TestRunEchoStdoutWitCPUShares(c *check.C) {
|
||||||
func (s *DockerSuite) TestRunEchoStdoutWithCPUSharesAndMemoryLimit(c *check.C) {
|
func (s *DockerSuite) TestRunEchoStdoutWithCPUSharesAndMemoryLimit(c *check.C) {
|
||||||
testRequires(c, cpuShare)
|
testRequires(c, cpuShare)
|
||||||
testRequires(c, memoryLimitSupport)
|
testRequires(c, memoryLimitSupport)
|
||||||
out, _ := dockerCmd(c, "run", "--cpu-shares", "1000", "-m", "16m", "busybox", "echo", "test")
|
out, _, _ := dockerCmdWithStdoutStderr(c, "run", "--cpu-shares", "1000", "-m", "16m", "busybox", "echo", "test")
|
||||||
if out != "test\n" {
|
if out != "test\n" {
|
||||||
c.Errorf("container should've printed 'test', got %q instead", out)
|
c.Errorf("container should've printed 'test', got %q instead", out)
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ func (s *DockerSuite) TestRunOOMExitCode(c *check.C) {
|
||||||
// "test" should be printed
|
// "test" should be printed
|
||||||
func (s *DockerSuite) TestRunEchoStdoutWithMemoryLimit(c *check.C) {
|
func (s *DockerSuite) TestRunEchoStdoutWithMemoryLimit(c *check.C) {
|
||||||
testRequires(c, memoryLimitSupport)
|
testRequires(c, memoryLimitSupport)
|
||||||
out, _ := dockerCmd(c, "run", "-m", "16m", "busybox", "echo", "test")
|
out, _, _ := dockerCmdWithStdoutStderr(c, "run", "-m", "16m", "busybox", "echo", "test")
|
||||||
out = strings.Trim(out, "\r\n")
|
out = strings.Trim(out, "\r\n")
|
||||||
|
|
||||||
if expected := "test"; out != expected {
|
if expected := "test"; out != expected {
|
||||||
|
|
Loading…
Reference in New Issue