mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-26 20:22:14 +03:00
tests: don't >-redirect without eval
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:
@@ -49,7 +49,7 @@ function cleanup
|
||||
# Remove dump device.
|
||||
#
|
||||
if [[ -n $PREVDUMPDEV ]]; then
|
||||
log_must dumpadm -u -d $PREVDUMPDEV > /dev/null
|
||||
log_must eval "dumpadm -u -d $PREVDUMPDEV > /dev/null"
|
||||
fi
|
||||
|
||||
destroy_pool $TESTPOOL
|
||||
@@ -61,16 +61,16 @@ log_onexit cleanup
|
||||
|
||||
typeset dumpdev=""
|
||||
|
||||
PREVDUMPDEV=`dumpadm | grep "Dump device" | awk '{print $3}'`
|
||||
PREVDUMPDEV=`dumpadm | awk '/Dump device/ {print $3}'`
|
||||
|
||||
log_note "Zero $FS_DISK0"
|
||||
log_must cleanup_devices $FS_DISK0
|
||||
|
||||
log_note "Configuring $rawdisk0 as dump device"
|
||||
log_must dumpadm -d $rawdisk0 > /dev/null
|
||||
log_must eval "dumpadm -d $rawdisk0 > /dev/null"
|
||||
|
||||
log_note "Confirm that dump device has been setup"
|
||||
dumpdev=`dumpadm | grep "Dump device" | awk '{print $3}'`
|
||||
dumpdev=`dumpadm | awk '/Dump device/ {print $3}'`
|
||||
[[ -z "$dumpdev" ]] && log_untested "No dump device has been configured"
|
||||
|
||||
[[ "$dumpdev" != "$rawdisk0" ]] && \
|
||||
|
||||
@@ -58,25 +58,21 @@ function cleanup
|
||||
|
||||
log_note "Kill off ufsdump process if still running"
|
||||
kill -0 $PIDUFSDUMP > /dev/null 2>&1 && \
|
||||
log_must kill -9 $PIDUFSDUMP > /dev/null 2>&1
|
||||
log_must eval "kill -9 $PIDUFSDUMP"
|
||||
#
|
||||
# Note: It would appear that ufsdump spawns a number of processes
|
||||
# which are not killed when the $PIDUFSDUMP is whacked. So best bet
|
||||
# is to find the rest of the them and deal with them individually.
|
||||
#
|
||||
for all in `pgrep ufsdump`
|
||||
do
|
||||
kill -9 $all > /dev/null 2>&1
|
||||
done
|
||||
kill -9 `pgrep ufsdump` > /dev/null 2>&1
|
||||
|
||||
log_note "Kill off ufsrestore process if still running"
|
||||
kill -0 $PIDUFSRESTORE > /dev/null 2>&1 && \
|
||||
log_must kill -9 $PIDUFSRESTORE > /dev/null 2>&1
|
||||
log_must eval "kill -9 $PIDUFSRESTORE"
|
||||
|
||||
ismounted $UFSMP ufs && log_must umount $UFSMP
|
||||
|
||||
rm -rf $UFSMP
|
||||
rm -rf $TESTDIR
|
||||
rm -rf $UFSMP $TESTDIR
|
||||
|
||||
#
|
||||
# Tidy up the disks we used.
|
||||
|
||||
Reference in New Issue
Block a user