Skip to content

Commit

Permalink
test: TestCopyIntoVolume should clean up after itself [skip ci] (ddev…
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay authored Jun 3, 2024
1 parent e083d34 commit c0c2811
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/dockerutil/dockerutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,11 @@ func TestCopyIntoVolume(t *testing.T) {
assert.NoError(err)

pwd, _ := os.Getwd()
t.Cleanup(func() {
err = dockerutil.RemoveVolume(t.Name())
assert.NoError(err)
})

err = dockerutil.CopyIntoVolume(filepath.Join(pwd, "testdata", t.Name()), t.Name(), "", "0", "", true)
assert.NoError(err)

Expand Down Expand Up @@ -617,7 +622,6 @@ subdir1.txt
_, out, err = dockerutil.RunSimpleContainer(versionconstants.BusyboxImage, "", []string{"cat", "/mnt/" + t.Name() + "/root.txt"}, nil, nil, []string{t.Name() + ":/mnt/" + t.Name()}, "25", true, false, nil, nil, nil)
assert.NoError(err)
assert.Equal("root.txt here\n", out)

}

// TestDockerIP tries out a number of DOCKER_HOST permutations
Expand Down

0 comments on commit c0c2811

Please sign in to comment.