镜像自地址
https://github.com/tuna/tunasync.git
已同步 2025-12-06 22:46:47 +00:00
[WIP] Cgroupv2: fix test
这个提交包含在:
@@ -8,6 +8,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
cgv1 "github.com/containerd/cgroups"
|
||||||
units "github.com/docker/go-units"
|
units "github.com/docker/go-units"
|
||||||
|
|
||||||
. "github.com/smartystreets/goconvey/convey"
|
. "github.com/smartystreets/goconvey/convey"
|
||||||
@@ -147,11 +148,15 @@ sleep 30
|
|||||||
logger.Errorf("Failed to create cgroup")
|
logger.Errorf("Failed to create cgroup")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if cg.subsystem == "memory" {
|
So(cg.cgMgrV1, ShouldNotBeNil)
|
||||||
memoLimit, err := ioutil.ReadFile(filepath.Join(cg.basePath, "memory", cg.baseGroup, provider.Name(), "memory.limit_in_bytes"))
|
for _, subsys := range(cg.cgMgrV1.Subsystems()) {
|
||||||
|
if subsys.Name() == cgv1.Memory {
|
||||||
|
memoLimit, err := ioutil.ReadFile(filepath.Join(cgcf.BasePath, "memory", cgcf.Group, provider.Name(), "memory.limit_in_bytes"))
|
||||||
So(err, ShouldBeNil)
|
So(err, ShouldBeNil)
|
||||||
So(strings.Trim(string(memoLimit), "\n"), ShouldEqual, strconv.Itoa(512*1024*1024))
|
So(strings.Trim(string(memoLimit), "\n"), ShouldEqual, strconv.Itoa(512*1024*1024))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
cg.postExec()
|
cg.postExec()
|
||||||
|
So(cg.cgMgrV1, ShouldBeNil)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户