From: Bart Van Assche <bvanassche@acm.org>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: linux-block@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH blktests] block/044: Strip script line numbers from expected stderr output
Date: Sun, 29 Nov 2026 15:53:25 -0800 [thread overview]
Message-ID: <20261129235326.3447865-1-bvanassche@acm.org> (raw)
tests/block/044.out expects bash error messages referencing lines 56 and
57 for the two invalid error injection rules, while the corresponding echo
commands are on lines 49 and 50 of tests/block/044. As a result, block/044
fails whenever CONFIG_BLK_ERROR_INJECTION is enabled.
Strip the "<script>: line <N>: " prefix from stderr when testing invalid
rules and update tests/block/044.out accordingly so the test output does
not depend on script line numbers.
Fixes: 10f78d6a7ad0 ("block/044: basic block error injection sanity test")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
tests/block/044 | 6 ++++--
tests/block/044.out | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/block/044 b/tests/block/044
index 097dd79d3bda..24367c048d81 100755
--- a/tests/block/044
+++ b/tests/block/044
@@ -46,8 +46,10 @@ _test_rules()
xfs_io -d -c 'pread -q 8192 8192' /dev/"$dev"
echo "Testing invalid rules"
- echo "op=READ,status=IOERR" > "$debugfs_file"
- echo "add,op=READ,status=EIO,start=32" > "$debugfs_file"
+ {
+ echo "op=READ,status=IOERR" > "$debugfs_file"
+ echo "add,op=READ,status=EIO,start=32" > "$debugfs_file"
+ } 2>&1 | sed 's/^[^:]*: line [0-9]*: //'
_exit_scsi_debug
}
diff --git a/tests/block/044.out b/tests/block/044.out
index 92efcddf7c8e..01d27b40d21f 100644
--- a/tests/block/044.out
+++ b/tests/block/044.out
@@ -4,6 +4,6 @@ Testing valid rules
pwrite: Cannot allocate memory
pread: Input/output error
Testing invalid rules
-tests/block/044: line 56: echo: write error: Invalid argument
-tests/block/044: line 57: echo: write error: Invalid argument
+echo: write error: Invalid argument
+echo: write error: Invalid argument
Test complete
next reply other threads:[~2026-11-29 23:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 23:53 Bart Van Assche [this message]
2026-12-03 0:24 ` [PATCH blktests] block/044: Strip script line numbers from expected stderr output Shin'ichiro 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=20261129235326.3447865-1-bvanassche@acm.org \
--to=bvanassche@acm.org \
--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