aboutsummaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
Diffstat (limited to 'test/system')
-rw-r--r--test/system/010-images.bats4
-rw-r--r--test/system/035-logs.bats8
-rw-r--r--test/system/160-volumes.bats40
-rw-r--r--test/system/200-pod.bats5
4 files changed, 53 insertions, 4 deletions
diff --git a/test/system/010-images.bats b/test/system/010-images.bats
index 201418620..ebd71450f 100644
--- a/test/system/010-images.bats
+++ b/test/system/010-images.bats
@@ -272,6 +272,10 @@ Deleted: $pauseID" "infra images gets removed as well"
is "$output" ""
run_podman create --pod new:$pname $IMAGE
+ # Clean up
+ run_podman rm "${lines[-1]}"
+ run_podman pod rm -a
+ run_podman rmi $pauseImage
}
@test "podman images - rmi -f can remove infra images" {
diff --git a/test/system/035-logs.bats b/test/system/035-logs.bats
index 3caf97a22..db50c8f8c 100644
--- a/test/system/035-logs.bats
+++ b/test/system/035-logs.bats
@@ -90,14 +90,16 @@ ${cid[0]} d" "Sequential output from logs"
}
function _log_test_restarted() {
- run_podman run --log-driver=$1 --name logtest $IMAGE sh -c 'start=0; if test -s log; then start=`tail -n 1 log`; fi; seq `expr $start + 1` `expr $start + 10` | tee -a log'
+ local driver=$1
+ local events_backend=$(_additional_events_backend $driver)
+ run_podman run --log-driver=$driver ${events_backend} --name logtest $IMAGE sh -c 'start=0; if test -s log; then start=`tail -n 1 log`; fi; seq `expr $start + 1` `expr $start + 10` | tee -a log'
# FIXME: #9597
# run/start is flaking for remote so let's wait for the container condition
# to stop wasting energy until the root cause gets fixed.
run_podman container wait --condition=exited logtest
- run_podman start -a logtest
+ run_podman ${events_backend} start -a logtest
logfile=$(mktemp -p ${PODMAN_TMPDIR} logfileXXXXXXXX)
- $PODMAN $_PODMAN_TEST_OPTS logs -f logtest > $logfile
+ $PODMAN $_PODMAN_TEST_OPTS ${events_backend} logs -f logtest > $logfile
expected=$(mktemp -p ${PODMAN_TMPDIR} expectedXXXXXXXX)
seq 1 20 > $expected
diff -u ${expected} ${logfile}
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats
index 1271b7c0b..b6030ba3c 100644
--- a/test/system/160-volumes.bats
+++ b/test/system/160-volumes.bats
@@ -345,4 +345,44 @@ EOF
is "$output" "tmpfs" "volume should be tmpfs"
}
+# Named volumes copyup
+@test "podman volume create copyup" {
+ myvolume=myvol$(random_string)
+ mylabel=$(random_string)
+
+ # Create a named volume
+ run_podman volume create $myvolume
+ is "$output" "$myvolume" "output from volume create"
+
+ # Confirm that it shows up in 'volume ls', and confirm values
+ run_podman volume ls --format json
+ tests="
+Name | $myvolume
+Driver | local
+NeedsCopyUp | true
+NeedsChown | true
+"
+ parse_table "$tests" | while read field expect; do
+ actual=$(jq -r ".[0].$field" <<<"$output")
+ is "$actual" "$expect" "volume ls .$field"
+ done
+
+ run_podman run --rm --volume $myvolume:/vol $IMAGE true
+ run_podman volume inspect --format '{{ .NeedsCopyUp }}' $myvolume
+ is "${output}" "true" "If content in dest '/vol' empty NeedsCopyUP should still be true"
+ run_podman volume inspect --format '{{ .NeedsChown }}' $myvolume
+ is "${output}" "false" "After first use within a container NeedsChown should still be false"
+
+ run_podman run --rm --volume $myvolume:/etc $IMAGE ls /etc/passwd
+ run_podman volume inspect --format '{{ .NeedsCopyUp }}' $myvolume
+ is "${output}" "false" "If content in dest '/etc' non-empty NeedsCopyUP should still have happend and be false"
+
+ run_podman volume inspect --format '{{.Mountpoint}}' $myvolume
+ mountpoint="$output"
+ test -e "$mountpoint/passwd"
+
+ # Clean up
+ run_podman volume rm $myvolume
+}
+
# vim: filetype=sh
diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats
index 57d052ce2..6abdf9779 100644
--- a/test/system/200-pod.bats
+++ b/test/system/200-pod.bats
@@ -62,8 +62,8 @@ function teardown() {
@test "podman pod create - custom infra image" {
+ skip_if_remote "CONTAINERS_CONF only effects server side"
image="i.do/not/exist:image"
-
tmpdir=$PODMAN_TMPDIR/pod-test
run mkdir -p $tmpdir
containersconf=$tmpdir/containers.conf
@@ -77,6 +77,9 @@ EOF
CONTAINERS_CONF=$containersconf run_podman 125 pod create
is "$output" ".*initializing source docker://$image:.*"
+
+ CONTAINERS_CONF=$containersconf run_podman 125 create --pod new:test $IMAGE
+ is "$output" ".*initializing source docker://$image:.*"
}
@test "podman pod - communicating between pods" {