Skip to content

Commit b66d910

Browse files
amotinbehlendorf
authored andcommitted
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 <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Signed-off-by:Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #11141
1 parent 8bf1e83 commit b66d910

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,16 @@ log_must zpool export $TESTPOOL1
103103
log_must set_tunable64 METASLAB_DEBUG_LOAD 1
104104
log_note "Starting zpool import in background at" $(date +'%H:%M:%S')
105105
zpool import -d $DEVICE_DIR -f $guid &
106-
pid=$!
107106

108107
#
109108
# capture progress until import is finished
110109
#
111-
log_note waiting for pid $pid to exit
112110
kstat import_progress
113-
while [[ -d /proc/"$pid" ]]; do
111+
while [[ -n $(jobs) ]]; do
114112
line=$(kstat import_progress | grep -v pool_guid)
115113
if [[ -n $line ]]; then
116114
echo $line
117115
fi
118-
if [[ -f /$TESTPOOL1/fs/00 ]]; then
119-
break;
120-
fi
121116
sleep 0.0001
122117
done
123118
log_note "zpool import completed at" $(date +'%H:%M:%S')

0 commit comments

Comments
 (0)