Commit 406a315e authored by Jim Harris's avatar Jim Harris
Browse files

test/qos: don't eat fio_py return value



If fio.py fails, we need to fail the test.  Running
$fio_py in $() eats the return code and effectively
does no QoS data checking - so it would always pass
the test.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I9960463e4d980784dd2622cfee658ea280ddb557

Reviewed-on: https://review.gerrithub.io/423424


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 92861ff5
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -9,7 +9,10 @@ function check_qos_works_well() {
	local enable_limit=$1
	local iops_limit=$2/1000
	local retval=0
	local read_iops=$($fio_py 8192 64 randread 5 | grep "\(read: IOPS=\|write: IOPS=\)" |

	$fio_py 8192 64 randread 5 > fio.txt

	local read_iops=$(cat fio.txt | grep "\(read: IOPS=\|write: IOPS=\)" |
		awk -F, '{print $1}' | awk -F= '{print $2}' | tr -d [k])
	if [ $enable_limit = true ]; then
		retval=$(echo "$iops_limit*0.9 < $read_iops && $read_iops < $iops_limit*1.01" | bc)
@@ -68,7 +71,7 @@ sleep 1
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT

trap "iscsicleanup; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
trap "iscsicleanup; rm -f fio.txt; killprocess $pid; exit 1" SIGINT SIGTERM EXIT

# Limit the I/O rate by RPC, then confirm the observed rate matches.
$rpc_py set_bdev_qos_limit_iops Malloc0 $IOPS_LIMIT
@@ -84,6 +87,7 @@ check_qos_works_well true $IOPS_LIMIT
echo "I/O rate limiting tests successful"

iscsicleanup
rm -f fio.txt
$rpc_py delete_target_node 'iqn.2016-06.io.spdk:Target1'

rm -f ./local-job0-0-verify.state