mirror of
https://git.proxmox.com/git/mirror_zfs
synced 2025-04-28 11:40:17 +00:00
ZTS: Remove procfs use from zpool_import_status
procfs might be not mounted on FreeBSD. Plus checking for specific PID might be not exactly reliable. Check for empty list of jobs instead. Premature loop exit can result in failed test and failed cleanup, failing also some following tests. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by:Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #11141
This commit is contained in:
parent
c3d2412b05
commit
0f6d955a35
@ -103,21 +103,16 @@ log_must zpool export $TESTPOOL1
|
|||||||
log_must set_tunable64 METASLAB_DEBUG_LOAD 1
|
log_must set_tunable64 METASLAB_DEBUG_LOAD 1
|
||||||
log_note "Starting zpool import in background at" $(date +'%H:%M:%S')
|
log_note "Starting zpool import in background at" $(date +'%H:%M:%S')
|
||||||
zpool import -d $DEVICE_DIR -f $guid &
|
zpool import -d $DEVICE_DIR -f $guid &
|
||||||
pid=$!
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# capture progress until import is finished
|
# capture progress until import is finished
|
||||||
#
|
#
|
||||||
log_note waiting for pid $pid to exit
|
|
||||||
kstat import_progress
|
kstat import_progress
|
||||||
while [[ -d /proc/"$pid" ]]; do
|
while [[ -n $(jobs) ]]; do
|
||||||
line=$(kstat import_progress | grep -v pool_guid)
|
line=$(kstat import_progress | grep -v pool_guid)
|
||||||
if [[ -n $line ]]; then
|
if [[ -n $line ]]; then
|
||||||
echo $line
|
echo $line
|
||||||
fi
|
fi
|
||||||
if [[ -f /$TESTPOOL1/fs/00 ]]; then
|
|
||||||
break;
|
|
||||||
fi
|
|
||||||
sleep 0.0001
|
sleep 0.0001
|
||||||
done
|
done
|
||||||
log_note "zpool import completed at" $(date +'%H:%M:%S')
|
log_note "zpool import completed at" $(date +'%H:%M:%S')
|
||||||
|
Loading…
Reference in New Issue
Block a user