Run download only test with docker daemon unavailable

pull/8969/head
Priya Wadhwa 2020-08-11 14:38:28 -04:00
parent 74309a83e6
commit 6ff308d892
1 changed files with 4 additions and 1 deletions

View File

@ -165,7 +165,10 @@ func TestDownloadOnlyKic(t *testing.T) {
args := []string{"start", "--download-only", "-p", profile, "--force", "--alsologtostderr"}
args = append(args, StartArgs()...)
if _, err := Run(t, exec.CommandContext(ctx, Target(), args...)); err != nil {
cmd := exec.CommandContext(ctx, Target(), args...)
// make sure this works even if docker daemon isn't running
cmd.Env = append(os.Environ(), "DOCKER_HOST=/does/not/exist")
if _, err := Run(t, cmd); err != nil {
t.Errorf("start with download only failed %q : %v", args, err)
}