Merge pull request #10717 from mrunalp/feature/group_add

Adds support for specifying additional groups.
Upstream-commit: 35b02239216d7c976d4b07022429fec25ff9669d
Component: engine
This commit is contained in:
Jessie Frazelle
2015-07-13 17:08:05 -07:00
14 changed files with 48 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)