-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TestInspectInt64 for kernels without swap limit capability #16986
Conversation
Instead this should have a |
4c60dfc
to
1437c92
Compare
ping @cpuguy83 I see this PR was updated PTAL |
) | ||
|
||
func (s *DockerSuite) TestInspectInt64(c *check.C) { | ||
testRequires(c, DaemonIsLinux) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can chain the testRequires
:
testRequires(c, DaemonIsLinux, swapMemorySupport)
1437c92
to
1ea1a48
Compare
oops! thanks @vdemeester. |
ad348c2
to
8eca38f
Compare
Checks passed. @vdemeester and @cpuguy83, PTAL. |
func (s *DockerSuite) TestInspectInt64(c *check.C) { | ||
testRequires(c, DaemonIsLinux, swapMemorySupport) | ||
|
||
out, _, err := dockerCmdWithError("run", "-d", "-m=300M", "busybox", "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use dockerCmd
here instead too.
out, _ := dockerCmd("run", "-d", "-m=300M", "busybox", "true")
@vdemeester, sure. I just copy-pasted this over, but more than happy to improve. I'll wait a bit before resubmitting to see if anyone has other suggestions. |
Actually, don't I want to keep the error so it can be checked? |
@clnperez |
Ooo. Reading the comments there, I do see that dockerCmdWithError is for commands that are supposed to fail. So, good change to make for sure. |
07c920d
to
c55c2a7
Compare
@duglin, agreed that we should still run this test, since it does just test a field. I'll update this. Thanks! |
ba43284
to
8031a8a
Compare
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>
8031a8a
to
ae29bd4
Compare
@duglin, @vdemeester, @cpuguy83 -- new patch for the same issue. PTAL. Thanks! |
test works for me! And its much cleaner :-) |
lol, nice LGTM :) |
Fix TestInspectInt64 for kernels without swap limit capability
Thanks all! And np, @cpuguy83. I should have paid more attention! |
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"
Update the test requirement and move to a _unix_test.go file.
Signed-off-by: Christy Perez christy@linux.vnet.ibm.com