aboutsummaryrefslogtreecommitdiff
path: root/tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2022-03-11 22:54:08 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2022-04-02 00:57:55 +0000
commit75746e9a40e15e7994fb99799f0b02912155f179 (patch)
tree22847835880445548c6066b9dbdbff4e6208fa48 /tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh
parent72f3516094cd772053c4367cb8549fd697a6c107 (diff)
downloadsrc-75746e9a40e15e7994fb99799f0b02912155f179.tar.gz
src-75746e9a40e15e7994fb99799f0b02912155f179.zip
tests: review every awk(1) invocation
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13259
Diffstat (limited to 'tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh')
-rwxr-xr-xtests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh b/tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh
index 615b41f312b6..c9cefcd43dae 100755
--- a/tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh
@@ -85,7 +85,7 @@ log_must zpool import $TESTPOOL
log_must zpool scrub $TESTPOOL
log_must wait_scrubbed $TESTPOOL
-cksum=$(zpool status -P -v $TESTPOOL | grep "$firstvdev" | awk '{print $5}')
+cksum=$(zpool status -P -v $TESTPOOL | awk -v v="$firstvdev" '$0 ~ v {print $5}')
log_assert "Normal file write test saw $cksum checksum errors"
log_must [ $cksum -eq 0 ]
@@ -105,8 +105,7 @@ while [[ $j -lt ${#CHECKSUM_TYPES[*]} ]]; do
log_must zpool scrub $TESTPOOL
log_must wait_scrubbed $TESTPOOL
- cksum=$(zpool status -P -v $TESTPOOL | grep "$firstvdev" | \
- awk '{print $5}')
+ cksum=$(zpool status -P -v $TESTPOOL | awk -v v="$firstvdev" '$0 ~ v {print $5}')
log_assert "Checksum '$type' caught $cksum checksum errors"
log_must [ $cksum -ne 0 ]