summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-10-29 13:28:01 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-11-04 13:52:08 -0500
commit6ca705bf1af6fd516b14ab043dc922e55eeaf832 (patch)
tree02cee3832aa7aea4a40913bb9bcba28a0054174e /test/system
parentab273a9cbd08e25e3794c606a863644eb3a06e30 (diff)
downloadpodman-6ca705bf1af6fd516b14ab043dc922e55eeaf832.tar.gz
podman-6ca705bf1af6fd516b14ab043dc922e55eeaf832.tar.bz2
podman-6ca705bf1af6fd516b14ab043dc922e55eeaf832.zip
Add support for mounting external containers
Continue progress on use of external containers. This PR adds the ability to mount, umount and list the storage containers whether they are in libpod or not. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/060-mount.bats31
1 files changed, 30 insertions, 1 deletions
diff --git a/test/system/060-mount.bats b/test/system/060-mount.bats
index 73d210084..f04f34bf6 100644
--- a/test/system/060-mount.bats
+++ b/test/system/060-mount.bats
@@ -2,7 +2,6 @@
load helpers
-
@test "podman mount - basic test" {
# Only works with root (FIXME: does it work with rootless + vfs?)
skip_if_rootless "mount does not work rootless"
@@ -151,4 +150,34 @@ load helpers
run_podman rm -f $cid
}
+@test "podman mount external container - basic test" {
+ # Only works with root (FIXME: does it work with rootless + vfs?)
+ skip_if_rootless "mount does not work rootless"
+ skip_if_remote "mounting remote is meaningless"
+
+ # Create a container that podman does not know about
+ external_cid=$(buildah from $IMAGE)
+
+ run_podman mount $external_cid
+ mount_path=$output
+
+ # Test image will always have this file, and will always have the tag
+ test -d $mount_path
+ is $(< "$mount_path/home/podman/testimage-id") "$PODMAN_TEST_IMAGE_TAG" \
+ "Contents of well-known file in image"
+
+ # Make sure that 'podman mount' (no args) returns the expected path
+ run_podman mount --notruncate
+
+ reported_mountpoint=$(echo "$output" | awk '{print $2}')
+ is $reported_mountpoint $mount_path "mountpoint reported by 'podman mount'"
+
+ # umount, and make sure files are gone
+ run_podman umount $external_cid
+ if [ -d "$mount_path" ]; then
+ die "'podman umount' did not umount"
+ fi
+ buildah rm $external_cid
+}
+
# vim: filetype=sh