aboutsummaryrefslogtreecommitdiff
path: root/test/e2e/run_cgroup_parent_test.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-09-11 14:53:22 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-09-12 20:20:50 +0000
commit60e8e4fb2d11f8270fee17a82c7eb7fbf81bd47f (patch)
tree15ff627863c8bbd3e937578f0f72218346154f75 /test/e2e/run_cgroup_parent_test.go
parent13ae41fbc2702b7ac85f3ee420bee0c1d39abe29 (diff)
downloadpodman-60e8e4fb2d11f8270fee17a82c7eb7fbf81bd47f.tar.gz
podman-60e8e4fb2d11f8270fee17a82c7eb7fbf81bd47f.tar.bz2
podman-60e8e4fb2d11f8270fee17a82c7eb7fbf81bd47f.zip
run different cgroup tests depending on conditions
when running podman's integration tests, we need to be able to understand our environment because the podman command will differ as will the results. there is no 100% way to know if we are in a container, but using a combination of container= and checking /proc seemed reasonable for our test suite. non of this code is run in podman proper. Signed-off-by: baude <bbaude@redhat.com> Closes: #1441 Approved by: mheon
Diffstat (limited to 'test/e2e/run_cgroup_parent_test.go')
-rw-r--r--test/e2e/run_cgroup_parent_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/e2e/run_cgroup_parent_test.go b/test/e2e/run_cgroup_parent_test.go
index efd7c8bb8..00b8d952d 100644
--- a/test/e2e/run_cgroup_parent_test.go
+++ b/test/e2e/run_cgroup_parent_test.go
@@ -32,6 +32,9 @@ var _ = Describe("Podman run with --cgroup-parent", func() {
})
Specify("valid --cgroup-parent using cgroupfs", func() {
+ if !containerized() {
+ Skip("Must be containerized to run this test.")
+ }
cgroup := "/zzz"
run := podmanTest.Podman([]string{"run", "--cgroup-parent", cgroup, fedoraMinimal, "cat", "/proc/self/cgroup"})
run.WaitWithDefaultTimeout()
@@ -42,6 +45,9 @@ var _ = Describe("Podman run with --cgroup-parent", func() {
Specify("no --cgroup-parent", func() {
cgroup := "/libpod_parent"
+ if !containerized() {
+ cgroup = "/machine.slice"
+ }
run := podmanTest.Podman([]string{"run", fedoraMinimal, "cat", "/proc/self/cgroup"})
run.WaitWithDefaultTimeout()
Expect(run.ExitCode()).To(Equal(0))
@@ -50,7 +56,9 @@ var _ = Describe("Podman run with --cgroup-parent", func() {
})
Specify("valid --cgroup-parent using slice", func() {
- Skip("Requires Systemd cgroup manager support")
+ if containerized() {
+ Skip("Requires Systemd cgroup manager support")
+ }
cgroup := "aaaa.slice"
run := podmanTest.Podman([]string{"run", "--cgroup-parent", cgroup, fedoraMinimal, "cat", "/proc/1/cgroup"})
run.WaitWithDefaultTimeout()