After the recent change in util-linux [1], the 'blkzone report' command no longer reports numeric values for write pointers when zones are in full condition. Currently, zbd test scripts assume that the write pointer values are numeric, then the blkzone change triggered failures. To avoid the failures, check the zone condition and handle the write pointer values as numeric only when zones are not in the full condition. Also, drop the "-i" option of the local variable 'wptr' declaration in zbd/002 so that it can hold non-numerical values. Link: [1] https://github.com/util-linux/util-linux/commit/b032247f48d8b6a13bf8541eb663c779e448f568 Signed-off-by: Shin'ichiro Kawasaki --- tests/zbd/002 | 2 +- tests/zbd/rc | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/zbd/002 b/tests/zbd/002 index 39c2ad5..ac83c46 100755 --- a/tests/zbd/002 +++ b/tests/zbd/002 @@ -25,7 +25,7 @@ _check_blkzone_report() { local -i next_start=0 local -i len=0 local -i cap=0 - local -i wptr=0 + local wptr=0 local -i cond=0 local -i zone_type=0 diff --git a/tests/zbd/rc b/tests/zbd/rc index 570928b..921cf62 100644 --- a/tests/zbd/rc +++ b/tests/zbd/rc @@ -141,15 +141,22 @@ _get_blkzone_report() { fi local _IFS=$IFS - local -i loop=0 + local -i loop=0 cond IFS=$' ,:' while read -r -a _tokens do ZONE_STARTS+=($((_tokens[1]))) ZONE_LENGTHS+=($((_tokens[3]))) ZONE_CAPS+=($((_tokens[cap_idx]))) - ZONE_WPTRS+=($((_tokens[wptr_idx]))) - ZONE_CONDS+=($((${_tokens[conds_idx]%\(*}))) + # The latest blkzone reports 'N/A' as write pointers for full + # zones. In that case, do not handle it as numeric. + cond=$((${_tokens[conds_idx]%\(*})) + if ((cond == ZONE_COND_FULL)); then + ZONE_WPTRS+=("${_tokens[wptr_idx]}") + else + ZONE_WPTRS+=($((_tokens[wptr_idx]))) + fi + ZONE_CONDS+=("${cond}") ZONE_TYPES+=($((${_tokens[type_idx]%\(*}))) if [[ ${ZONE_TYPES[-1]} -eq ${ZONE_TYPE_CONVENTIONAL} ]]; then (( NR_CONV_ZONES++ )) -- 2.53.0