From 1948f6dbbfc3cd77781c576ba129ac886d73eaac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Tue, 15 Mar 2022 01:54:10 +0100 Subject: [PATCH] tests: echo-with-arguments review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Reviewed-by: John Kennedy Reviewed-by: Ryan Moeller Signed-off-by: Ahelenia ZiemiaƄska Closes #13259 --- .../tests/functional/rsend/rsend_012_pos.ksh | 2 +- tests/zfs-tests/tests/functional/trim/trim.kshlib | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh index 48d70ec2d6..0608598b83 100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh @@ -162,5 +162,5 @@ while ((i < ${#pair[@]})); do ((i += 2)) done -log_pass "Verify zfs send -R will backup all the filesystem properties " \ +log_pass "Verify zfs send -R will backup all the filesystem properties" \ "correctly." diff --git a/tests/zfs-tests/tests/functional/trim/trim.kshlib b/tests/zfs-tests/tests/functional/trim/trim.kshlib index fad15582b1..f36f3870fc 100644 --- a/tests/zfs-tests/tests/functional/trim/trim.kshlib +++ b/tests/zfs-tests/tests/functional/trim/trim.kshlib @@ -22,7 +22,7 @@ # function get_size_mb { - du --block-size 1048576 -s "$1" | awk '{printf("%s", $1)}' + du --block-size 1048576 -s "$1" | cut -f1 } # @@ -38,14 +38,12 @@ function get_trim_io # Sum the ind or agg columns of the trim request size histogram. case "$type" in "ind") - rval=$(zpool iostat -pr $pool $vdev | awk \ - '$1 ~ /[0-9].*/ { sum += $12 } END { print sum }') - echo -n "$rval" + zpool iostat -pr $pool $vdev | + awk '$1 ~ /[0-9].*/ { sum += $12 } END { print sum }' ;; "agg") - rval=$(zpool iostat -pr $pool $vdev | awk \ - '$1 ~ /[0-9].*/ { sum += $13 } END { print sum }') - echo -n "$rval" + zpool iostat -pr $pool $vdev | + awk '$1 ~ /[0-9].*/ { sum += $13 } END { print sum }' ;; *) log_fail "Type must be 'ind' or 'agg'"