-print_summary () {
- trap 0
- local form="%-13s %-17s %s\n"
- printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
- echo "------------------------------------------------------------------------------------"
- echo "Done!"
-}
-
-
-setup_if_needed() {
- nfs_client_mode && return
- auster_cleanup=false
-
- local MOUNTED=$(mounted_lustre_filesystems)
- if $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
- check_config_clients $MOUNT
- # init_facets_vars
- # init_param_vars
- return
- fi
-
- echo "Lustre is not mounted, trying to do setup ... "
- $reformat && formatall
- setupall
-
- MOUNTED=$(mounted_lustre_filesystems)
- if ! $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
- echo "Lustre is not mounted after setup! "
- exit 1
- fi
- auster_cleanup=true
-}
-
-cleanup_if_needed() {
- if $auster_cleanup; then
- cleanupall
- fi
-}
-
-find_script_in_path() {
- target=$1
- path=$2
- for dir in $(tr : " " <<< $path); do
- if [ -f $dir/$target ]; then
- echo $dir/$target
- return 0
- fi
- if [ -f $dir/$target.sh ]; then
- echo $dir/$target.sh
- return 0
- fi
- done
- return 1
-}
-
-title() {
- log "-----============= acceptance-small: "$*" ============----- `date`"
-}
-
-doit() {
- if $dry_run; then
- printf "Would have run: %s\n" "$*"
- return 0
- fi
- if $verbose; then
- printf "Running: %s\n" "$*"
- fi
- "$@"
-}
-
-
-run_suite() {
- local suite_name=$1
- local suite_script=$2
- title $suite_name
- log_test $suite_name
-
- rm -f $TF_FAIL
- touch $TF_SKIP
- local start_ts=$(date +%s)
- doit bash $suite_script
- local rc=$?
- local duration=$(($(date +%s) - $start_ts))
-
- local status="PASS"
- if [[ $rc -ne 0 || -f $TF_FAIL ]]; then
- status="FAIL"
- elif [[ -f $TF_SKIP ]]; then
- status="SKIP"
- fi
- log_test_status $duration $status
- [[ ! -f $TF_SKIP ]] || rm -f $TF_SKIP
-
- reset_lustre
-}
-
-run_suite_logged() {
- local suite_name=${1%.sh}
- local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
-
- suite_script=$(find_script_in_path $suite_name $LUSTRE/tests)
-
- if [[ -z $suite_script ]]; then
- echo "Can't find test script for $suite_name"
- return 1
- fi
-
- echo "run_suite $suite_name $suite_script"
- local log_name=${suite_name}.suite_log.$(hostname -s).log
- if $verbose; then
- run_suite $suite_name $suite_script 2>&1 |tee $LOGDIR/$log_name
- else
- run_suite $suite_name $suite_script > $LOGDIR/$log_name 2>&1
- fi
-
-}
-
-#
-# Add this to test-framework somewhere.
-reset_logging() {
- export LOGDIR=$1
- unset YAML_LOG
- init_logging
-}
-
-split_commas() {
- echo "${*//,/ }"
-}
+# Set CLIENTONLY, while trying to discover some common
+# variables so the test runner doesn't need do this
+# manually
+if $client_tests_only; then
+ export CLIENTONLY=true;
+ export FSTYPE=${FSTYPE:-ldiskfs};
+ export MDSCOUNT="$(( $($LFS mdts | wc -l) - 1 ))"
+ export OSTCOUNT="$(( $($LFS osts | wc -l) - 1 ))"
+fi