MCPcopy Index your code
hub / github.com/containerd/containerd / TestGetOverlayPath

Function TestGetOverlayPath

core/diff/apply/apply_linux_test.go:23–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21)
22
23func TestGetOverlayPath(t *testing.T) {
24 good := []string{"upperdir=/test/upper", "lowerdir=/test/lower1:/test/lower2", "workdir=/test/work"}
25 path, parents, err := getOverlayPath(good)
26 if err != nil {
27 t.Fatalf("Get overlay path failed: %v", err)
28 }
29 if path != "/test/upper" {
30 t.Fatalf("Unexpected upperdir: %q", path)
31 }
32 if len(parents) != 2 || parents[0] != "/test/lower1" || parents[1] != "/test/lower2" {
33 t.Fatalf("Unexpected parents: %v", parents)
34 }
35
36 bad := []string{"lowerdir=/test/lower"}
37 _, _, err = getOverlayPath(bad)
38 if err == nil {
39 t.Fatalf("An error is expected")
40 }
41}

Callers

nothing calls this directly

Calls 1

getOverlayPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…