From 8dad23857c26dd1d5a1c04e1cf299e95e69e8baf Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 10 Aug 2018 13:52:47 -0400 Subject: Temporarily force all tests to use cgroupfs driver TODO: Change this to only force cgroupfs if if we are in a container. Signed-off-by: Matthew Heon --- test/e2e/libpod_suite_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index 3b7953672..9f81c96df 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -29,6 +29,7 @@ var ( CNI_CONFIG_DIR string RUNC_BINARY string INTEGRATION_ROOT string + CGROUP_MANAGER = "cgroupfs" STORAGE_OPTIONS = "--storage-driver vfs" ARTIFACT_DIR = "/tmp/.artifacts" CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, nginx, redis, registry} @@ -60,6 +61,7 @@ type PodmanTest struct { SignaturePolicyPath string ArtifactPath string TempDir string + CgroupManager string } // HostOS is a simple struct for the test os @@ -156,6 +158,7 @@ func PodmanCreate(tempDir string) PodmanTest { SignaturePolicyPath: filepath.Join(INTEGRATION_ROOT, "test/policy.json"), ArtifactPath: ARTIFACT_DIR, TempDir: tempDir, + CgroupManager: CGROUP_MANAGER, } // Setup registries.conf ENV variable @@ -165,8 +168,8 @@ func PodmanCreate(tempDir string) PodmanTest { //MakeOptions assembles all the podman main options func (p *PodmanTest) MakeOptions() []string { - return strings.Split(fmt.Sprintf("--root %s --runroot %s --runtime %s --conmon %s --cni-config-dir %s", - p.CrioRoot, p.RunRoot, p.RunCBinary, p.ConmonBinary, p.CNIConfigDir), " ") + return strings.Split(fmt.Sprintf("--root %s --runroot %s --runtime %s --conmon %s --cni-config-dir %s --cgroup-manager %s", + p.CrioRoot, p.RunRoot, p.RunCBinary, p.ConmonBinary, p.CNIConfigDir, p.CgroupManager), " ") } // Podman is the exec call to podman on the filesystem, uid and gid the credentials to use -- cgit v1.2.3-54-g00ecf From 4b4fba0b4470d808d1cc48662eb6d09d31bc7955 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 10 Aug 2018 13:57:54 -0400 Subject: Only use cgroupfs for containerized tests Signed-off-by: Matthew Heon --- Makefile | 8 ++++---- test/e2e/libpod_suite_test.go | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6804ca11e..2a33d77b1 100644 --- a/Makefile +++ b/Makefile @@ -148,10 +148,10 @@ dbuild: libpodimage docker run --name=${LIBPOD_INSTANCE} --privileged ${LIBPOD_IMAGE} -v ${PWD}:/go/src/${PROJECT} --rm ${ENTRYPOINT} make binaries test: libpodimage - docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make clean all localunit localintegration + docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e CGROUP_MANAGER=cgroupfs -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make clean all localunit localintegration integration: libpodimage - docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make clean all localintegration + docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e CGROUP_MANAGER=cgroupfs -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make clean all localintegration integration.fedora: DIST=Fedora sh .papr_prepare.sh @@ -160,10 +160,10 @@ integration.centos: DIST=CentOS sh .papr_prepare.sh shell: libpodimage - docker run --tmpfs -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -it --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} sh + docker run --tmpfs -e STORAGE_OPTIONS="--storage-driver=vfs" -e CGROUP_MANAGER=cgroupfs -e TESTFLAGS -e TRAVIS -it --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} sh testunit: libpodimage - docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make localunit + docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e CGROUP_MANAGER=cgroupfs -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make localunit localunit: varlink_generate $(GO) test -tags "$(BUILDTAGS)" -cover $(PACKAGES) diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index 9f81c96df..7854f8a47 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -29,7 +29,7 @@ var ( CNI_CONFIG_DIR string RUNC_BINARY string INTEGRATION_ROOT string - CGROUP_MANAGER = "cgroupfs" + CGROUP_MANAGER = "systemd" STORAGE_OPTIONS = "--storage-driver vfs" ARTIFACT_DIR = "/tmp/.artifacts" CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, nginx, redis, registry} @@ -143,6 +143,10 @@ func PodmanCreate(tempDir string) PodmanTest { if os.Getenv("STORAGE_OPTIONS") != "" { storageOptions = os.Getenv("STORAGE_OPTIONS") } + cgroupManager := CGROUP_MANAGER + if os.Getenv("CGROUP_MANAGER") != "" { + storageOptions = os.Getenv("CGROUP_MANAGER") + } runCBinary := "/usr/bin/runc" CNIConfigDir := "/etc/cni/net.d" -- cgit v1.2.3-54-g00ecf From 3d7e401d4e08698e94d3843e24491ef19ecc42c6 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 10 Aug 2018 14:09:46 -0400 Subject: Swap default CGroup manager to systemd Signed-off-by: Matthew Heon --- libpod.conf | 2 +- libpod/runtime.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libpod.conf b/libpod.conf index 3a363e256..cef5a12d8 100644 --- a/libpod.conf +++ b/libpod.conf @@ -30,7 +30,7 @@ conmon_env_vars = [ ] # CGroup Manager - valid values are "systemd" and "cgroupfs" -cgroup_manager = "cgroupfs" +cgroup_manager = "systemd" # Directory for persistent libpod files (database, etc) # By default, this will be configured relative to where containers/storage diff --git a/libpod/runtime.go b/libpod/runtime.go index 1a384fde2..0652b24f4 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -178,7 +178,7 @@ var ( ConmonEnvVars: []string{ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", }, - CgroupManager: CgroupfsCgroupsManager, + CgroupManager: SystemdCgroupsManager, HooksDir: hooks.DefaultDir, StaticDir: filepath.Join(storage.DefaultStoreOptions.GraphRoot, "libpod"), TmpDir: "", -- cgit v1.2.3-54-g00ecf From ab4f190f41d7ca19f73e3994fd3b65f2897f30d3 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 10 Aug 2018 14:32:28 -0400 Subject: Force cgroupfs for python tests Signed-off-by: Matthew Heon --- contrib/python/podman/test/test_runner.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/python/podman/test/test_runner.sh b/contrib/python/podman/test/test_runner.sh index 4afbc260f..c37d9cf6e 100755 --- a/contrib/python/podman/test/test_runner.sh +++ b/contrib/python/podman/test/test_runner.sh @@ -111,6 +111,7 @@ PODMAN_ARGS="--storage-driver=vfs \ --root=${TMPDIR}/crio \ --runroot=${TMPDIR}/crio-run \ --cni-config-dir=$CNI_CONFIG_PATH \ + --cgroup-manager=cgroupfs \ " if [[ -n $VERBOSE ]]; then PODMAN_ARGS="$PODMAN_ARGS --log-level=$LOG_LEVEL" -- cgit v1.2.3-54-g00ecf From f77906932badc11782dd72fb7211be41f014e993 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 10 Aug 2018 15:35:09 -0400 Subject: Fix typo breaking tests Signed-off-by: Matthew Heon --- test/e2e/libpod_suite_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index 7854f8a47..e8f206a51 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -145,7 +145,7 @@ func PodmanCreate(tempDir string) PodmanTest { } cgroupManager := CGROUP_MANAGER if os.Getenv("CGROUP_MANAGER") != "" { - storageOptions = os.Getenv("CGROUP_MANAGER") + cgroupManager = os.Getenv("CGROUP_MANAGER") } runCBinary := "/usr/bin/runc" -- cgit v1.2.3-54-g00ecf From f4d124da9384c71f412141c9e9edcca9f6e2b7e9 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 10 Aug 2018 15:48:35 -0400 Subject: Fix python tests to use cgroupfs Signed-off-by: Matthew Heon --- contrib/python/podman/test/podman_testcase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/python/podman/test/podman_testcase.py b/contrib/python/podman/test/podman_testcase.py index f96a3a013..f5a01c98f 100644 --- a/contrib/python/podman/test/podman_testcase.py +++ b/contrib/python/podman/test/podman_testcase.py @@ -39,6 +39,7 @@ class PodmanTestCase(unittest.TestCase): tmpdir = os.environ.get('TMPDIR', '/tmp') podman_args = [ '--storage-driver=vfs', + '--cgroup-manager=systemd', '--root={}/crio'.format(tmpdir), '--runroot={}/crio-run'.format(tmpdir), '--cni-config-dir={}/cni/net.d'.format(tmpdir), -- cgit v1.2.3-54-g00ecf From 9c42e84173a3cc8c957b430259c0303275b34e58 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 10 Aug 2018 16:18:44 -0400 Subject: Fix python tests again Signed-off-by: Matthew Heon --- contrib/python/podman/test/podman_testcase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/python/podman/test/podman_testcase.py b/contrib/python/podman/test/podman_testcase.py index f5a01c98f..731fa26fc 100644 --- a/contrib/python/podman/test/podman_testcase.py +++ b/contrib/python/podman/test/podman_testcase.py @@ -39,7 +39,7 @@ class PodmanTestCase(unittest.TestCase): tmpdir = os.environ.get('TMPDIR', '/tmp') podman_args = [ '--storage-driver=vfs', - '--cgroup-manager=systemd', + '--cgroup-manager=cgroupfs', '--root={}/crio'.format(tmpdir), '--runroot={}/crio-run'.format(tmpdir), '--cni-config-dir={}/cni/net.d'.format(tmpdir), -- cgit v1.2.3-54-g00ecf From a9b73abf8fcfdcbd9c767987ab5b24089332d004 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Sat, 11 Aug 2018 09:46:48 -0400 Subject: Further fix tests Signed-off-by: Matthew Heon --- test/e2e/libpod_suite_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index e8f206a51..1b0c16e4a 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -162,7 +162,7 @@ func PodmanCreate(tempDir string) PodmanTest { SignaturePolicyPath: filepath.Join(INTEGRATION_ROOT, "test/policy.json"), ArtifactPath: ARTIFACT_DIR, TempDir: tempDir, - CgroupManager: CGROUP_MANAGER, + CgroupManager: cgroupManager, } // Setup registries.conf ENV variable -- cgit v1.2.3-54-g00ecf