k3s/scripts/sonobuoy-e2e-tests
2019-07-01 13:50:32 -07:00

49 lines
938 B
Bash
Executable File

#!/bin/bash
set -e -x
cd $(dirname $0)/..
cleanup() {
exit_code=$?
set +e
echo "Waiting on the tests!"
wait
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}-serial.log \
run-sonobuoy --e2e-focus='\[Serial\].*\[Conformance\]'
log_output=${OUTPUT}/e2e-STATUS-${ARCH}-parallel.log \
run-sonobuoy --e2e-focus='\[Conformance\]' --e2e-skip='\[Serial\]' --e2e-parallel=y
exit_code=0
for pid in "${pids[@]}"; do
wait $pid || exit_code=$?
done
trap - EXIT
exit ${exit_code}