]> www.infradead.org Git - users/hch/blktests.git/commitdiff
zbd/004: Add zone condition "Closed" for sequential write required zones
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 20 Feb 2019 08:12:28 +0000 (17:12 +0900)
committerOmar Sandoval <osandov@fb.com>
Wed, 20 Feb 2019 18:19:47 +0000 (10:19 -0800)
The test case zbd/004 executes write operations for two sequential write
required zones across the zone boundary between them. After the write
operation, the second zone has non-zero write pointer. At that status,
the zone can have not only "Implicit Open" condition but also "Closed"
condition based on zone status management logic of the block zoned device.

Add "Closed" condition to the zone condition check logic in zbd/004. Add
ZONE_COND_CLOSED constant definition in zbd/rc.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/zbd/004
tests/zbd/rc

index 291626d62fba2a6f769295d5e40eb07c65acfefe..ac0cf50c7d7233339f6c6b6d910099cc7a7e5e64 100755 (executable)
@@ -83,7 +83,14 @@ test_device() {
        _put_blkzone_report
        _get_blkzone_report "${TEST_DEV}" || return $?
        _check_zone_cond "${idx}" "${ZONE_COND_FULL}" || return $?
-       _check_zone_cond "$((idx+1))" "${ZONE_COND_IMPLICIT_OPEN}" || return $?
+       if ((ZONE_CONDS[idx+1] != ZONE_COND_IMPLICIT_OPEN)) && \
+                  ((ZONE_CONDS[idx+1] != ZONE_COND_CLOSED)); then
+               echo -n "Zone ${idx+1} condition is neither "
+               echo -n "${ZONE_COND_ARRAY[ZONE_COND_IMPLICIT_OPEN]} nor "
+               echo -n "${ZONE_COND_ARRAY[ZONE_COND_CLOSED]} "
+               echo "cond: ${ZONE_COND_ARRAY[ZONE_CONDS[idx+1]]}"
+               return 1
+       fi
        if [[ ${ZONE_WPTRS[idx+1]} -ne ${phys_blk_sectors} ]]; then
                echo -n "Unexpected write pointer for zone $((idx+1)) "
                echo "wp: ${ZONE_WPTRS[idx+1]}"
index 1d6f80a4723ae35fc6dcd4fbcbec48ebf199547f..c32bf31f77039359f93530f3bc00a9a910f7fa54 100644 (file)
@@ -39,6 +39,7 @@ export ZONE_TYPE_SEQ_WRITE_PREFERRED=3
 
 export ZONE_COND_EMPTY=1
 export ZONE_COND_IMPLICIT_OPEN=2
+export ZONE_COND_CLOSED=4
 export ZONE_COND_FULL=14
 
 export ZONE_TYPE_ARRAY=(