]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
selftests: ublk: don't pass ${dev_id} to _cleanup_test()
authorMing Lei <ming.lei@redhat.com>
Mon, 3 Mar 2025 12:43:16 +0000 (20:43 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 10 Mar 2025 22:24:42 +0000 (16:24 -0600)
More devices can be created in single tests, so simply remove all
ublk devices in _cleanup_test(), meantime remove the ${dev_id} argument
of _cleanup_test().

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250303124324.3563605-7-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/test_common.sh
tools/testing/selftests/ublk/test_loop_01.sh
tools/testing/selftests/ublk/test_loop_02.sh
tools/testing/selftests/ublk/test_loop_03.sh
tools/testing/selftests/ublk/test_loop_04.sh
tools/testing/selftests/ublk/test_null_01.sh

index 61044cb581381c517d93383d2e7742afcb48e24f..d70690281d14b7b668ee26183f3634ee09cc0293 100755 (executable)
@@ -89,7 +89,7 @@ _show_result()
 }
 
 _cleanup_test() {
-       "${UBLK_PROG}" del -n "$1"
+       "${UBLK_PROG}" del -a
 }
 
 _add_ublk_dev() {
index 1d3f934dca4c7fcd223e3957cfd727854a5f1147..48a85796ca436c2b7b9908cd1088a4f84845a9cf 100755 (executable)
@@ -24,7 +24,7 @@ fio --name=write_and_verify \
     --bs=4k > /dev/null 2>&1
 ERR_CODE=$?
 
-_cleanup_test "${dev_id}" "loop"
+_cleanup_test "loop"
 
 _remove_backfile "$backfile_0"
 
index df06b78048819022690cb58a34263004a8c0b9be..0a4b5fadbc73ad1c2d416cf126a63ee5c00d9543 100755 (executable)
@@ -15,7 +15,7 @@ dev_id=$(_add_ublk_dev -t loop "$backfile_0")
 _mkfs_mount_test /dev/ublkb"${dev_id}"
 ERR_CODE=$?
 
-_cleanup_test "${dev_id}" "loop"
+_cleanup_test "loop"
 
 _remove_backfile "$backfile_0"
 
index 2255b4296590f446dafb9ed208d1676be7371ef2..5a11356e502c34dacac8dcb703d18f94acab17fb 100755 (executable)
@@ -26,7 +26,7 @@ fio --name=write_and_verify \
     --bs=4k > /dev/null 2>&1
 ERR_CODE=$?
 
-_cleanup_test "${dev_id}" "loop"
+_cleanup_test "loop"
 
 _remove_backfile "$backfile_0"
 
index a797b25213ececc2cc2e848aca0e722851674fdf..7e0d4dd8127e1a19a73fb4788d2367978be4a85b 100755 (executable)
@@ -15,7 +15,7 @@ dev_id=$(_add_ublk_dev -t loop -z "$backfile_0")
 _mkfs_mount_test /dev/ublkb"${dev_id}"
 ERR_CODE=$?
 
-_cleanup_test "${dev_id}" "loop"
+_cleanup_test "loop"
 
 _remove_backfile "$backfile_0"
 
index b048ddc4ae6f271362129ca73c514616d225498f..af11e73b7df6e26fdd2dd69de3796203fc6d33ef 100755 (executable)
@@ -14,6 +14,6 @@ dev_id=$(_add_ublk_dev -t null)
 fio --name=job1 --filename=/dev/ublkb"${dev_id}" --ioengine=libaio --rw=readwrite --iodepth=32 --size=256M > /dev/null 2>&1
 ERR_CODE=$?
 
-_cleanup_test "${dev_id}" "null"
+_cleanup_test "null"
 
 _show_result $TID $ERR_CODE