summaryrefslogtreecommitdiffstats
path: root/tester/run
diff options
context:
space:
mode:
Diffstat (limited to 'tester/run')
-rwxr-xr-xtester/run15
1 files changed, 11 insertions, 4 deletions
diff --git a/tester/run b/tester/run
index d892a7c..896375a 100755
--- a/tester/run
+++ b/tester/run
@@ -28,6 +28,12 @@ export DTF_TASKS=${DTF_TASKS-$srcdir/tasks}
export DTF_RESULTDIR=${DTF_RESULTDIR-/var/tmp/dtf}
export DTF_RESULTS_YML=${DTF_RESULTDIR}/result.yml
+__result_yml_print()
+{
+ test "$dtf_option_listonly" -eq 0 && \
+ echo 2>/dev/null "$1" >> "$DTF_RESULTS_YML"
+}
+
# when exists per-testsuite config.sh, source it here
test -r "$srcdir/config.sh" && . "$srcdir/config.sh"
@@ -50,7 +56,7 @@ info()
die()
{
echo "$@" >&2
- echo 2>/dev/null "exit_status: 2" >> "$DTF_RESULTS_YML"
+ __result_yml_print "exit_status: 2"
exit 2
}
@@ -94,7 +100,6 @@ run_test()
result_dir="$DTF_RESULTDIR/tasks/$DTF_TEST_ID"
- mkdir -p "$result_dir" || exit
outlog="$result_dir/run.log"
output_wrapper="cat > $outlog"
@@ -111,6 +116,8 @@ run_test()
|| exit $DTF_RESULT_TS_SKIP
fi
+ mkdir -p "$result_dir" || exit $DTF_RESULT_TS_CONFIG
+
printf "%-40s" "RUN $DTF_TEST_ID ..."
set -o pipefail
@@ -205,8 +212,8 @@ done
test $dtf_option_listonly -ne 1 && prepare_resultdir
+__result_yml_print "$(date -u "+date: \"%Y%m%d_%H%M%S_UTC\"")"
-date -u "+date: \"%Y%m%d_%H%M%S_UTC\"" > "$DTF_RESULTS_YML"
result=0
while read i; do
testdir=$(dirname "$i")
@@ -233,6 +240,6 @@ while read i; do
esac
done <<<"$(find "$DTF_TASKS" -name runtest.sh)"
-echo "exit_status: $result" >> "$DTF_RESULTS_YML"
+__result_yml_print "exit_status: $result"
exit $result