diff --git a/test/system/030-run.bats b/test/system/030-run.bats index bed44e6850..d89d3c1ca2 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -1123,18 +1123,24 @@ EOF @test "podman run --device-read-bps" { skip_if_rootless "cannot use this flag in rootless mode" + if test \! -e /dev/nullb0; then + skip "/dev/nullb0 not present, use 'modprobe null_blk nr_devices=1' to create it" + fi + local cid + local dev_maj_min=$(stat -c %Hr:%Lr /dev/nullb0) + # this test is a triple check on blkio flags since they seem to sneak by the tests if is_cgroupsv2; then - run_podman run -dt --device-read-bps=/dev/zero:1M $IMAGE top + run_podman run -dt --device-read-bps=/dev/nullb0:1M $IMAGE top cid=$output run_podman exec -it $output cat /sys/fs/cgroup/io.max - is "$output" ".*1:5 rbps=1048576 wbps=max riops=max wiops=max" "throttle devices passed successfully.*" + is "$output" ".*$dev_maj_min rbps=1048576 wbps=max riops=max wiops=max" "throttle devices passed successfully.*" else - run_podman run -dt --device-read-bps=/dev/zero:1M $IMAGE top + run_podman run -dt --device-read-bps=/dev/nullb0:1M $IMAGE top cid=$output run_podman exec -it $output cat /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device - is "$output" ".*1:5 1048576" "throttle devices passed successfully.*" + is "$output" ".*$dev_maj_min 1048576" "throttle devices passed successfully.*" fi run_podman container rm -f -t0 $cid } diff --git a/test/system/280-update.bats b/test/system/280-update.bats index 451049ca5d..19c0e3aa47 100644 --- a/test/system/280-update.bats +++ b/test/system/280-update.bats @@ -63,10 +63,10 @@ memory-reservation = 400M | 2 | $mm.soft_limit_in_bytes = 419430400 blkio-weight = 321 | - | - | io.bfq.weight = default 321 $lomajmin 98 blkio-weight-device = $LOOPDEVICE:98 | - | - | io.bfq.weight = default 321 $lomajmin 98 -device-read-bps = /dev/zero:10mb | - | - | io.max = $devicemax -device-read-iops = /dev/zero:2000 | - | - | io.max = $devicemax -device-write-bps = /dev/zero:30mb | - | - | io.max = $devicemax -device-write-iops = /dev/zero:4000 | - | - | io.max = $devicemax +device-read-bps = $LOOPDEVICE:10mb | - | - | io.max = $devicemax +device-read-iops = $LOOPDEVICE:2000 | - | - | io.max = $devicemax +device-write-bps = $LOOPDEVICE:30mb | - | - | io.max = $devicemax +device-write-iops = $LOOPDEVICE:4000 | - | - | io.max = $devicemax " # Run a container