From 0f6d955a3585107fa6bb7884fa9a32a57067f918 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Wed, 25 Dec 2024 14:00:38 -0500 Subject: [PATCH] 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 Reviewed-by: Tony Hutter Reviewed-by: Tino Reichardt Signed-off-by:Alexander Motin Sponsored by: iXsystems, Inc. Closes #11141 --- .../cli_root/zpool_import/zpool_import_status.ksh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh index c96961bf6..679362bbe 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh @@ -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')