mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
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:
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user