* [PATCH blktests v2 0/2] blktests: add ability for multiple dev sysfs checks
@ 2026-01-22 19:31 John Pittman
2026-01-22 19:31 ` [PATCH blktests v2 1/2] common/rc: support multiple arguments for _require_test_dev_sysfs() John Pittman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: John Pittman @ 2026-01-22 19:31 UTC (permalink / raw)
To: shinichiro.kawasaki; +Cc: linux-block, John Pittman
This patchset adds the ability to loop within _require_test_dev_sysfs()
and check multiple sysfs values rather than only one. In older kernels,
as we've seen in recent testing, its common for sysfs values to be
missing, so it's good to check these files prior to testing. We also
use the new format in block/042 to resolve recently seen failures.
Changes in v2:
* set attr variable to local in _require_test_dev_sysfs()
* removed empty arg to _require_test_dev_sysfs() in device_requires()
* changed spaces to tabs before _require_test_dev_sysfs
John Pittman (2):
common/rc: support multiple arguments for _require_test_dev_sysfs()
block/042: check sysfs values prior to running
common/rc | 13 ++++++++-----
tests/block/042 | 4 +++-
2 files changed, 11 insertions(+), 6 deletions(-)
--
2.51.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH blktests v2 1/2] common/rc: support multiple arguments for _require_test_dev_sysfs()
2026-01-22 19:31 [PATCH blktests v2 0/2] blktests: add ability for multiple dev sysfs checks John Pittman
@ 2026-01-22 19:31 ` John Pittman
2026-01-22 19:31 ` [PATCH blktests v2 2/2] block/042: check sysfs values prior to running John Pittman
2026-01-25 7:17 ` [PATCH blktests v2 0/2] blktests: add ability for multiple dev sysfs checks Shinichiro Kawasaki
2 siblings, 0 replies; 4+ messages in thread
From: John Pittman @ 2026-01-22 19:31 UTC (permalink / raw)
To: shinichiro.kawasaki; +Cc: linux-block, John Pittman
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..f09ba8b 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 attr 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH blktests v2 2/2] block/042: check sysfs values prior to running
2026-01-22 19:31 [PATCH blktests v2 0/2] blktests: add ability for multiple dev sysfs checks John Pittman
2026-01-22 19:31 ` [PATCH blktests v2 1/2] common/rc: support multiple arguments for _require_test_dev_sysfs() John Pittman
@ 2026-01-22 19:31 ` John Pittman
2026-01-25 7:17 ` [PATCH blktests v2 0/2] blktests: add ability for multiple dev sysfs checks Shinichiro Kawasaki
2 siblings, 0 replies; 4+ messages in thread
From: John Pittman @ 2026-01-22 19:31 UTC (permalink / raw)
To: shinichiro.kawasaki; +Cc: linux-block, John Pittman
In testing some older kernels recently, block/042 has failed due
to dma_alignment and virt_boundary_mask not being present.
Running block/042
+cat: '.../queue/dma_alignment': No such file or directory
+cat: '.../queue/virt_boundary_mask': No such file or directory
+dio-offsets: test_dma_aligned: failed to write buf: Invalid argument
To ensure we skip if this is the case, check all sysfs values prior
to run. Also, change the spaces to tabs before _require_test_dev_sysfs
for consistency with the rest of blktests.
Signed-off-by: John Pittman <jpittman@redhat.com>
---
tests/block/042 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/block/042 b/tests/block/042
index 28ac4a2..8a31149 100644
--- a/tests/block/042
+++ b/tests/block/042
@@ -11,7 +11,9 @@ DESCRIPTION="Test unusual direct-io offsets"
QUICK=1
device_requires() {
- _require_test_dev_sysfs
+ _require_test_dev_sysfs "queue/max_segments" "queue/dma_alignment" \
+ "queue/virt_boundary_mask" "queue/logical_block_size" \
+ "queue/max_sectors_kb"
}
test_device() {
--
2.51.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH blktests v2 0/2] blktests: add ability for multiple dev sysfs checks
2026-01-22 19:31 [PATCH blktests v2 0/2] blktests: add ability for multiple dev sysfs checks John Pittman
2026-01-22 19:31 ` [PATCH blktests v2 1/2] common/rc: support multiple arguments for _require_test_dev_sysfs() John Pittman
2026-01-22 19:31 ` [PATCH blktests v2 2/2] block/042: check sysfs values prior to running John Pittman
@ 2026-01-25 7:17 ` Shinichiro Kawasaki
2 siblings, 0 replies; 4+ messages in thread
From: Shinichiro Kawasaki @ 2026-01-25 7:17 UTC (permalink / raw)
To: John Pittman; +Cc: linux-block@vger.kernel.org
On Jan 22, 2026 / 14:31, John Pittman wrote:
> This patchset adds the ability to loop within _require_test_dev_sysfs()
> and check multiple sysfs values rather than only one. In older kernels,
> as we've seen in recent testing, its common for sysfs values to be
> missing, so it's good to check these files prior to testing. We also
> use the new format in block/042 to resolve recently seen failures.
John, thanks for this v2 series. I applied it.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-01-25 7:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-22 19:31 [PATCH blktests v2 0/2] blktests: add ability for multiple dev sysfs checks John Pittman
2026-01-22 19:31 ` [PATCH blktests v2 1/2] common/rc: support multiple arguments for _require_test_dev_sysfs() John Pittman
2026-01-22 19:31 ` [PATCH blktests v2 2/2] block/042: check sysfs values prior to running John Pittman
2026-01-25 7:17 ` [PATCH blktests v2 0/2] blktests: add ability for multiple dev sysfs checks Shinichiro Kawasaki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox