From 1e2a31ffb38cc585cf05c4aebf633171a332de2e Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 3 Jul 2023 14:13:19 -0400 Subject: [PATCH] USHIFT-1387: add scenario test run script --- test/bin/ci_phase_test.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 test/bin/ci_phase_test.sh diff --git a/test/bin/ci_phase_test.sh b/test/bin/ci_phase_test.sh new file mode 100755 index 0000000000..f5373fa89c --- /dev/null +++ b/test/bin/ci_phase_test.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# This script runs on the CI cluster, from the metal-tests step. + +set -xeuo pipefail + +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SCRIPTDIR}/common.sh" + +cd "${TESTDIR}" + +for scenario in ./scenarios/*.sh; do + scenario_name="$(basename "${scenario}" .sh)" + logfile="${SCENARIO_INFO_DIR}/${scenario_name}/run.log" + mkdir -p "$(dirname "${logfile}")" + bash -x ./bin/scenario.sh run "${scenario}" >"${logfile}" 2>&1 & +done + +FAIL=0 +for job in $(jobs -p) ; do + jobs -l + echo "Waiting for job: ${job}" + wait "${job}" || ((FAIL+=1)) +done + +echo "Test phase complete" +if [[ ${FAIL} -ne 0 ]]; then + exit 1 +fi