mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
tests: review every instance of $?
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:
@@ -142,10 +142,7 @@ for op in "" "-f"; do
|
||||
|
||||
attach_test "$opt" $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE
|
||||
|
||||
zpool iostat -v $TESTPOOL1 | grep "$REPLACEFILE"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
log_fail "$REPLACEFILE is not present."
|
||||
fi
|
||||
log_must eval "zpool iostat -v $TESTPOOL1 | grep \"$REPLACEFILE\""
|
||||
|
||||
destroy_pool $TESTPOOL1
|
||||
done
|
||||
@@ -161,10 +158,7 @@ for type in "" "raidz" "raidz1" "draid" "draid1"; do
|
||||
log_mustnot zpool attach -s "$opt" $TESTDIR/$TESTFILE1.1 \
|
||||
$TESTDIR/$REPLACEFILE
|
||||
|
||||
zpool iostat -v $TESTPOOL1 | grep "$REPLACEFILE"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
log_fail "$REPLACEFILE should not be present."
|
||||
fi
|
||||
log_mustnot eval "zpool iostat -v $TESTPOOL1 | grep \"$REPLACEFILE\""
|
||||
|
||||
destroy_pool $TESTPOOL1
|
||||
done
|
||||
|
||||
@@ -141,10 +141,7 @@ for op in "" "-f"; do
|
||||
|
||||
attach_test "$opt" $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE
|
||||
|
||||
zpool iostat -v $TESTPOOL1 | grep "$REPLACEFILE"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
log_fail "$REPLACEFILE is not present."
|
||||
fi
|
||||
log_must eval "zpool iostat -v $TESTPOOL1 | grep \"$REPLACEFILE\""
|
||||
|
||||
destroy_pool $TESTPOOL1
|
||||
done
|
||||
@@ -160,10 +157,7 @@ for type in "" "raidz" "raidz1" "draid"; do
|
||||
log_mustnot zpool attach "$opt" $TESTDIR/$TESTFILE1.1 \
|
||||
$TESTDIR/$REPLACEFILE
|
||||
|
||||
zpool iostat -v $TESTPOOL1 | grep "$REPLACEFILE"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
log_fail "$REPLACEFILE should not be present."
|
||||
fi
|
||||
log_mustnot eval "zpool iostat -v $TESTPOOL1 | grep \"$REPLACEFILE\""
|
||||
|
||||
destroy_pool $TESTPOOL1
|
||||
done
|
||||
|
||||
@@ -134,10 +134,7 @@ log_must zfs set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
|
||||
|
||||
detach_test $TESTDIR/$TESTFILE1.1
|
||||
|
||||
zpool iostat -v $TESTPOOL1 | grep "$TESTFILE1.1"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
log_fail "$TESTFILE1.1 should no longer be present."
|
||||
fi
|
||||
log_mustnot eval "zpool iostat -v $TESTPOOL1 | grep \"$TESTFILE1.1\""
|
||||
|
||||
destroy_pool $TESTPOOL1
|
||||
|
||||
@@ -150,10 +147,7 @@ for type in "" "raidz" "raidz1" "draid"; do
|
||||
|
||||
log_mustnot zpool detach $TESTDIR/$TESTFILE1.1
|
||||
|
||||
zpool iostat -v $TESTPOOL1 | grep "$TESTFILE1.1"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
log_fail "$TESTFILE1.1 is not present."
|
||||
fi
|
||||
log_must eval "zpool iostat -v $TESTPOOL1 | grep \"$TESTFILE1.1\""
|
||||
|
||||
destroy_pool $TESTPOOL1
|
||||
done
|
||||
|
||||
@@ -145,10 +145,7 @@ for type in "" "mirror" "draid"; do
|
||||
|
||||
replace_test "$opt" $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE
|
||||
|
||||
zpool iostat -v $TESTPOOL1 | grep "$REPLACEFILE"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
log_fail "$REPLACEFILE is not present."
|
||||
fi
|
||||
log_must eval "zpool iostat -v $TESTPOOL1 | grep \"$REPLACEFILE\""
|
||||
|
||||
destroy_pool $TESTPOOL1
|
||||
log_must rm -rf /$TESTPOOL1
|
||||
|
||||
@@ -142,10 +142,7 @@ for type in "" "raidz" "mirror" "draid"; do
|
||||
|
||||
replace_test "$opt" $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE
|
||||
|
||||
zpool iostat -v $TESTPOOL1 | grep "$REPLACEFILE"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
log_fail "$REPLACEFILE is not present."
|
||||
fi
|
||||
log_must eval "zpool iostat -v $TESTPOOL1 | grep \"$REPLACEFILE\""
|
||||
|
||||
destroy_pool $TESTPOOL1
|
||||
log_must rm -rf /$TESTPOOL1
|
||||
|
||||
Reference in New Issue
Block a user