MCPcopy
hub / github.com/containerd/containerd / TestBindToOverlay

Function TestBindToOverlay

core/unpack/unpacker_test.go:97–179  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestBindToOverlay(t *testing.T) {
98 testCases := []struct {
99 name string
100 mounts []mount.Mount
101 expect []mount.Mount
102 }{
103 {
104 name: "single bind mount",
105 mounts: []mount.Mount{
106 {
107 Type: "bind",
108 Source: "/path/to/source",
109 Options: []string{"ro", "rbind"},
110 },
111 },
112 expect: []mount.Mount{
113 {
114 Type: "overlay",
115 Source: "overlay",
116 Options: []string{
117 "ro",
118 "upperdir=/path/to/source",
119 },
120 },
121 },
122 },
123 {
124 name: "overlay mount",
125 mounts: []mount.Mount{
126 {
127 Type: "overlay",
128 Source: "overlay",
129 Options: []string{
130 "lowerdir=/path/to/lower",
131 "upperdir=/path/to/upper",
132 },
133 },
134 },
135 expect: []mount.Mount{
136 {
137 Type: "overlay",
138 Source: "overlay",
139 Options: []string{
140 "lowerdir=/path/to/lower",
141 "upperdir=/path/to/upper",
142 },
143 },
144 },
145 },
146 {
147 name: "multiple mounts",
148 mounts: []mount.Mount{
149 {
150 Type: "bind",
151 Source: "/path/to/source1",
152 },
153 {
154 Type: "bind",

Callers

nothing calls this directly

Calls 2

bindToOverlayFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…