Created
January 3, 2017 09:42
-
-
Save vdemeester/dc71212bf82f707c80fb6aa855f07c0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s *DockerSuite) TestRunCapDropCannotMknod(c *check.C) { | |
// Not applicable for Windows as there is no concept of --cap-drop or mknod | |
testRequires(c, DaemonIsLinux) | |
out, _, err := dockerCmdWithError("run", "--cap-drop=MKNOD", "busybox", "sh", "-c", "mknod /tmp/sda b 8 0 && echo ok") | |
if err == nil { | |
c.Fatal(err, out) | |
} | |
if actual := strings.Trim(out, "\r\n"); actual == "ok" { | |
c.Fatalf("expected output not ok received %s", actual) | |
} | |
} | |
func (s *DockerSuite) TestRunCapDropCannotMknodLowerCase(c *check.C) { | |
// Not applicable for Windows as there is no concept of --cap-drop or mknod | |
testRequires(c, DaemonIsLinux) | |
out, _, err := dockerCmdWithError("run", "--cap-drop=mknod", "busybox", "sh", "-c", "mknod /tmp/sda b 8 0 && echo ok") | |
if err == nil { | |
c.Fatal(err, out) | |
} | |
if actual := strings.Trim(out, "\r\n"); actual == "ok" { | |
c.Fatalf("expected output not ok received %s", actual) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment