mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Adds test for additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
e0d96fb3ef
commit
0b7938e845
1 changed files with 13 additions and 0 deletions
|
@ -948,6 +948,19 @@ func (s *DockerSuite) TestRunCapAddALLDropNetAdminCanDownInterface(c *check.C) {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestRunGroupAdd(c *check.C) {
|
||||
cmd := exec.Command(dockerBinary, "run", "--group-add=audio", "--group-add=dbus", "--group-add=777", "busybox", "sh", "-c", "id")
|
||||
out, _, err := runCommandWithOutput(cmd)
|
||||
if err != nil {
|
||||
c.Fatal(err, out)
|
||||
}
|
||||
|
||||
groupsList := "uid=0(root) gid=0(root) groups=10(wheel),29(audio),81(dbus),777"
|
||||
if actual := strings.Trim(out, "\r\n"); actual != groupsList {
|
||||
c.Fatalf("expected output %s received %s", groupsList, actual)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestRunPrivilegedCanMount(c *check.C) {
|
||||
cmd := exec.Command(dockerBinary, "run", "--privileged", "busybox", "sh", "-c", "mount -t tmpfs none /tmp && echo ok")
|
||||
out, _, err := runCommandWithOutput(cmd)
|
||||
|
|
Loading…
Add table
Reference in a new issue