Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions test/bin/ci_phase_test.sh
Original file line number Diff line number Diff line change
@@ -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