(t *testing.T)
| 59 | } |
| 60 | |
| 61 | func TestPidPath(t *testing.T) { |
| 62 | _, err := v1MountPoint() |
| 63 | if err == ErrMountPointNotExist { |
| 64 | t.Skip("skipping test that requires cgroup hierarchy") |
| 65 | } else if err != nil { |
| 66 | t.Fatal(err) |
| 67 | } |
| 68 | paths, err := ParseCgroupFile("/proc/self/cgroup") |
| 69 | if err != nil { |
| 70 | t.Fatal(err) |
| 71 | } |
| 72 | dp := strings.TrimPrefix(paths["devices"], "/") |
| 73 | path := PidPath(os.Getpid()) |
| 74 | p, err := path("devices") |
| 75 | if err != nil { |
| 76 | t.Fatal(err) |
| 77 | } |
| 78 | if p != filepath.Join("/", dp) { |
| 79 | t.Fatalf("expected self path of %q but received %q", filepath.Join("/", dp), p) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func TestRootPath(t *testing.T) { |
| 84 | p, err := RootPath(Cpu) |
nothing calls this directly
no test coverage detected
searching dependent graphs…