From 4540b596b8519f4707f2db5dffc19a653e340b3a Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 3 Apr 2020 04:26:45 +0900 Subject: [PATCH] Fix TestGetContainerStateAfterUpdate on cgroup v2 CI was failing on cgroup v2 because mockCgroupManager.GetUnifiedPath() was returning an error. Now the function returns the value of mockCgroupManager.unifiedPath, but the value is currently not used in the tests. Fix #2286 Signed-off-by: Akihiro Suda --- libcontainer/container_linux_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libcontainer/container_linux_test.go b/libcontainer/container_linux_test.go index f8af05d75fb..583c1c0c2fd 100644 --- a/libcontainer/container_linux_test.go +++ b/libcontainer/container_linux_test.go @@ -15,10 +15,11 @@ import ( ) type mockCgroupManager struct { - pids []int - allPids []int - stats *cgroups.Stats - paths map[string]string + pids []int + allPids []int + stats *cgroups.Stats + paths map[string]string + unifiedPath string } type mockIntelRdtManager struct { @@ -55,7 +56,7 @@ func (m *mockCgroupManager) GetPaths() map[string]string { } func (m *mockCgroupManager) GetUnifiedPath() (string, error) { - return "", fmt.Errorf("unimplemented") + return m.unifiedPath, nil } func (m *mockCgroupManager) Freeze(state configs.FreezerState) error {