k3s/tests/integration/test-runner.sh
Derek Nola 60297a1bbe
Creation of K3s integration test Sonobuoy plugin (#3931)
* Added test runner and build files
* Changes to int test to output junit results.
* Updated documentation, removed comments

Signed-off-by: dereknola <derek.nola@suse.com>
2021-08-30 08:27:59 -07:00

30 lines
741 B
Bash
Executable File

#!/bin/sh
set -x
results_dir="${RESULTS_DIR:-/tmp/results}"
# saveResults prepares the results for handoff to the Sonobuoy worker.
# See: https://github.com/vmware-tanzu/sonobuoy/blob/master/site/content/docs/master/plugins.md
saveResults() {
cd ${results_dir}
# Sonobuoy worker expects a tar file.
tar czf results.tar.gz *
# Signal to the worker that we are done and where to find the results.
printf ${results_dir}/results.tar.gz > ${results_dir}/done
}
# Ensure that we tell the Sonobuoy worker we are done regardless of results.
trap saveResults EXIT
runTests() {
cd ./tests
for t in *.test; do
# Run each test (automatically saves the output in the results directory).
./$t
done
}
runTests