public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org, Ming Lei <ming.lei@redhat.com>
Subject: [PATCH 06/11] selftests: ublk: don't pass ${dev_id} to _cleanup_test()
Date: Mon,  3 Mar 2025 20:43:16 +0800	[thread overview]
Message-ID: <20250303124324.3563605-7-ming.lei@redhat.com> (raw)
In-Reply-To: <20250303124324.3563605-1-ming.lei@redhat.com>

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>
---
 tools/testing/selftests/ublk/test_common.sh  | 2 +-
 tools/testing/selftests/ublk/test_loop_01.sh | 2 +-
 tools/testing/selftests/ublk/test_loop_02.sh | 2 +-
 tools/testing/selftests/ublk/test_loop_03.sh | 2 +-
 tools/testing/selftests/ublk/test_loop_04.sh | 2 +-
 tools/testing/selftests/ublk/test_null_01.sh | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/ublk/test_common.sh b/tools/testing/selftests/ublk/test_common.sh
index 61044cb58138..d70690281d14 100755
--- a/tools/testing/selftests/ublk/test_common.sh
+++ b/tools/testing/selftests/ublk/test_common.sh
@@ -89,7 +89,7 @@ _show_result()
 }
 
 _cleanup_test() {
-	"${UBLK_PROG}" del -n "$1"
+	"${UBLK_PROG}" del -a
 }
 
 _add_ublk_dev() {
diff --git a/tools/testing/selftests/ublk/test_loop_01.sh b/tools/testing/selftests/ublk/test_loop_01.sh
index 1d3f934dca4c..48a85796ca43 100755
--- a/tools/testing/selftests/ublk/test_loop_01.sh
+++ b/tools/testing/selftests/ublk/test_loop_01.sh
@@ -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"
 
diff --git a/tools/testing/selftests/ublk/test_loop_02.sh b/tools/testing/selftests/ublk/test_loop_02.sh
index df06b7804881..0a4b5fadbc73 100755
--- a/tools/testing/selftests/ublk/test_loop_02.sh
+++ b/tools/testing/selftests/ublk/test_loop_02.sh
@@ -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"
 
diff --git a/tools/testing/selftests/ublk/test_loop_03.sh b/tools/testing/selftests/ublk/test_loop_03.sh
index 2255b4296590..5a11356e502c 100755
--- a/tools/testing/selftests/ublk/test_loop_03.sh
+++ b/tools/testing/selftests/ublk/test_loop_03.sh
@@ -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"
 
diff --git a/tools/testing/selftests/ublk/test_loop_04.sh b/tools/testing/selftests/ublk/test_loop_04.sh
index a797b25213ec..7e0d4dd8127e 100755
--- a/tools/testing/selftests/ublk/test_loop_04.sh
+++ b/tools/testing/selftests/ublk/test_loop_04.sh
@@ -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"
 
diff --git a/tools/testing/selftests/ublk/test_null_01.sh b/tools/testing/selftests/ublk/test_null_01.sh
index b048ddc4ae6f..af11e73b7df6 100755
--- a/tools/testing/selftests/ublk/test_null_01.sh
+++ b/tools/testing/selftests/ublk/test_null_01.sh
@@ -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
-- 
2.47.0


  parent reply	other threads:[~2025-03-03 12:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 12:43 [PATCH 00/11] selftests: ublk: bug fixes & consolidation Ming Lei
2025-03-03 12:43 ` [PATCH 01/11] selftests: ublk: make ublk_stop_io_daemon() more reliable Ming Lei
2025-03-03 21:31   ` Keith Busch
2025-03-03 12:43 ` [PATCH 02/11] selftests: ublk: fix build failure Ming Lei
2025-03-03 21:31   ` Keith Busch
2025-03-03 12:43 ` [PATCH 03/11] selftests: ublk: add --foreground command line Ming Lei
2025-03-03 21:31   ` Keith Busch
2025-03-03 12:43 ` [PATCH 04/11] selftests: ublk: fix parsing '-a' argument Ming Lei
2025-03-03 21:32   ` Keith Busch
2025-03-03 12:43 ` [PATCH 05/11] selftests: ublk: support shellcheck and fix all warning Ming Lei
2025-03-03 12:43 ` Ming Lei [this message]
2025-03-03 12:43 ` [PATCH 07/11] selftests: ublk: move zero copy feature check into _add_ublk_dev() Ming Lei
2025-03-03 12:43 ` [PATCH 08/11] selftests: ublk: load/unload ublk_drv when preparing & cleaning up tests Ming Lei
2025-03-03 12:43 ` [PATCH 09/11] selftests: ublk: add one stress test for covering IO vs. removing device Ming Lei
2025-03-03 12:43 ` [PATCH 10/11] selftests: ublk: add stress test for covering IO vs. killing ublk server Ming Lei
2025-03-03 12:43 ` [PATCH 11/11] selftests: ublk: improve test usability Ming Lei
2025-03-10 15:09 ` [PATCH 00/11] selftests: ublk: bug fixes & consolidation Ming Lei
2025-03-10 15:17   ` Jens Axboe
2025-03-11  4:35     ` Ming Lei
2025-03-11 13:28       ` Jens Axboe
2025-03-10 15:18 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250303124324.3563605-7-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox