Skip to content

Commit 88f544e

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 28ecaa9 commit 88f544e

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

integration/framework/framework.go

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ const (
103103
Aufs string = "aufs"
104104
Overlay string = "overlay"
105105
Overlay2 string = "overlay2"
106+
OverlayFS string = "overlayfs" // containerd overlayfs snapshotter
106107
DeviceMapper string = "devicemapper"
107108
Unknown string = ""
108109
)
@@ -312,26 +313,17 @@ func (a dockerActions) Version() []string {
312313
}
313314

314315
func (a dockerActions) StorageDriver() string {
315-
dockerCommand := []string{"docker", "info"}
316-
output, _ := a.fm.Shell().Run("sudo", dockerCommand...)
317-
if len(output) < 1 {
316+
output, _ := a.fm.Shell().Run("sudo", "docker", "info", "--format", "{{.Driver}}")
317+
driver := strings.TrimSpace(output)
318+
if driver == "" {
318319
a.fm.T().Fatalf("failed to find docker storage driver - %v", output)
319320
}
320-
for _, line := range strings.Split(output, "\n") {
321-
line = strings.TrimSpace(line)
322-
if strings.HasPrefix(line, "Storage Driver: ") {
323-
idx := strings.LastIndex(line, ": ") + 2
324-
driver := line[idx:]
325-
switch driver {
326-
case Aufs, Overlay, Overlay2, DeviceMapper:
327-
return driver
328-
default:
329-
return Unknown
330-
}
331-
}
321+
switch driver {
322+
case Aufs, Overlay, Overlay2, OverlayFS, DeviceMapper:
323+
return driver
324+
default:
325+
return Unknown
332326
}
333-
a.fm.T().Fatalf("failed to find docker storage driver from info - %v", output)
334-
return Unknown
335327
}
336328

337329
func (a dockerActions) RunStress(args DockerRunArgs, cmd ...string) string {

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)