diff mbox series

[blktests] block/004: reset zones of TEST_DEV before fio operation

Message ID 20230804122007.2396170-1-shinichiro.kawasaki@wdc.com (mailing list archive)
State New, archived
Headers show
Series [blktests] block/004: reset zones of TEST_DEV before fio operation | expand

Commit Message

Shinichiro Kawasaki Aug. 4, 2023, 12:20 p.m. UTC
When test target is a zoned block device with max_active_zones limit
larger than max_open_zones, fio write operation may fail depending on
zone conditions. To avoid the failure, reset zones of the device before
the fio run.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 tests/block/004 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Hannes Reinecke Aug. 4, 2023, 12:55 p.m. UTC | #1
On 8/4/23 14:20, Shin'ichiro Kawasaki wrote:
> When test target is a zoned block device with max_active_zones limit
> larger than max_open_zones, fio write operation may fail depending on
> zone conditions. To avoid the failure, reset zones of the device before
> the fio run.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---
>   tests/block/004 | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/block/004 b/tests/block/004
> index 63484a4..52a260f 100755
> --- a/tests/block/004
> +++ b/tests/block/004
> @@ -15,7 +15,10 @@ requires() {
>   }
>   
>   device_requires() {
> -	! _test_dev_is_zoned || _have_fio_zbd_zonemode
> +	if _test_dev_is_zoned; then
> +		_have_fio_zbd_zonemode
> +		_have_program blkzone
> +	fi
>   }
>   
What would be the return value here?
Do we care?
Should we make it explicit?

Cheers,

Hannes
Shinichiro Kawasaki Aug. 7, 2023, 12:09 a.m. UTC | #2
On Aug 04, 2023 / 14:55, Hannes Reinecke wrote:
> On 8/4/23 14:20, Shin'ichiro Kawasaki wrote:
> > When test target is a zoned block device with max_active_zones limit
> > larger than max_open_zones, fio write operation may fail depending on
> > zone conditions. To avoid the failure, reset zones of the device before
> > the fio run.
> > 
> > Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> > ---
> >   tests/block/004 | 6 +++++-
> >   1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/block/004 b/tests/block/004
> > index 63484a4..52a260f 100755
> > --- a/tests/block/004
> > +++ b/tests/block/004
> > @@ -15,7 +15,10 @@ requires() {
> >   }
> >   device_requires() {
> > -	! _test_dev_is_zoned || _have_fio_zbd_zonemode
> > +	if _test_dev_is_zoned; then
> > +		_have_fio_zbd_zonemode
> > +		_have_program blkzone
> > +	fi
> >   }
> What would be the return value here?
> Do we care?
> Should we make it explicit?

No, we no longer care the return value. In the past, return values from
*requires() mattered until the commit 4824ac3f5c4a ("Skip tests based on
SKIP_REASON, not return value"). Instead of the return values, SKIP_REASON
were referred to judge test case skips.

After that, the commit 5c2012764cbc ("common, tests: Print multiple skip
reasons") renamed SKIP_REASON to SKIP_REASONS. These changes are reflected
in the descriptions in the "./new" script.
Shinichiro Kawasaki Aug. 11, 2023, 2 a.m. UTC | #3
On Aug 04, 2023 / 21:20, Shin'ichiro Kawasaki wrote:
> When test target is a zoned block device with max_active_zones limit
> larger than max_open_zones, fio write operation may fail depending on
> zone conditions. To avoid the failure, reset zones of the device before
> the fio run.

I've applied this fix.
diff mbox series

Patch

diff --git a/tests/block/004 b/tests/block/004
index 63484a4..52a260f 100755
--- a/tests/block/004
+++ b/tests/block/004
@@ -15,7 +15,10 @@  requires() {
 }
 
 device_requires() {
-	! _test_dev_is_zoned || _have_fio_zbd_zonemode
+	if _test_dev_is_zoned; then
+		_have_fio_zbd_zonemode
+		_have_program blkzone
+	fi
 }
 
 test_device() {
@@ -24,6 +27,7 @@  test_device() {
 	local -a opts=()
 
 	if _test_dev_is_zoned; then
+		blkzone reset "$TEST_DEV"
 		_test_dev_set_scheduler deadline
 		opts+=("--direct=1" "--zonemode=zbd")
 		opts+=("--max_open_zones=$(_test_dev_max_open_active_zones)")