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
This commit is contained in:
наб
2022-03-11 23:54:08 +01:00
committed by Brian Behlendorf
parent 72f3516094
commit 75746e9a40
132 changed files with 402 additions and 762 deletions
+4 -4
View File
@@ -15,7 +15,7 @@ function test_zpool_script {
out="$($wholecmd)"
# Default number of columns that get printed without -c
if echo "$cmd" | grep -q iostat ; then
if [ "$cmd" != "${cmd/iostat/_/}" ]; then
# iostat
dcols=7
else
@@ -39,9 +39,9 @@ function test_zpool_script {
# zpool iostat -v output is 7 columns, so if the script ran correctly
# we should see more than that.
if ! newcols=$(echo "$out" | \
awk '/\/dev/{print NF-'$dcols'; if (NF <= '$dcols') {exit 1}}' | \
head -n 1) ; \
then
awk '/\/dev/ {print NF-'$dcols'; if (NF <= '$dcols') {exit 1}}' | \
head -n 1)
then
log_fail "'$wholecmd' didn't create a new column value"
else
log_note "'$wholecmd' passed ($newcols new columns)"