Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions e2e/container/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ func TestRunAttachedFromRemoteImageAndRemove(t *testing.T) {
golden.Assert(t, result.Stderr(), "run-attached-from-remote-and-remove.golden")
}

func TestForceRemoveImage(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have test coverage for that here in the unit test suite: https://github.com/docker/cli/blob/master/cli/command/image/remove_test.go#L71-L78

Following https://github.com/docker/cli/blob/master/TESTING.md#guidelines I don't think we need an e2e test for the force flag.

I unit test for a successful docker rmi would be good, but it would go in the e2e/image package.

result := icmd.RunCmd(shell(t, "docker rmi -f badb33f99donteatme"))
result.Assert(t, icmd.Success)
}

// TODO: create this with registry API instead of engine API
func createRemoteImage(t *testing.T) string {
image := "registry:5000/alpine:test-run-pulls"
Expand Down