MCPcopy
hub / github.com/containerd/containerd / TestRemoveVolatileTempMount

Function TestRemoveVolatileTempMount

core/mount/mount_test.go:152–307  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

150}
151
152func TestRemoveVolatileTempMount(t *testing.T) {
153 testCases := []struct {
154 desc string
155 input []Mount
156 expected []Mount
157 }{
158 {
159 desc: "remove volatile option from overlay mounts, ignore non overlay",
160 input: []Mount{
161 {
162 Type: "overlay",
163 Source: "overlay",
164 Options: []string{
165 "index=off",
166 "workdir=/path/to/snapshots/4/work",
167 "upperdir=/path/to/snapshots/4/fs",
168 "lowerdir=/path/to/snapshots/1/fs",
169 "volatile",
170 },
171 },
172 {
173 Type: "underlay",
174 Source: "underlay",
175 Options: []string{
176 "index=on",
177 "lowerdir=/another/path/to/snapshots/2/fs",
178 "volatile",
179 },
180 },
181 },
182 expected: []Mount{
183 {
184 Type: "overlay",
185 Source: "overlay",
186 Options: []string{
187 "index=off",
188 "workdir=/path/to/snapshots/4/work",
189 "upperdir=/path/to/snapshots/4/fs",
190 "lowerdir=/path/to/snapshots/1/fs",
191 },
192 },
193 {
194 Type: "underlay",
195 Source: "underlay",
196 Options: []string{
197 "index=on",
198 "lowerdir=/another/path/to/snapshots/2/fs",
199 "volatile",
200 },
201 },
202 },
203 },
204 {
205 desc: "remove fsync=volatile option from overlay mounts, ignore non overlay",
206 input: []Mount{
207 {
208 Type: "overlay",
209 Source: "overlay",

Callers

nothing calls this directly

Calls 2

copyMountsFunction · 0.85
RemoveVolatileOptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…