Merge pull request #2061 from KentaTada/add-cgroup-namespace-test

libcontainer: fix TestGetContainerState to check configs.NEWCGROUP
This commit is contained in:
Mrunal Patel 2019-05-22 16:09:38 -07:00 committed by GitHub
commit 5ef781c2e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -200,6 +200,7 @@ func TestGetContainerState(t *testing.T) {
{Type: configs.NEWUTS}, {Type: configs.NEWUTS},
// emulate host for IPC // emulate host for IPC
//{Type: configs.NEWIPC}, //{Type: configs.NEWIPC},
{Type: configs.NEWCGROUP},
}, },
}, },
initProcess: &mockProcess{ initProcess: &mockProcess{
@ -278,6 +279,8 @@ func TestGetContainerState(t *testing.T) {
file = "user" file = "user"
case configs.NEWUTS: case configs.NEWUTS:
file = "uts" file = "uts"
case configs.NEWCGROUP:
file = "cgroup"
} }
expected := fmt.Sprintf("/proc/%d/ns/%s", pid, file) expected := fmt.Sprintf("/proc/%d/ns/%s", pid, file)
if expected != path { if expected != path {