summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2021-08-17 12:35:29 -0400
committerChris Evich <cevich@redhat.com>2021-08-17 16:16:32 -0400
commita92441e1b339d5d8b29989cfb858ddf9c70f15aa (patch)
treed655f66af7de3631716bce0183a9241e353288c8 /test
parent37b22af331d445e7d20a4a0d71dd32d7d042d1c6 (diff)
downloadpodman-a92441e1b339d5d8b29989cfb858ddf9c70f15aa.tar.gz
podman-a92441e1b339d5d8b29989cfb858ddf9c70f15aa.tar.bz2
podman-a92441e1b339d5d8b29989cfb858ddf9c70f15aa.zip
Skip stats test in CGv1 container environments
These tests were originally enabled in a situation where CI provided false-positive results. Now that has been corrected, these tests all fail under a CGv1 container environment with the error: ``` Error: unable to load cgroup at /machine.slice/libpod-e4f...086.scope/libpod_parent/libpod-fbd...425: cgroup deleted ``` This commit simply disables the tests under this specific environment. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/common_test.go6
-rw-r--r--test/e2e/stats_test.go3
-rw-r--r--test/e2e/systemd_test.go11
3 files changed, 14 insertions, 6 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index 2e48e1763..d03a2741b 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -645,9 +645,13 @@ func isRootless() bool {
return os.Geteuid() != 0
}
+func isCgroupsV1() bool {
+ return !CGROUPSV2
+}
+
func SkipIfCgroupV1(reason string) {
checkReason(reason)
- if !CGROUPSV2 {
+ if isCgroupsV1() {
Skip(reason)
}
}
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go
index e32d515a0..47cdeca11 100644
--- a/test/e2e/stats_test.go
+++ b/test/e2e/stats_test.go
@@ -24,6 +24,9 @@ var _ = Describe("Podman stats", func() {
BeforeEach(func() {
SkipIfRootlessCgroupsV1("stats not supported on cgroupv1 for rootless users")
+ if isContainerized() {
+ SkipIfCgroupV1("stats not supported inside cgroupv1 container environment")
+ }
var err error
tempdir, err = CreateTempDirInTempDir()
if err != nil {
diff --git a/test/e2e/systemd_test.go b/test/e2e/systemd_test.go
index bb51d6ac2..3213a839a 100644
--- a/test/e2e/systemd_test.go
+++ b/test/e2e/systemd_test.go
@@ -6,7 +6,6 @@ import (
"strings"
"time"
- "github.com/containers/podman/v3/pkg/rootless"
. "github.com/containers/podman/v3/test/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -118,11 +117,13 @@ WantedBy=multi-user.target
Expect(len(conData)).To(Equal(1))
Expect(conData[0].Config.SystemdMode).To(BeTrue())
- if CGROUPSV2 || !rootless.IsRootless() {
- stats := podmanTest.Podman([]string{"stats", "--no-stream", ctrName})
- stats.WaitWithDefaultTimeout()
- Expect(stats).Should(Exit(0))
+ // stats not supported w/ CGv1 rootless or containerized
+ if isCgroupsV1() && (isRootless() || isContainerized()) {
+ return
}
+ stats := podmanTest.Podman([]string{"stats", "--no-stream", ctrName})
+ stats.WaitWithDefaultTimeout()
+ Expect(stats).Should(Exit(0))
})
It("podman create container with systemd entrypoint triggers systemd mode", func() {