Skip to content

Commit

Permalink
Fix E2E tests
Browse files Browse the repository at this point in the history
The Commit test is blatantly wrong and testing buggy behavior. We
should be commiting the destination, if anything - and more
likely nothing at all.

When force-removing volumes, don't remove the volumes of
containers we need to remove. This can lead to a chicken and the
egg problem where the container removes the volume before we can.
When we re-add volume locks this could lead to deadlocks. I don't
really want to deal with this, and this doesn't seem a
particularly harmful quirk, so we'll let this slide until we get
a bug report.

Signed-off-by: Matthew Heon <[email protected]>
  • Loading branch information
mheon committed Apr 4, 2019
1 parent 1fdc89f commit 02c6110
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libpod/runtime_volume_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (r *Runtime) removeVolume(ctx context.Context, v *Volume, force bool) error
// containers?
// I'm inclined to say no, in case someone accidentally
// wipes a container they're using...
if err := r.removeContainer(ctx, ctr, false, true); err != nil {
if err := r.removeContainer(ctx, ctr, false, false); err != nil {
return errors.Wrapf(err, "error removing container %s that depends on volume %s", ctr.ID(), v.Name())
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/commit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ var _ = Describe("Podman commit", func() {
inspect.WaitWithDefaultTimeout()
Expect(inspect.ExitCode()).To(Equal(0))
image := inspect.InspectImageJSON()
_, ok := image[0].Config.Volumes["/tmp"]
_, ok := image[0].Config.Volumes["/foo"]
Expect(ok).To(BeTrue())

r := podmanTest.Podman([]string{"run", "newimage"})
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/volume_rm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var _ = Describe("Podman volume rm", func() {

})

It("podman rm volume", func() {
It("podman volume rm", func() {
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand All @@ -47,7 +47,7 @@ var _ = Describe("Podman volume rm", func() {
Expect(len(session.OutputToStringArray())).To(Equal(0))
})

It("podman rm with --force flag", func() {
It("podman volume rm with --force flag", func() {
SkipIfRemote()
session := podmanTest.Podman([]string{"create", "-v", "myvol:/myvol", ALPINE, "ls"})
cid := session.OutputToString()
Expand Down

0 comments on commit 02c6110

Please sign in to comment.