From: John Pittman <jpittman@redhat.com>
To: shinichiro.kawasaki@wdc.com
Cc: linux-block@vger.kernel.org, John Pittman <jpittman@redhat.com>
Subject: [PATCH blktests 1/2] common/rc: support multiple arguments for _require_test_dev_sysfs()
Date: Wed, 14 Jan 2026 16:08:08 -0500 [thread overview]
Message-ID: <20260114210809.2195262-2-jpittman@redhat.com> (raw)
In-Reply-To: <20260114210809.2195262-1-jpittman@redhat.com>
In some cases we may need to check multiple sysfs values for tests.
If this happens, create the ability to pass in multiple arguments to
_require_test_dev_sysfs() instead of having to call the function
multiple times.
Signed-off-by: John Pittman <jpittman@redhat.com>
---
common/rc | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/common/rc b/common/rc
index b76a856..e4b5196 100644
--- a/common/rc
+++ b/common/rc
@@ -326,11 +326,14 @@ _test_dev_is_rotational() {
}
_require_test_dev_sysfs() {
- if [[ ! -e "${TEST_DEV_SYSFS}/$1" ]]; then
- SKIP_REASONS+=("${TEST_DEV} does not have sysfs attribute $1")
- return 1
- fi
- return 0
+ local ret=0
+ for attr in "$@"; do
+ if [[ ! -e "${TEST_DEV_SYSFS}/$attr" ]]; then
+ SKIP_REASONS+=("${TEST_DEV} does not have sysfs attribute $attr")
+ ret=1
+ fi
+ done
+ return $ret
}
_require_test_dev_is_rotational() {
--
2.51.1
next prev parent reply other threads:[~2026-01-14 21:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 21:08 [PATCH blktests 0/2] blktests: add ability for multiple dev sysfs checks John Pittman
2026-01-14 21:08 ` John Pittman [this message]
2026-01-16 13:04 ` [PATCH blktests 1/2] common/rc: support multiple arguments for _require_test_dev_sysfs() Shinichiro Kawasaki
2026-01-14 21:08 ` [PATCH blktests 2/2] block/042: check sysfs values prior to running John Pittman
2026-01-16 13:03 ` Shinichiro Kawasaki
2026-01-20 16:16 ` John Pittman
2026-01-21 1:38 ` Shinichiro Kawasaki
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=20260114210809.2195262-2-jpittman@redhat.com \
--to=jpittman@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.com \
/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