File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -1123,18 +1123,24 @@ EOF
1123
1123
@test " podman run --device-read-bps" {
1124
1124
skip_if_rootless " cannot use this flag in rootless mode"
1125
1125
1126
+ if test \! -e /dev/nullb0; then
1127
+ skip " /dev/nullb0 not present, use 'modprobe null_blk nr_devices=1' to create it"
1128
+ fi
1129
+
1126
1130
local cid
1131
+ local dev_maj_min=$( stat -c %Hr:%Lr /dev/nullb0)
1132
+
1127
1133
# this test is a triple check on blkio flags since they seem to sneak by the tests
1128
1134
if is_cgroupsv2; then
1129
- run_podman run -dt --device-read-bps=/dev/zero :1M $IMAGE top
1135
+ run_podman run -dt --device-read-bps=/dev/nullb0 :1M $IMAGE top
1130
1136
cid=$output
1131
1137
run_podman exec -it $output cat /sys/fs/cgroup/io.max
1132
- is " $output " " .*1:5 rbps=1048576 wbps=max riops=max wiops=max" " throttle devices passed successfully.*"
1138
+ is " $output " " .*$dev_maj_min rbps=1048576 wbps=max riops=max wiops=max" " throttle devices passed successfully.*"
1133
1139
else
1134
- run_podman run -dt --device-read-bps=/dev/zero :1M $IMAGE top
1140
+ run_podman run -dt --device-read-bps=/dev/nullb0 :1M $IMAGE top
1135
1141
cid=$output
1136
1142
run_podman exec -it $output cat /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device
1137
- is " $output " " .*1:5 1048576" " throttle devices passed successfully.*"
1143
+ is " $output " " .*$dev_maj_min 1048576" " throttle devices passed successfully.*"
1138
1144
fi
1139
1145
run_podman container rm -f -t0 $cid
1140
1146
}
Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ memory-reservation = 400M | 2 | $mm.soft_limit_in_bytes = 419430400
63
63
blkio-weight = 321 | - | - | io.bfq.weight = default 321 $lomajmin 98
64
64
blkio-weight-device = $LOOPDEVICE :98 | - | - | io.bfq.weight = default 321 $lomajmin 98
65
65
66
- device-read-bps = /dev/zero :10mb | - | - | io.max = $devicemax
67
- device-read-iops = /dev/zero :2000 | - | - | io.max = $devicemax
68
- device-write-bps = /dev/zero :30mb | - | - | io.max = $devicemax
69
- device-write-iops = /dev/zero :4000 | - | - | io.max = $devicemax
66
+ device-read-bps = $LOOPDEVICE :10mb | - | - | io.max = $devicemax
67
+ device-read-iops = $LOOPDEVICE :2000 | - | - | io.max = $devicemax
68
+ device-write-bps = $LOOPDEVICE :30mb | - | - | io.max = $devicemax
69
+ device-write-iops = $LOOPDEVICE :4000 | - | - | io.max = $devicemax
70
70
"
71
71
72
72
# Run a container
You can’t perform that action at this time.
0 commit comments