k3s/scripts/sonobuoy-e2e-tests
2019-07-04 08:07:26 -07:00

48 lines
899 B
Bash
Executable File

#!/bin/bash
set -e -x
cd $(dirname $0)/..
cleanup() {
exit_code=$?
set +e
wait
echo "Finished the tests!"
exit ${exit_code}
}
trap cleanup EXIT
if [ -z "$K3S_IMAGE" ]; then
source $(dirname $0)/version.sh
TAG=${TAG:-${VERSION}${SUFFIX}}
REPO=${REPO:-rancher}
IMAGE_NAME=${IMAGE_NAME:-k3s}
export K3S_IMAGE=${REPO}/${IMAGE_NAME}:${TAG}
fi
OUTPUT=$(pwd)/dist/artifacts
mkdir -p ${OUTPUT}
pids=()
output=()
run-sonobuoy() {
output+=(${log_output})
E2E_LOG_OUTPUT=${log_output} ./scripts/sonobuoy ${@} &
pids+=($!)
}
log_output=${OUTPUT}/e2e-STATUS-${ARCH}-parallel.log \
run-sonobuoy --e2e-focus='\[Conformance\]' --e2e-skip='\[Serial\]' --e2e-parallel=y
sleep 60
log_output=${OUTPUT}/e2e-STATUS-${ARCH}-serial.log \
run-sonobuoy --e2e-focus='\[Serial\].*\[Conformance\]'
for pid in "${pids[@]}"; do
wait $pid || exit $?
done