Skip to content

Commit

Permalink
ZTS: Remove procfs use from zpool_import_status
Browse files Browse the repository at this point in the history
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.

Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
  • Loading branch information
amotin committed Dec 26, 2024
1 parent 87024b6 commit 4f02ad6
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,16 @@ log_must zpool export $TESTPOOL1
log_must set_tunable64 METASLAB_DEBUG_LOAD 1
log_note "Starting zpool import in background at" $(date +'%H:%M:%S')
zpool import -d $DEVICE_DIR -f $guid &
pid=$!

#
# capture progress until import is finished
#
log_note waiting for pid $pid to exit
kstat import_progress
while [[ -d /proc/"$pid" ]]; do
while [[ -n $(jobs) ]]; do
line=$(kstat import_progress | grep -v pool_guid)
if [[ -n $line ]]; then
echo $line
fi
if [[ -f /$TESTPOOL1/fs/00 ]]; then
break;
fi
sleep 0.0001
done
log_note "zpool import completed at" $(date +'%H:%M:%S')
Expand Down

0 comments on commit 4f02ad6

Please sign in to comment.