aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorToshiki Sonoda <sonoda.toshiki@fujitsu.com>2022-09-09 16:21:06 +0900
committerToshiki Sonoda <sonoda.toshiki@fujitsu.com>2022-09-09 17:33:43 +0900
commitc7411af9e2f2f38beb48d07a401cb06dc8d9b328 (patch)
treeebe42972ab62148f3f55f29fafd23f18738ace25 /test
parent6d8bafe57a65970ead17a83cb1983629b3a2aedb (diff)
downloadpodman-c7411af9e2f2f38beb48d07a401cb06dc8d9b328.tar.gz
podman-c7411af9e2f2f38beb48d07a401cb06dc8d9b328.tar.bz2
podman-c7411af9e2f2f38beb48d07a401cb06dc8d9b328.zip
Ignore cpu realtime options on cgroups V2 systems
`--cpu-rt-period` and `--cpu-rt-runtime` options are only supported on cgroups V1 rootful systems. Therefore, podman prints an warning message and ignores these options when we use cgroups V2 systems. Related to: #15666 Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_cpu_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/run_cpu_test.go b/test/e2e/run_cpu_test.go
index e57eb3b26..19bb735ff 100644
--- a/test/e2e/run_cpu_test.go
+++ b/test/e2e/run_cpu_test.go
@@ -138,4 +138,20 @@ var _ = Describe("Podman run cpu", func() {
result.WaitWithDefaultTimeout()
Expect(result).To(ExitWithError())
})
+
+ It("podman run invalid cpu-rt-period with cgroupsv2", func() {
+ SkipIfCgroupV1("testing options that only work in cgroup v2")
+ result := podmanTest.Podman([]string{"run", "--rm", "--cpu-rt-period=5000", ALPINE, "ls"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ Expect(result.ErrorToString()).To(ContainSubstring("Realtime period not supported on cgroups V2 systems"))
+ })
+
+ It("podman run invalid cpu-rt-runtime with cgroupsv2", func() {
+ SkipIfCgroupV1("testing options that only work in cgroup v2")
+ result := podmanTest.Podman([]string{"run", "--rm", "--cpu-rt-runtime=5000", ALPINE, "ls"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ Expect(result.ErrorToString()).To(ContainSubstring("Realtime runtime not supported on cgroups V2 systems"))
+ })
})