File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 1616# # --ssh-options Optional SSH options (for `ssh` and `gcloud compute ssh` commands)
1717# # --known-hosts A known_hosts file (default: ${HOME}/.ssh/known_hosts)
1818# #
19+ # # --results-dir Directory to output results files (default: temporary directory)
20+ # #
1921# # --verbose More output
2022# # --debug Debug output
2123# #
@@ -50,6 +52,7 @@ USER_KNOWN_HOSTS_FILE="${HOME}/.ssh/known_hosts"
5052SSH_USER_OPTIONS=" "
5153SSH_DEFAULT_OPTIONS=" -o ConnectTimeout=10 -o BatchMode=yes -o UserKnownHostsFile=\" ${USER_KNOWN_HOSTS_FILE} \" "
5254TEMP_DIR=' '
55+ RESULTS_DIR=' '
5356TEST_FAILURES=0
5457TEST_TIMEOUT=120 # seconds, including the Docker image's initial pull
5558IS_OFFLINE=0
@@ -71,7 +74,7 @@ main() {
7174
7275 verbose " ${CONFIG} "
7376
74- create_temp_dir
77+ create_results_dir
7578
7679 trap cleanup EXIT
7780
@@ -443,6 +446,8 @@ present_results() {
443446 fi 2>&1
444447 )
445448
449+ verbose " Results saved in: ${RESULTS_DIR} :"
450+
446451 echo " ${OUTPUT_RESULT} "
447452
448453 echo " ${OUTPUT_PASS} "
@@ -457,8 +462,14 @@ present_results() {
457462 fi
458463}
459464
460- create_temp_dir () {
461- TEMP_DIR=$( mktemp -d) # shorthand for alpine/busybox compat
465+ create_results_dir () {
466+ if [[ " ${RESULTS_DIR} " != " " ]]; then
467+ mkdir -p " ${RESULTS_DIR} "
468+ TEMP_DIR=" ${RESULTS_DIR} "
469+ else
470+ TEMP_DIR=$( mktemp -d) # shorthand for alpine/busybox compat
471+ RESULTS_DIR=" ${TEMP_DIR} "
472+ fi
462473}
463474
464475jqc () {
@@ -532,6 +543,11 @@ parse_arguments() {
532543 not_empty_or_usage " ${1:- } "
533544 SSH_USER_OPTIONS=" ${1} "
534545 ;;
546+ --results-dir)
547+ shift
548+ not_empty_or_usage " ${1:- } "
549+ RESULTS_DIR=" ${1} "
550+ ;;
535551 --offline | --no-pull)
536552 IS_OFFLINE=1
537553 ;;
You can’t perform that action at this time.
0 commit comments