diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh b/tests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh index 4ea5e3db38..c49b19c6c3 100755 --- a/tests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh @@ -53,7 +53,6 @@ verify_runnable "global" function cleanup { - PIDS="" rm -f $OLDDIR/* >/dev/null 2>&1 rm -f $NEWDIR_IN_FS/* >/dev/null 2>&1 } diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh b/tests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh index 283770d4a4..fdadac32d5 100755 --- a/tests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh @@ -54,7 +54,6 @@ verify_runnable "global" function cleanup { - PIDS="" rm -f $OLDDIR/* >/dev/null 2>&1 rm -f $NEWDIR_ACROSS_FS/* >/dev/null 2>&1 } diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib b/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib index a64aa68066..4794d8ae94 100644 --- a/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib +++ b/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib @@ -30,55 +30,6 @@ . $STF_SUITE/tests/functional/mv_files/mv_files.cfg -# -# Determine whether this version of the ksh being -# executed has a bug where the limit of background -# processes of 25. -# -function check_bg_procs_limit_num -{ -echo "#!/bin/ksh" > $TEST_BASE_DIR/exitsZero.ksh -echo "exit 0" >> $TEST_BASE_DIR/exitsZero.ksh -chmod 777 $TEST_BASE_DIR/exitsZero.ksh - -cat < $TEST_BASE_DIR/testbackgprocs.ksh -#!/bin/ksh -# -# exitsZero.ksh is a one line script -# that exit with status of "0" -# - -PIDS="" -typeset -i i=1 -while [ \$i -le 50 ] -do - $TEST_BASE_DIR/exitsZero.ksh & - PIDS="\$PIDS \$!" - (( i = i + 1 )) -done - -sleep 1 - -for pid in \$PIDS -do - wait \$pid - (( \$? == 127 )) && exit 1 -done -exit 0 -EOF - -ksh $TEST_BASE_DIR/testbackgprocs.ksh -if [[ $? -eq 1 ]]; then -# -# Current ksh being executed has a limit -# of 25 background processes. -# - return 1 -else - return 0 -fi -} - function init_setup { diff --git a/tests/zfs-tests/tests/functional/mv_files/setup.ksh b/tests/zfs-tests/tests/functional/mv_files/setup.ksh index e4e97b16d5..d459c51e4e 100755 --- a/tests/zfs-tests/tests/functional/mv_files/setup.ksh +++ b/tests/zfs-tests/tests/functional/mv_files/setup.ksh @@ -34,13 +34,25 @@ verify_runnable "global" -check_bg_procs_limit_num -if [[ $? -ne 0 ]]; then - log_note "ksh background process limit number is 25" - export GANGPIDS=25 -fi +# +# Determine whether this version of the ksh being +# executed has a bug where the limit of background +# processes of 25. +# +( + pids= + for _ in $(seq 50); do + : & + pids="$pids $!" + done -export PIDS="" + for pid in $pids; do + wait $pid || exit + done +) || { + log_note "ksh background process limit number is 25" + GANGPIDS=25 +} init_setup $DISK