X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=t%2Fzbd%2Frun-tests-against-zoned-nullb;fp=t%2Fzbd%2Frun-tests-against-zoned-nullb;h=f9c9530ce68335addd2fbd482f196b0cbb7a89af;hb=b6b64bfec2dd4ce7db64c57ecf771bb7b2f105f6;hp=53aee3e84caf9fa6c67a3a5817b18690c336d729;hpb=d7c7539faf5f1c23962590f80b40dafe2d232207;p=fio.git diff --git a/t/zbd/run-tests-against-zoned-nullb b/t/zbd/run-tests-against-zoned-nullb index 53aee3e8..f9c9530c 100755 --- a/t/zbd/run-tests-against-zoned-nullb +++ b/t/zbd/run-tests-against-zoned-nullb @@ -6,6 +6,21 @@ scriptdir="$(cd "$(dirname "$0")" && pwd)" +zone_size=1 +zone_capacity=1 +if [[ ${1} == "-h" ]]; then + echo "Usage: ${0} [OPTIONS]" + echo "Options:" + echo -e "\t-h Show this message." + echo -e "\t-zone-cap Use null blk with zone capacity less than zone size." + echo -e "\tany option supported by test-zbd-support script." + exit 1 +elif [[ ${1} == "-zone-cap" ]]; then + zone_size=4 + zone_capacity=3 + shift +fi + for d in /sys/kernel/config/nullb/*; do [ -d "$d" ] && rmdir "$d"; done modprobe -r null_blk modprobe null_blk nr_devices=0 || exit $? @@ -17,9 +32,18 @@ modprobe -r null_blk modprobe null_blk nr_devices=0 && cd /sys/kernel/config/nullb && mkdir nullb0 && - cd nullb0 && - echo 1 > zoned && - echo 1 > zone_size && + cd nullb0 || exit $? + +if ((zone_capacity < zone_size)); then + if [[ ! -w zone_capacity ]]; then + echo "null blk does not support zone capacity" + exit 1 + fi + echo "${zone_capacity}" > zone_capacity +fi + +echo 1 > zoned && + echo "${zone_size}" > zone_size && echo 0 > completion_nsec && echo 4096 > blocksize && echo 1024 > size &&