Skip to content

Commit e9c8036

Browse files
authored
test(resource): add OpenShift cgroup v2 QoS test cases (#2359)
Add test coverage for Guaranteed and BestEffort QoS classes using cgroup v2 systemd slice paths from OpenShift with CRI-O runtime: - Guaranteed QoS: kubepods-pod<uid>.slice (no QoS subdirectory) - BestEffort QoS: kubepods-besteffort.slice with CRI-O These test cases cover container detection patterns not previously tested for CRI-O in OpenShift environments. Signed-off-by: Vimal Kumar <[email protected]>
1 parent bc6d313 commit e9c8036

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/resource/container_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ func TestContainerIDFromPathWithCgroup(t *testing.T) {
138138
path: "0::/kubepods/burstable/pod5a89bcaa-3509-4375-83e1-b9e7a5712123/a069581483b00a498b3ba172612ffed06b3275a043bf3895c1b19e783e2793ee",
139139

140140
expected: expect{id: "a069581483b00a498b3ba172612ffed06b3275a043bf3895c1b19e783e2793ee", runtime: KubePodsRuntime},
141+
}, {
142+
name: "guaranteed qos pod cgroup v2 systemd slice openshift",
143+
path: "0::/kubepods.slice/kubepods-pod7922aa99_d4aa_4885_a953_82976860b23a.slice/crio-1c33afbc9e5aa6c69150d1af05254b562a4b17c313fc6153e3625cf456922bfe.scope",
144+
145+
expected: expect{id: "1c33afbc9e5aa6c69150d1af05254b562a4b17c313fc6153e3625cf456922bfe", runtime: CrioRuntime},
146+
}, {
147+
name: "besteffort qos pod cgroup v2 systemd slice openshift",
148+
path: "0::/kubepods.slice/kubepods-besteffort.slice/kubepods-besteffort-poddbdd9718_6f63_40ef_987e_34776599d7d6.slice/crio-bdf2eeede4551b27acbbb05fb1b4f61925786681734bf128e68d39e17d115098.scope",
149+
150+
expected: expect{id: "bdf2eeede4551b27acbbb05fb1b4f61925786681734bf128e68d39e17d115098", runtime: CrioRuntime},
141151
}, {
142152
name: "podman rootless container",
143153
path: "0::/user.slice/user-1000.slice/[email protected]/user.slice/libpod-3f05ee050f82c0145f1d88c94269c39dff0f07dbf8bba20aafd54b3a75dcaecc.scope/container",

0 commit comments

Comments
 (0)