Skip to content

Commit

Permalink
trigger-openqa_in_openqa: Allow to import for testability and extenda…
Browse files Browse the repository at this point in the history
…bility
  • Loading branch information
okurz committed Oct 18, 2024
1 parent 7881226 commit e925b2d
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions trigger-openqa_in_openqa
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,33 @@ client_prefix=${client_prefix:-}
full_run=${FULL:-}
group_id="${group_id:-"openQA"}"

usage() {
cat << EOF
Usage: $0 [OPTIONS]
Triggers tests on an openQA instance testing openQA itself.
Can be configured additionally with environment variables.
Options:
-h, --help display this help
EOF
exit "$1"
}

main() {
opts=$(getopt -o h -l help -n "$0" -- "$@") || usage 1
eval set -- "$opts"
while true; do
case "$1" in
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
esac
done
[ "$dry_run" = "1" ] && client_prefix="echo"
local qcow build
download_scenario
Expand Down Expand Up @@ -66,31 +92,4 @@ trigger() {
| tee job_post_response
}

usage() {
cat << EOF
Usage: $0 [OPTIONS]
Triggers tests on an openQA instance testing openQA itself.
Can be configured additionally with environment variables.
Options:
-h, --help display this help
EOF
exit "$1"
}

opts=$(getopt -o h -l help -n "$0" -- "$@") || usage 1
eval set -- "$opts"
while true; do
case "$1" in
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
esac
done

main
caller 0 > /dev/null || main "$@"

0 comments on commit e925b2d

Please sign in to comment.