summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-02-14 15:43:52 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-02-21 16:47:12 -0500
commitc4dfbd58f5eb3851e031a5abfdbd9364e1779eb2 (patch)
treecab16fd90771afba7a8e4f6e8302cfbb90d9e7ce /test
parenta746a61a171d514947dbd4db88541e3702647f2d (diff)
downloadpodman-c4dfbd58f5eb3851e031a5abfdbd9364e1779eb2.tar.gz
podman-c4dfbd58f5eb3851e031a5abfdbd9364e1779eb2.tar.bz2
podman-c4dfbd58f5eb3851e031a5abfdbd9364e1779eb2.zip
Don't log errors on removing volumes inuse, if container --volumes-from
When removing a container created with a --volumes-from a container created with a built in volume, we complain if the original container still exists. Since this is an expected state, we should not complain about it. Fixes: https://github.com/containers/podman/issues/12808 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/system/070-build.bats21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index a95acd986..c963d8325 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -1016,6 +1016,27 @@ EOF
run_podman build -t build_test $tmpdir/link
}
+@test "podman build --volumes-from conflict" {
+ rand_content=$(random_string 50)
+
+ tmpdir=$PODMAN_TMPDIR/build-test
+ mkdir -p $tmpdir
+ dockerfile=$tmpdir/Dockerfile
+ cat >$dockerfile <<EOF
+FROM $IMAGE
+VOLUME /vol
+EOF
+
+ run_podman build -t build_test $tmpdir
+ is "$output" ".*COMMIT" "COMMIT seen in log"
+
+ run_podman run -d --name test_ctr build_test top
+ run_podman run --rm --volumes-from test_ctr $IMAGE echo $rand_content
+ is "$output" "$rand_content" "No error should be thrown about volume in use"
+
+ run_podman rmi -f build_test
+}
+
function teardown() {
# A timeout or other error in 'build' can leave behind stale images
# that podman can't even see and which will cascade into subsequent