test: check podman update errors on non-block devices

This is a test case for an issue fixed by the previous commit.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-06-10 14:16:23 -07:00
parent 3f0cdb9414
commit 2221ca9943

View File

@ -326,4 +326,27 @@ function nrand() {
run_podman rm -t 0 -f $ctrname
}
# bats test_tags=ci:parallel
@test "podman update - non-block device rejected by --*device* options" {
local dev=/dev/zero # Not a block device.
local block_opts=(
"--blkio-weight-device=$dev:123"
"--device-read-bps=$dev:10mb"
"--device-write-bps=$dev:10mb"
"--device-read-iops=$dev:1000"
"--device-write-iops=$dev:1000"
)
run_podman run -d "$IMAGE" /home/podman/pause
cid="$output"
defer-assertion-failures
for opt in "${block_opts[@]}"; do
run_podman 125 update "$cid" "$opt"
assert "$output" =~ "$dev: not a block device"
done
immediate-assertion-failures
run_podman rm -t 0 -f "$cid"
}
# vim: filetype=sh