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 |
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
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.
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 --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)")
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(-)