(t *testing.T)
| 37 | } |
| 38 | |
| 39 | func TestSelfPath(t *testing.T) { |
| 40 | _, err := v1MountPoint() |
| 41 | if err == ErrMountPointNotExist { |
| 42 | t.Skip("skipping test that requires cgroup hierarchy") |
| 43 | } else if err != nil { |
| 44 | t.Fatal(err) |
| 45 | } |
| 46 | paths, err := ParseCgroupFile("/proc/self/cgroup") |
| 47 | if err != nil { |
| 48 | t.Fatal(err) |
| 49 | } |
| 50 | dp := strings.TrimPrefix(paths["devices"], "/") |
| 51 | path := NestedPath("test") |
| 52 | p, err := path("devices") |
| 53 | if err != nil { |
| 54 | t.Fatal(err) |
| 55 | } |
| 56 | if p != filepath.Join("/", dp, "test") { |
| 57 | t.Fatalf("expected self path of %q but received %q", filepath.Join("/", dp, "test"), p) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | func TestPidPath(t *testing.T) { |
| 62 | _, err := v1MountPoint() |
nothing calls this directly
no test coverage detected
searching dependent graphs…