]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunit/rbd: fixed QoS throughput unit parsing 32280/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 16 Dec 2019 18:10:36 +0000 (13:10 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 17 Dec 2019 14:12:43 +0000 (09:12 -0500)
The 'rbd bench' command was recently modified to print IEC units
instead of bytes/sec. This broke the handling for QoS throughput
tests since it was incorrectly evaluating the available RBD
throughput. Additionally, the QoS tests should use a "<="
comparison operator since the QoS is the upper-bound limit.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
qa/workunits/rbd/qos.sh

index b536fbc65001b693b7f4b036db94fd091cf90454..feb1d5144d40dd09e23cb6e716fd216b95733b27 100755 (executable)
@@ -21,12 +21,15 @@ rbd_bench() {
     fi
 
     # parse `rbd bench` output for string like this:
-    # elapsed:    25  ops:     2560  ops/sec:   100.08  bytes/sec: 409928.13
+    # elapsed:    25  ops:     2560  ops/sec:   100.08  bytes/sec: 409.13 MiB
     iops_bps=$(${timeout_cmd} rbd bench "${image}" \
                               --io-type ${type} --io-size 4K \
                               --io-total ${total} --rbd-cache=false \
                               --rbd_qos_${qos_type}_limit ${qos_limit} |
-                   awk '/elapsed:/ {print int($6) ":" int($8)}')
+                   awk '/elapsed:.* GiB/ {print int($6) ":" int($8) * 1024 * 1024 * 1024}
+                        /elapsed:.* MiB/ {print int($6) ":" int($8) * 1024 * 1024}
+                        /elapsed:.* KiB/ {print int($6) ":" int($8) * 1024}
+                        /elapsed:.* B/   {print int($6) ":" int($8)}')
     eval ${iops_var_name}=${iops_bps%:*}
     eval ${bps_var_name}=${iops_bps#*:}
 }
@@ -43,16 +46,16 @@ test "${iops_unlimited}" -ge 20 || exit 0
 io_total=$((bps_unlimited * 30))
 
 rbd_bench "${POOL}/${IMAGE}" write ${io_total} iops $((iops_unlimited / 2)) iops bps
-test "${iops}" -lt $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
+test "${iops}" -le $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
 
 rbd_bench "${POOL}/${IMAGE}" write ${io_total} write_iops $((iops_unlimited / 2)) iops bps
-test "${iops}" -lt $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
+test "${iops}" -le $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
 
 rbd_bench "${POOL}/${IMAGE}" write ${io_total} bps $((bps_unlimited / 2)) iops bps
-test "${bps}" -lt $((bps_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
+test "${bps}" -le $((bps_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
 
 rbd_bench "${POOL}/${IMAGE}" write ${io_total} write_bps $((bps_unlimited / 2)) iops bps
-test "${bps}" -lt $((bps_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
+test "${bps}" -le $((bps_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
 
 rbd_bench "${POOL}/${IMAGE}" read ${io_total} iops 0 iops bps
 iops_unlimited=$iops
@@ -63,24 +66,24 @@ test "${iops_unlimited}" -ge 20 || exit 0
 io_total=$((bps_unlimited * 30))
 
 rbd_bench "${POOL}/${IMAGE}" read ${io_total} iops $((iops_unlimited / 2)) iops bps
-test "${iops}" -lt $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
+test "${iops}" -le $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
 
 rbd_bench "${POOL}/${IMAGE}" read ${io_total} read_iops $((iops_unlimited / 2)) iops bps
-test "${iops}" -lt $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
+test "${iops}" -le $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
 
 rbd_bench "${POOL}/${IMAGE}" read ${io_total} bps $((bps_unlimited / 2)) iops bps
-test "${bps}" -lt $((bps_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
+test "${bps}" -le $((bps_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
 
 rbd_bench "${POOL}/${IMAGE}" read ${io_total} read_bps $((bps_unlimited / 2)) iops bps
-test "${bps}" -lt $((bps_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
+test "${bps}" -le $((bps_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
 
 # test a config override is applied
 rbd config image set "${POOL}/${IMAGE}" rbd_qos_iops_limit $((iops_unlimited / 4))
 rbd_bench "${POOL}/${IMAGE}" read ${io_total} iops $((iops_unlimited / 2)) iops bps
-test "${iops}" -lt $((iops_unlimited / 4 * (100 + TOLERANCE_PRCNT) / 100))
+test "${iops}" -le $((iops_unlimited / 4 * (100 + TOLERANCE_PRCNT) / 100))
 rbd config image remove "${POOL}/${IMAGE}" rbd_qos_iops_limit
 rbd_bench "${POOL}/${IMAGE}" read ${io_total} iops $((iops_unlimited / 2)) iops bps
-test "${iops}" -lt $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
+test "${iops}" -le $((iops_unlimited / 2 * (100 + TOLERANCE_PRCNT) / 100))
 
 rbd rm "${POOL}/${IMAGE}"