summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/system/160-volumes.bats25
-rw-r--r--test/system/helpers.bash2
2 files changed, 26 insertions, 1 deletions
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats
index 43462de36..1271b7c0b 100644
--- a/test/system/160-volumes.bats
+++ b/test/system/160-volumes.bats
@@ -319,5 +319,30 @@ EOF
is "$output" "" "no more volumes to prune"
}
+@test "podman volume type=bind" {
+ myvoldir=${PODMAN_TMPDIR}/volume_$(random_string)
+ mkdir $myvoldir
+ touch $myvoldir/myfile
+
+ myvolume=myvol$(random_string)
+ run_podman 125 volume create -o type=bind -o device=/bogus $myvolume
+ is "$output" "Error: invalid volume option device for driver 'local': stat /bogus: no such file or directory" "should fail with bogus directory not existing"
+
+ run_podman volume create -o type=bind -o device=/$myvoldir $myvolume
+ is "$output" "$myvolume" "should successfully create myvolume"
+
+ run_podman run --rm -v $myvolume:/vol:z $IMAGE \
+ stat -c "%u:%s" /vol/myfile
+ is "$output" "0:0" "w/o keep-id: stat(file in container) == root"
+}
+
+@test "podman volume type=tmpfs" {
+ myvolume=myvol$(random_string)
+ run_podman volume create -o type=tmpfs -o device=tmpfs $myvolume
+ is "$output" "$myvolume" "should successfully create myvolume"
+
+ run_podman run --rm -v $myvolume:/vol $IMAGE stat -f -c "%T" /vol
+ is "$output" "tmpfs" "volume should be tmpfs"
+}
# vim: filetype=sh
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index 415c9010e..7be694dbd 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -63,7 +63,7 @@ function basic_setup() {
for line in "${lines[@]}"; do
set $line
echo "# setup(): removing stray external container $1 ($2)" >&3
- run_podman rm $1
+ run_podman rm -f $1
done
# Clean up all images except those desired