Skip to content

Commit 4540b59

Browse files
committed
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 opencontainers#2286 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
1 parent 0c6659a commit 4540b59

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

libcontainer/container_linux_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ import (
1515
)
1616

1717
type mockCgroupManager struct {
18-
pids []int
19-
allPids []int
20-
stats *cgroups.Stats
21-
paths map[string]string
18+
pids []int
19+
allPids []int
20+
stats *cgroups.Stats
21+
paths map[string]string
22+
unifiedPath string
2223
}
2324

2425
type mockIntelRdtManager struct {
@@ -55,7 +56,7 @@ func (m *mockCgroupManager) GetPaths() map[string]string {
5556
}
5657

5758
func (m *mockCgroupManager) GetUnifiedPath() (string, error) {
58-
return "", fmt.Errorf("unimplemented")
59+
return m.unifiedPath, nil
5960
}
6061

6162
func (m *mockCgroupManager) Freeze(state configs.FreezerState) error {

0 commit comments

Comments
 (0)