From 9180bba54447d6671a6e192435805137ce7e0963 Mon Sep 17 00:00:00 2001 From: Zhang Kun Date: Thu, 23 Jul 2015 00:28:53 +0800 Subject: [PATCH 1/3] #14474 skip DockerSuite.TestRunCapAddCHOWN on lxc Signed-off-by: Zhang Kun Upstream-commit: 0547b5fb2ac98d67eea3ed56f4afae87dff3079c Component: engine --- components/engine/integration-cli/docker_cli_run_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/components/engine/integration-cli/docker_cli_run_test.go b/components/engine/integration-cli/docker_cli_run_test.go index 735d0d37b1..a1d0933d61 100644 --- a/components/engine/integration-cli/docker_cli_run_test.go +++ b/components/engine/integration-cli/docker_cli_run_test.go @@ -2478,6 +2478,7 @@ func (s *DockerSuite) TestDevicePermissions(c *check.C) { } func (s *DockerSuite) TestRunCapAddCHOWN(c *check.C) { + testRequires(c, NativeExecDriver) out, _ := dockerCmd(c, "run", "--cap-drop=ALL", "--cap-add=CHOWN", "busybox", "sh", "-c", "adduser -D -H newuser && chown newuser /home && echo ok") if actual := strings.Trim(out, "\r\n"); actual != "ok" { From 11ea6871f4c85cc8baedd2247b530dd7f6d68a92 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Fri, 24 Jul 2015 15:33:46 -0700 Subject: [PATCH 2/3] fix memory swappiness lxc Signed-off-by: Jessica Frazelle Upstream-commit: a38b544ef082bcea76c4ea13e19d935ac09d3498 Component: engine --- components/engine/daemon/execdriver/lxc/lxc_template.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/engine/daemon/execdriver/lxc/lxc_template.go b/components/engine/daemon/execdriver/lxc/lxc_template.go index 75c453e4c8..a4ac51ea62 100644 --- a/components/engine/daemon/execdriver/lxc/lxc_template.go +++ b/components/engine/daemon/execdriver/lxc/lxc_template.go @@ -115,7 +115,7 @@ lxc.cgroup.blkio.weight = {{.Resources.BlkioWeight}} {{if .Resources.OomKillDisable}} lxc.cgroup.memory.oom_control = {{.Resources.OomKillDisable}} {{end}} -{{if .Resources.MemorySwappiness}} +{{if gt .Resources.MemorySwappiness 0}} lxc.cgroup.memory.swappiness = {{.Resources.MemorySwappiness}} {{end}} {{end}} From 5944bec2a8217c24a2de5d06c9ce84f889374f3b Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Fri, 24 Jul 2015 16:10:59 -0700 Subject: [PATCH 3/3] ignore certain tests on lxc driver Signed-off-by: Jessica Frazelle Upstream-commit: 0a5b8c40c088c90abb8e3410b92758ed603836d9 Component: engine --- components/engine/integration-cli/docker_cli_run_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/engine/integration-cli/docker_cli_run_test.go b/components/engine/integration-cli/docker_cli_run_test.go index a1d0933d61..0fde298ad9 100644 --- a/components/engine/integration-cli/docker_cli_run_test.go +++ b/components/engine/integration-cli/docker_cli_run_test.go @@ -745,6 +745,7 @@ func (s *DockerSuite) TestRunCapAddALLDropNetAdminCanDownInterface(c *check.C) { } func (s *DockerSuite) TestRunGroupAdd(c *check.C) { + testRequires(c, NativeExecDriver) out, _ := dockerCmd(c, "run", "--group-add=audio", "--group-add=dbus", "--group-add=777", "busybox", "sh", "-c", "id") groupsList := "uid=0(root) gid=0(root) groups=10(wheel),29(audio),81(dbus),777" @@ -1033,7 +1034,7 @@ func (s *DockerSuite) TestRunDnsOptionsBasedOnHostResolvConf(c *check.C) { // Test to see if a non-root user can resolve a DNS name and reach out to it. Also // check if the container resolv.conf file has atleast 0644 perm. func (s *DockerSuite) TestRunNonRootUserResolvName(c *check.C) { - testRequires(c, SameHostDaemon) + testRequires(c, SameHostDaemon, NativeExecDriver) testRequires(c, Network) dockerCmd(c, "run", "--name=testperm", "--user=default", "busybox", "ping", "-c", "1", "www.docker.io") @@ -2506,7 +2507,7 @@ func (s *DockerSuite) TestVolumeFromMixedRWOptions(c *check.C) { } func (s *DockerSuite) TestRunWriteFilteredProc(c *check.C) { - testRequires(c, Apparmor) + testRequires(c, Apparmor, NativeExecDriver) testWritePaths := []string{ /* modprobe and core_pattern should both be denied by generic