Whamcloud - gitweb
LU-16804 tests: rename 'complete' to 'complete_test' 83/51383/6
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 20 Jun 2023 18:57:56 +0000 (12:57 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 28 Jun 2023 22:05:36 +0000 (22:05 +0000)
The test-framework.sh "complete" function conflicts with "complete"
exported from bash_completion, and this causes lustre-initialization
to fail in some configurations now that the lustre test config
is loaded earlier during test-framework.sh init_test_env() setup.

Rename "complete" to "complete_test" to avoid this conflict.

Test-Parameters: trivial
Fixes: fdbb2bc849 ("LU-16804 tests: load CONFIG at beginning of init_test_env")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ic72d8d5cc4a65feec6bfb2a76ac5f9b9d78e3f75
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51383
Tested-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
56 files changed:
lustre/tests/conf-sanity.sh
lustre/tests/dne_sanity.sh
lustre/tests/dom-performance.sh
lustre/tests/insanity.sh
lustre/tests/large-lun.sh
lustre/tests/large-scale.sh
lustre/tests/lfsck-performance.sh
lustre/tests/lnet-selftest.sh
lustre/tests/lustre-rsync-test.sh
lustre/tests/lutf.sh
lustre/tests/mds-survey.sh
lustre/tests/mdsrate-create-small.sh
lustre/tests/mdsrate-lookup-10dirs.sh
lustre/tests/mdsrate-lookup-1dir.sh
lustre/tests/mdsrate-stat-large.sh
lustre/tests/mdsrate-stat-small.sh
lustre/tests/mmp.sh
lustre/tests/obdfilter-survey.sh
lustre/tests/ost-pools.sh
lustre/tests/parallel-scale-cifs.sh
lustre/tests/parallel-scale-nfs.sh
lustre/tests/parallel-scale.sh
lustre/tests/performance-sanity.sh
lustre/tests/pjdfstest.sh
lustre/tests/posix.sh
lustre/tests/racer.sh
lustre/tests/recovery-double-scale.sh
lustre/tests/recovery-mds-scale.sh
lustre/tests/recovery-oss-scale.sh
lustre/tests/recovery-random-scale.sh
lustre/tests/recovery-small.sh
lustre/tests/replay-dual.sh
lustre/tests/replay-ost-single.sh
lustre/tests/replay-single-lmv.sh
lustre/tests/replay-single.sh
lustre/tests/replay-vbr.sh
lustre/tests/runtests
lustre/tests/sanity-benchmark.sh
lustre/tests/sanity-dom.sh
lustre/tests/sanity-flr.sh
lustre/tests/sanity-hsm.sh
lustre/tests/sanity-krb5.sh
lustre/tests/sanity-lfsck.sh
lustre/tests/sanity-lnet.sh
lustre/tests/sanity-lsnapshot.sh
lustre/tests/sanity-pcc.sh
lustre/tests/sanity-pfl.sh
lustre/tests/sanity-quota.sh
lustre/tests/sanity-scrub.sh
lustre/tests/sanity-sec.sh
lustre/tests/sanity-selinux.sh
lustre/tests/sanity.sh
lustre/tests/sanityn.sh
lustre/tests/scrub-performance.sh
lustre/tests/sgpdd-survey.sh
lustre/tests/test-framework.sh

index 09a9b36..e0fbaa4 100644 (file)
@@ -10665,6 +10665,6 @@ MDSSIZE=$STORED_MDSSIZE
 OSTSIZE=$STORED_OSTSIZE
 reformat
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index d41d882..407ab8c 100644 (file)
@@ -97,6 +97,6 @@ run_test sanity "Run sanity parallel on different directories at the same time"
 
 cleanup_running_directories || error "unlink running directories"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index f113506..ebcb4c9 100644 (file)
@@ -431,6 +431,6 @@ run_test compbench "Performance comparision: compilebench"
 FAIL_ON_ERROR=$SAVED_FAIL_ON_ERROR
 $LCTL set_param -n debug="$SAVED_DEBUG"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index f5813a9..434f1af 100755 (executable)
@@ -746,6 +746,6 @@ test_14() {
 }
 run_test 14 "Fourteen Failure Mode: OST0,OST1/CLIENTS/MDS0,MDS1 `date`"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 2c617a3..41a5d2c 100644 (file)
@@ -330,7 +330,7 @@ test_4 () {
 }
 run_test 4 "run llverfs on lustre filesystem"
 
-complete $SECONDS
+complete_test $SECONDS
 $LARGE_LUN_RESTORE_MOUNT && setupall
 check_and_cleanup_lustre
 exit_status
index 0eede94..2b70efc 100644 (file)
@@ -107,6 +107,6 @@ test_3a() {
 
 run_test 3a "recovery time, $CLIENTCOUNT clients"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 131ace6..b90ff63 100644 (file)
@@ -1028,6 +1028,6 @@ run_test 8 "lfsck namespace impact on create performance"
 
 # cleanup the system at last
 lfsck_cleanup
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index dd3ec2b..cb0f45b 100755 (executable)
@@ -198,7 +198,7 @@ test_smoke () {
 }
 run_test smoke "lst regression test"
 
-complete $SECONDS
+complete_test $SECONDS
 _restore_mount
 check_and_cleanup_lustre
 exit_status
index 55eed52..d06776e 100644 (file)
@@ -678,6 +678,6 @@ test_9() {
 run_test 9 "Replicate recursive directory removal"
 
 cd $ORIG_PWD
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 64f1b9a..bdc55b3 100755 (executable)
@@ -85,7 +85,7 @@ if [ -d /tmp/lutf/ ]; then
 fi
 
 
-complete $SECONDS
+complete_test $SECONDS
 
 cleanup_testsuite
 
index f879d97..cf83b44 100644 (file)
@@ -127,7 +127,7 @@ run_test 2 "Metadata survey with stripe_count = 1"
 # remount the clients
 restore_mount $MOUNT
 
-complete $SECONDS
+complete_test $SECONDS
 cleanup_echo_devs
 check_and_cleanup_lustre
 exit_status
index 0a4ef84..439b1d4 100644 (file)
@@ -166,7 +166,7 @@ else
     fi
 fi
 
-complete $SECONDS
+complete_test $SECONDS
 restore_lustre_params < $p
 rmdir $BASEDIR || true
 rm -f $MACHINEFILE
index f4c2f5c..cb63c06 100644 (file)
@@ -148,7 +148,7 @@ else
        fi
 fi
 
-complete $SECONDS
+complete_test $SECONDS
 restore_lustre_params < $p
 mdsrate_cleanup_all
 rmdir $BASEDIR || true
index e5dba3a..0b9a793 100644 (file)
@@ -134,7 +134,7 @@ else
        fi
 fi
 
-complete $SECONDS
+complete_test $SECONDS
 restore_lustre_params < $p
 mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d'
 rmdir $BASEDIR || true
index 78a4a01..5d4fb37 100644 (file)
@@ -138,7 +138,7 @@ else
 fi
 
 
-complete $SECONDS
+complete_test $SECONDS
 restore_lustre_params < $p
 mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d'
 rmdir $BASEDIR || true
index f789520..715ab3d 100644 (file)
@@ -138,7 +138,7 @@ else
        fi
 fi
 
-complete $SECONDS
+complete_test $SECONDS
 restore_lustre_params < $p
 mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d'
 rmdir $BASEDIR || true
index bcafc18..4d00ff5 100755 (executable)
@@ -670,7 +670,7 @@ run_test 10 "e2fsck with mounted filesystem"
 mmp_fini
 FAIL_ON_ERROR=$SAVED_FAIL_ON_ERROR
 
-complete $SECONDS
+complete_test $SECONDS
 $MMP_RESTORE_MOUNT && setupall
 check_and_cleanup_lustre
 exit_status
index 1abd640..d1b86dc 100644 (file)
@@ -146,7 +146,7 @@ test_3a () {
 }
 run_test 3a "Network survey"
 
-complete $SECONDS
+complete_test $SECONDS
 cleanup_echo_devs
 check_and_cleanup_lustre
 exit_status
index 95e509b..1189104 100755 (executable)
@@ -1928,7 +1928,7 @@ run_test 32 "force to create a file without pool (no inheritance)"
 
 cd $ORIG_PWD
 
-complete $SECONDS
+complete_test $SECONDS
 destroy_test_pools $FSNAME
 if ! combined_mgs_mds; then
        zconf_umount $mgs_HOST $MOUNT
index d74ac32..fcc4e34 100644 (file)
@@ -249,5 +249,5 @@ test_iozone() {
 }
 run_test iozone "iozone on cifs clients"
 
-complete $SECONDS
+complete_test $SECONDS
 exit_status
index 9b4627e..a35e6ff 100755 (executable)
@@ -137,5 +137,5 @@ test_racer_on_nfs() {
 }
 run_test racer_on_nfs "racer on NFS client"
 
-complete $SECONDS
+complete_test $SECONDS
 exit_status
index 28da3f2..f126748 100644 (file)
@@ -183,6 +183,6 @@ run_test xdd "xdd"
 [ "$mds1_FSTYPE" = zfs -o "$ost1_FSTYPE" = zfs ] &&
        SLOW=$ZFSSLOW
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 55521cc..901c2a6 100644 (file)
@@ -66,7 +66,7 @@ test_8() {
 }
 run_test 8 "getattr large files ======"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 [ -f "$LOG" ] && cat $LOG || true
 exit_status
index 39b4c0f..b32550f 100644 (file)
@@ -160,7 +160,7 @@ SUBTEST
 done
 
 cat << 'TAIL'
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
 TAIL
index 0b8ba61..42043a8 100755 (executable)
@@ -140,6 +140,6 @@ test_1() {
 }
 run_test 1 "install, build, run posix on $BASELINE_FS and lustre, then compare"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 6ed1849..a0cd2e0 100644 (file)
@@ -206,6 +206,6 @@ test_1() {
 }
 run_test 1 "racer on clients: ${CLIENTS:-$(hostname)} DURATION=$DURATION"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 6f31c54..021431d 100644 (file)
@@ -303,6 +303,6 @@ run_test pairwise_fail "pairwise combination of clients, MDS, and OST failures"
 zconf_mount $HOSTNAME $MOUNT || error "mount $MOUNT on $HOSTNAME failed"
 client_up || error "start client on $HOSTNAME failed"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 5172891..fdda222 100644 (file)
@@ -59,6 +59,6 @@ run_test failover_mds "failover MDS"
 zconf_mount $HOSTNAME $MOUNT || error "mount $MOUNT on $HOSTNAME failed"
 client_up || error "start client on $HOSTNAME failed"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 896bf56..7a4c137 100644 (file)
@@ -59,6 +59,6 @@ run_test failover_ost "failover OST"
 zconf_mount $HOSTNAME $MOUNT || error "mount $MOUNT on $HOSTNAME failed"
 client_up || error "start client on $HOSTNAME failed"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 913e0a8..8bdd6d8 100644 (file)
@@ -207,6 +207,6 @@ run_test fail_client_mds "fail client, then failover MDS"
 zconf_mount $HOSTNAME $MOUNT || error "mount $MOUNT on $HOSTNAME failed"
 client_up || error "start client on $HOSTNAME failed"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 541b2c1..417eb3c 100755 (executable)
@@ -3480,6 +3480,6 @@ test_154() {
 }
 run_test 154 "corruption update llog can be skipped"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index a3c15d4..3202973 100755 (executable)
@@ -75,7 +75,7 @@ run_test 0a "expired recovery with lost client"
 if [ -f "$LU482_FAILED" ]; then
        log "Found check file $LU482_FAILED, aborting test script"
        rm -vf "$LU482_FAILED"
-       complete $SECONDS
+       complete_test $SECONDS
        do_nodes $CLIENTS umount -f $MOUNT2 || true
        do_nodes $CLIENTS umount -f $MOUNT || true
        # copied from stopall, but avoid the MDS recovery
@@ -1286,7 +1286,7 @@ test_33() { # LU-15935
 }
 run_test 33 "Check for OBD_INCOMPAT_MULTI_RPCS in last_rcvd after abort_recovery"
 
-complete $SECONDS
+complete_test $SECONDS
 SLEEP=$((SECONDS - $NOW))
 [ $SLEEP -lt $TIMEOUT ] && sleep $SLEEP
 [ "$MOUNTED2" = yes ] && zconf_umount $HOSTNAME $MOUNT2 || true
index 6d107f3..7bd3ca1 100755 (executable)
@@ -498,6 +498,6 @@ test_12b() {
 }
 run_test 12b "write after OST failover to a missing object"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 3a97a21..8c9113a 100755 (executable)
@@ -102,6 +102,6 @@ test_3b() {
 }
 run_test 3b "mkdir cross-node dir (fail mds with inode)"
 
-complete $SECONDS
+complete_test $SECONDS
 $CLEANUP
 
index 5f469ed..0c1bb11 100755 (executable)
@@ -5142,6 +5142,6 @@ test_200() {
 }
 run_test 200 "Dropping one OBD_PING should not cause disconnect"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 85f92d5..7508f05 100755 (executable)
@@ -1207,6 +1207,6 @@ rm -f $cos_param_file
 
 [ "$CLIENTS" ] && zconf_mount_clients $CLIENTS $DIR
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 8c9d7ab..3809d26 100755 (executable)
@@ -148,6 +148,6 @@ test_1() {
 }
 run_test 1 "All Runtests"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 532576c..891c327 100644 (file)
@@ -224,6 +224,6 @@ test_fsx_partial_punch() {
 }
 run_test fsx_partial_punch "Verify fsx with partial punch via fallocate"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index ad139f1..3666ef1 100644 (file)
@@ -218,7 +218,7 @@ test_sanityn()
 }
 run_test sanityn "Run sanityn with Data-on-MDT files"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 declare -a logs=($ONLY)
 logs=("${logs[@]/#/$TMP/}")
index 3595ad3..bf23908 100644 (file)
@@ -4266,6 +4266,6 @@ test_208b() {
 }
 run_test 208b "mirror selection to prefer non-rotational devices for writes"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 1d94f34..fd1b2e0 100755 (executable)
@@ -5778,6 +5778,6 @@ test_606() {
 }
 run_test 606 "llog_reader groks changelog fields"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 2a94170..94b8fab 100755 (executable)
@@ -735,7 +735,7 @@ test_151() {
 }
 run_test 151 "secure mgs connection: server flavor control"
 
-complete $SECONDS
+complete_test $SECONDS
 set_flavor_all null
 cleanup_gss
 check_and_cleanup_lustre
index ecdffae..4c1e25a 100644 (file)
@@ -6194,6 +6194,6 @@ OSTCOUNT=${SAVED_OSTCOUNT}
 # cleanup the system at last
 REFORMAT="yes" cleanup_and_setup_lustre
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index cb3cad6..acaf44b 100755 (executable)
@@ -3718,7 +3718,6 @@ test_402() {
 }
 run_test 402 "Destination net rule should not panic"
 
-complete $SECONDS
-
+complete_test $SECONDS
 cleanup_testsuite
 exit_status
index 233c9aa..8aa21c1 100755 (executable)
@@ -375,6 +375,6 @@ run_test 4 "create/delete snapshot after MGS remount"
 lss_cleanup
 do_facet mgs $LCTL set_param debug=-snapshot
 do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param debug=-snapshot
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 6b9e74d..9db48e1 100644 (file)
@@ -1656,6 +1656,6 @@ test_102() {
 }
 run_test 102 "PCC-RO should not hange for io_uring I/O engine"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 9b2e1bd..fdfff0f 100644 (file)
@@ -2539,6 +2539,6 @@ test_27() {
 }
 run_test 27 "overstriping with -C -1 in mdt_dump_lmm"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 9b36adb..874cc72 100755 (executable)
@@ -5960,7 +5960,7 @@ reset_quota_settings
 quota_fini
 
 cd $ORIG_PWD
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 export QUOTA_AUTO=$QUOTA_AUTO_OLD
 exit_status
index b5f8f88..7702a16 100644 (file)
@@ -1463,6 +1463,6 @@ OSTCOUNT=${SAVED_OSTCOUNT}
 # cleanup the system at last
 REFORMAT="yes" cleanup_and_setup_lustre
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 062e5b7..eb41d3f 100755 (executable)
@@ -5845,6 +5845,6 @@ sec_unsetup() {
 }
 sec_unsetup
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 34680ac..bf882f8 100755 (executable)
@@ -850,6 +850,6 @@ test_21b() {
 }
 run_test 21b "Send sepol for metadata ops"
 
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index cbb0b6e..fc98d5a 100755 (executable)
@@ -30221,7 +30221,7 @@ test_906() {
 }
 run_test 906 "Simple test for io_uring I/O engine via fio"
 
-complete $SECONDS
+complete_test $SECONDS
 [ -f $EXT2_DEV ] && rm $EXT2_DEV || true
 check_and_cleanup_lustre
 if [ "$I_MOUNTED" != "yes" ]; then
index e8f5841..71c3009 100755 (executable)
@@ -6285,7 +6285,7 @@ log "cleanup: ======================================================"
 [ "$(mount | grep $MOUNT2)" ] && wait_update $HOSTNAME "fuser -m $MOUNT2" "" ||
        true
 
-complete $SECONDS
+complete_test $SECONDS
 rm -f $SAMPLE_FILE
 check_and_cleanup_lustre
 exit_status
index 75f521c..7512f38 100644 (file)
@@ -183,6 +183,6 @@ run_test 0 "OI scrub performance test"
 
 # cleanup the system at last
 scrub_cleanup
-complete $SECONDS
+complete_test $SECONDS
 check_and_cleanup_lustre
 exit_status
index 0cdc0ca..19c3e6b 100644 (file)
@@ -76,5 +76,5 @@ test_2 () {
 }
 run_test 2 "sgpdd-survey, osts, scsidevs"
 
-complete $SECONDS
+complete_test $SECONDS
 exit_status
index 98f495b..a43370f 100755 (executable)
@@ -6893,12 +6893,12 @@ trace() {
        return 1
 }
 
-complete () {
+complete_test() {
        local duration=$1
 
-       banner test complete, duration $duration sec
+       banner "test complete, duration $duration sec"
        [ -f "$TESTSUITELOG" ] && egrep .FAIL $TESTSUITELOG || true
-       echo duration $duration >>$TESTSUITELOG
+       echo "duration $duration" >>$TESTSUITELOG
 }
 
 pass() {