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: Jim Harris <james.r.harris@intel.com>
Change-Id: I9960463e4d980784dd2622cfee658ea280ddb557

Reviewed-on: https://review.gerrithub.io/423424
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Jim Harris 2018-08-24 13:14:26 -07:00
parent 92861ff5f8
commit 406a315ee6

View File

@ -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