test: another test case for TestIsCgroupPod

contains reserved word pod

Signed-off-by: STRRL <im@strrl.dev>
This commit is contained in:
STRRL 2022-05-03 00:01:09 +08:00
parent 28b9216b42
commit 297b6c2995
No known key found for this signature in database
GPG Key ID: C85379B5FF6BF1F0

View File

@ -102,6 +102,12 @@ func TestIsCgroupPod(t *testing.T) {
expectedResult: false, expectedResult: false,
expectedUID: types.UID(""), expectedUID: types.UID(""),
}, },
{
// contains reserved word "pod" in cgroup name
input: NewCgroupName(RootCgroupName, GetPodCgroupNameSuffix("this-uid-contains-reserved-word-pod")),
expectedResult: false,
expectedUID: types.UID(""),
},
} }
for _, cgroupDriver := range []string{"cgroupfs", "systemd"} { for _, cgroupDriver := range []string{"cgroupfs", "systemd"} {
pcm := &podContainerManagerImpl{ pcm := &podContainerManagerImpl{