diff --git a/integration-cli/docker_test_vars.go b/integration-cli/docker_test_vars.go index a7791760ea..b6113992e0 100644 --- a/integration-cli/docker_test_vars.go +++ b/integration-cli/docker_test_vars.go @@ -54,6 +54,11 @@ var ( dockerBasePath string volumesConfigPath string containerStoragePath string + + // daemonStorageDriver is held globally so that tests can know the storage + // driver of the daemon. This is initialized in docker_utils by sending + // a version call to the daemon and examining the response header. + daemonStorageDriver string ) const ( diff --git a/integration-cli/docker_utils.go b/integration-cli/docker_utils.go index edd985ce9f..3198287100 100644 --- a/integration-cli/docker_utils.go +++ b/integration-cli/docker_utils.go @@ -86,6 +86,7 @@ func init() { var info types.Info err = json.Unmarshal(body, &info) + daemonStorageDriver = info.Driver dockerBasePath = info.DockerRootDir volumesConfigPath = filepath.Join(dockerBasePath, "volumes") containerStoragePath = filepath.Join(dockerBasePath, "containers") diff --git a/integration-cli/requirements.go b/integration-cli/requirements.go index 4bc2b654da..e948c0aae0 100644 --- a/integration-cli/requirements.go +++ b/integration-cli/requirements.go @@ -109,22 +109,14 @@ var ( } NotOverlay = testRequirement{ func() bool { - cmd := exec.Command("grep", "^overlay / overlay", "/proc/mounts") - if err := cmd.Run(); err != nil { - return true - } - return false + return !strings.HasPrefix(daemonStorageDriver, "overlay") }, "Test requires underlying root filesystem not be backed by overlay.", } Devicemapper = testRequirement{ func() bool { - cmd := exec.Command("grep", "^devicemapper / devicemapper", "/proc/mounts") - if err := cmd.Run(); err != nil { - return false - } - return true + return strings.HasPrefix(daemonStorageDriver, "devicemapper") }, "Test requires underlying root filesystem to be backed by devicemapper.", }