Skip to content

Commit 1edba6b

Browse files
committed
integration: adjust tests for containerd snapshotters
Attempt to adjust the tests to work with a docker daemon using the containerd snapshotters (which would have, e.g., "overlayfs" instead of "overlay2" as storage driver). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 387e703 commit 1edba6b

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

integration/framework/framework.go

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const (
9393
Aufs string = "aufs"
9494
Overlay string = "overlay"
9595
Overlay2 string = "overlay2"
96+
OverlayFS string = "overlayfs" // containerd overlayfs snapshotter
9697
DeviceMapper string = "devicemapper"
9798
Unknown string = ""
9899
)
@@ -268,25 +269,17 @@ func (a dockerActions) Version() []string {
268269
}
269270

270271
func (a dockerActions) StorageDriver() string {
271-
dockerCommand := []string{"docker", "info"}
272-
output, _ := a.fm.Shell().Run("sudo", dockerCommand...)
273-
if len(output) < 1 {
272+
output, _ := a.fm.Shell().Run("sudo", "docker", "info", "--format", "{{.Driver}}")
273+
driver := strings.TrimSpace(output)
274+
if driver == "" {
274275
a.fm.T().Fatalf("failed to find docker storage driver - %v", output)
275276
}
276-
for _, line := range strings.Split(output, "\n") {
277-
line = strings.TrimSpace(line)
278-
if strings.HasPrefix(line, "Storage Driver: ") {
279-
idx := strings.LastIndex(line, ": ") + 2
280-
driver := line[idx:]
281-
switch driver {
282-
case Aufs, Overlay, Overlay2, DeviceMapper:
283-
return driver
284-
default:
285-
return Unknown
286-
}
287-
}
277+
switch driver {
278+
case Aufs, Overlay, Overlay2, OverlayFS, DeviceMapper:
279+
return driver
280+
default:
281+
return Unknown
288282
}
289-
a.fm.T().Fatalf("failed to find docker storage driver from info - %v", output)
290283
return Unknown
291284
}
292285

integration/tests/api/docker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ func TestDockerFilesystemStats(t *testing.T) {
349349
}
350350
needsBaseUsageCheck := false
351351
switch storageDriver {
352-
case framework.Aufs, framework.Overlay, framework.Overlay2, framework.DeviceMapper:
352+
case framework.Aufs, framework.Overlay, framework.Overlay2, framework.OverlayFS:
353353
needsBaseUsageCheck = true
354354
}
355355
pass := false

0 commit comments

Comments
 (0)