Skip to content

Commit

Permalink
Verify the empty mounts.conf does not generate warnings.
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Feb 2, 2024
1 parent 7cb0c2e commit 0da4054
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,30 @@ search | $IMAGE |
run_podman rm -f -t0 $cid
}

@test "podman run with mounts.conf missing" {
skip_if_remote "--default-mounts-file is not supported for remote clients"
MOUNTS_CONF=$PODMAN_TMPDIR/mounts.conf
run_podman run --rm --default-mounts-file=${MOUNTS_CONF} $IMAGE echo test1
assert "$output" = "test1" "No warning messages on missing mounts file"

touch ${MOUNTS_CONF}

run_podman run --rm --default-mounts-file=${MOUNTS_CONF} $IMAGE echo test2
assert "$output" = "test2" "No warning messages on empty mounts file"

echo /tmp/bogus > ${MOUNTS_CONF}
run_podman run --rm --default-mounts-file=${MOUNTS_CONF} $IMAGE echo test3
assert "$output" = "test3" "No warning messages on missing content in mounts file"

randfile=$(random_string 30)
randcontent=$(random_string 30)
mkdir -p $PODMAN_TMPDIR/mounts
echo $randcontent > $PODMAN_TMPDIR/mounts/$randfile
echo $PODMAN_TMPDIR/mounts:/run/secrets > ${MOUNTS_CONF}
run_podman run --rm --default-mounts-file=${MOUNTS_CONF} $IMAGE cat /run/secrets/$randfile
assert "$output" = "$randcontent" "mounts should appear in container"
}

@test "podman run - rm pod if container creation failed with -pod new:" {
run_podman run -d --name foobar $IMAGE hostname
cid=$output
Expand Down

0 comments on commit 0da4054

Please sign in to comment.