2015-05-14 06:42:16 +08:00
|
|
|
// +build linux
|
|
|
|
|
2014-05-15 06:21:44 +08:00
|
|
|
package cgroups
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestParseCgroups(t *testing.T) {
|
2015-09-10 16:06:45 +08:00
|
|
|
cgroups, err := ParseCgroupFile("/proc/self/cgroup")
|
2014-05-15 06:21:44 +08:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-10-31 13:38:27 +08:00
|
|
|
if IsCgroup2UnifiedMode() {
|
|
|
|
return
|
|
|
|
}
|
2015-09-10 16:06:45 +08:00
|
|
|
if _, ok := cgroups["cpu"]; !ok {
|
|
|
|
t.Fail()
|
|
|
|
}
|
2014-05-15 06:21:44 +08:00
|
|
|
}
|