TS_CMD_ADDPART=${TS_CMD_ADDPART:-"${ts_commandsdir}addpart"}
TS_CMD_DELPART=${TS_CMD_DELPART:-"${ts_commandsdir}delpart"}
TS_CMD_BITS=${TS_CMD_BITS-"${ts_commandsdir}bits"}
-TS_CMD_BLKDISCARD=${TS_CMD_BLKID-"${ts_commandsdir}blkdiscard"}
+TS_CMD_BLKDISCARD=${TS_CMD_BLKDISCARD-"${ts_commandsdir}blkdiscard"}
TS_CMD_BLKID=${TS_CMD_BLKID-"${ts_commandsdir}blkid"}
+TS_CMD_BLKZONE=${TS_CMD_BLKZONE-"${ts_commandsdir}blkzone"}
TS_CMD_CAL=${TS_CMD_CAL-"${ts_commandsdir}cal"}
TS_CMD_CHOOM=${TS_CMD_CHOOM:-"${ts_commandsdir}choom"}
TS_CMD_CHSH=${TS_CMD_CHSH:-"${ts_commandsdir}chsh"}
--- /dev/null
+0x00000c000
--- /dev/null
+ start: 0x00000c000, len 0x004000, cap 0x004000, wptr N/A reset:0 non-seq:0, zcond:14(fu) [type: 2(SEQ_WRITE_REQUIRED)]
+---------
+ start: 0x00000c000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
--- /dev/null
+ start: 0x000008000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 3(oe) [type: 2(SEQ_WRITE_REQUIRED)]
+ successful close of zones in range from 32768, to 49152
--- /dev/null
+ start: 0x000000000, len 0x004000, cap 0x004000, wptr N/A reset:0 non-seq:0, zcond: 0(nw) [type: 1(CONVENTIONAL)]
+ start: 0x000004000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x000008000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x00000c000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x000010000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x000014000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x000018000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x00001c000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+---------
+ start: 0x000008000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x00000c000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x000010000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x000014000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x000018000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x00001c000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+---------
+ start: 0x000008000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x00000c000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
+ start: 0x000010000, len 0x004000, cap 0x004000, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
--- /dev/null
+#!/usr/bin/env bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# Copyright (C) 2026 Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="options"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_BLKZONE"
+
+ts_skip_nonroot
+
+DEV_SIZE_MEBIBYTES="64"
+DEV_SECTOR_SIZE=512
+ZONE_SIZE_MEBIBYTES=8
+ZONE_LENGTH_SECTORS=$(( (ZONE_SIZE_MEBIBYTES * 1024**2) / 512 ))
+
+# https://sg.danny.cz/sg/scsi_debug.html#__RefHeading___Toc121_3679520260
+ts_scsi_debug_init dev_size_mb="$DEV_SIZE_MEBIBYTES" \
+ sector_size="$DEV_SECTOR_SIZE" \
+ ptype=0x14 zone_size_mb="$ZONE_SIZE_MEBIBYTES" \
+ zbc=2
+DEV="$TS_DEVICE"
+
+
+ts_init_subtest "report"
+
+offset=$((2 * ZONE_LENGTH_SECTORS ))
+
+{
+ "$TS_CMD_BLKZONE" report "$DEV"
+ echo "---------"
+ "$TS_CMD_BLKZONE" report --offset $offset "$DEV"
+ echo "---------"
+ "$TS_CMD_BLKZONE" report --count 3 --offset $offset "$DEV"
+
+} >>"$TS_OUTPUT" 2>>"$TS_ERRLOG"
+
+unset -v offset
+
+ts_finalize_subtest
+
+
+ts_init_subtest "finish-reset"
+
+offset=$((3 * ZONE_LENGTH_SECTORS ))
+
+{
+ "$TS_CMD_BLKZONE" finish --count 1 --offset $offset "$DEV"
+ "$TS_CMD_BLKZONE" report --count 1 --offset $offset "$DEV"
+ "$TS_CMD_BLKZONE" reset --count 1 --offset $offset "$DEV"
+ echo "---------"
+ "$TS_CMD_BLKZONE" report --count 1 --offset $offset "$DEV"
+
+} >>"$TS_OUTPUT" 2>>"$TS_ERRLOG"
+
+unset -v offset
+
+ts_finalize_subtest
+
+
+ts_init_subtest "open-close"
+
+offset=$((2 * ZONE_LENGTH_SECTORS ))
+
+{
+ "$TS_CMD_BLKZONE" open --count 1 --offset $offset "$DEV"
+ "$TS_CMD_BLKZONE" report --count 1 --offset $offset "$DEV"
+ "$TS_CMD_BLKZONE" close --verbose --count 1 --offset $offset "$DEV"
+
+} >>"$TS_OUTPUT" 2>>"$TS_ERRLOG"
+
+sed -i -e 's|\(/dev/.*\):\(.*\)|\2|' "$TS_OUTPUT" 2>>"$TS_ERRLOG"
+
+unset -v offset
+
+ts_finalize_subtest
+
+
+ts_init_subtest "capacity"
+
+length=$((3 * ZONE_LENGTH_SECTORS ))
+offset=$((2 * ZONE_LENGTH_SECTORS ))
+
+# The capacity sum should be (3 * $ZONE_LENGTH_SECTORS) in hex, i.e. capacity of
+# three zones.
+"$TS_CMD_BLKZONE" capacity --length $length \
+ --offset $offset "$DEV" \
+ >>"$TS_OUTPUT" 2>>"$TS_ERRLOG"
+
+unset -v offset length
+
+ts_finalize_subtest
+
+
+ts_finalize