libcontainer: fix TestGetContainerState to check configs.NEWCGROUP

This test needs to handle the case of configs.NEWCGROUP
as Namespace's type.

Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
This commit is contained in:
Kenta Tada 2019-05-21 09:10:38 +09:00
parent b9b6cc6e47
commit 65032b55b1
1 changed files with 3 additions and 0 deletions

View File

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