mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #14380 from sunyuan3/TestRunCapAddCHOWN
add TestRunCapAddCHOWN test case
This commit is contained in:
commit
e3966c1031
1 changed files with 12 additions and 0 deletions
|
@ -3220,3 +3220,15 @@ func (s *DockerSuite) TestRunContainerNetModeWithExposePort(c *check.C) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestRunCapAddCHOWN(c *check.C) {
|
||||
cmd := exec.Command(dockerBinary, "run", "--cap-drop=ALL", "--cap-add=CHOWN", "busybox", "sh", "-c", "adduser -D -H newuser && chown newuser /home && echo ok")
|
||||
out, _, err := runCommandWithOutput(cmd)
|
||||
if err != nil {
|
||||
c.Fatal(err, out)
|
||||
}
|
||||
|
||||
if actual := strings.Trim(out, "\r\n"); actual != "ok" {
|
||||
c.Fatalf("expected output ok received %s", actual)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue