Skip to content

Commit

Permalink
run openshift tests on either OCP3 or OCP4
Browse files Browse the repository at this point in the history
  - add error log and exit if os_test not valid
  • Loading branch information
zmiklank committed Feb 21, 2023
1 parent 348f66a commit 9f8362c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
description: 'centos7/c9s/fedora/rhel7/rhel8/rhel9/rhel9-unsubscribed'
required: true
test_case:
description: 'container/openshift'
description: 'container/openshift-3/openshift-4'
required: true
public_api_key:
description: ''
Expand Down
15 changes: 7 additions & 8 deletions export_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@ private_ranch="rhel7 rhel8 rhel9 rhel9-unsubscribed"
all_os="$public_ranch $private_ranch"

os_test="$1" # options: centos7, c9s, fedora, rhel7, rhel8, rhel9, rhel9-unsubscribed
test_case="$2" # options: container, openshift, openshift-4
test_case="$2" # options: container, openshift-3, openshift-4
if [ -z "$os_test" ] || ! echo "$all_os" | grep -q "$os_test" ; then
echo "::error::os_test '$os_test' is not valid"
echo "::warning::choose one of: $all_os"
exit 5
fi

# container tests vs openshift tests

if [ -z "$test_case" ] ; then
echo "::error::test_case '$test_case' is not valid"
exit 5
fi
case "$test_case" in
"container")
test_case="container"
tmt_plan_suffix="-docker"
context_suffix=""
test_name="test"
;;
"openshift")
"openshift-3")
context_suffix=" - OpenShift 3"
tmt_plan_suffix="-openshift-3"
test_name="test-openshift"
Expand All @@ -35,7 +30,7 @@ case "$test_case" in
tmt_plan_suffix="-openshift-4"
test_name="test-openshift-4"
;;
*)
""|*)
echo "::error::test_case '$test_case' is not valid"
exit 5
;;
Expand Down Expand Up @@ -97,6 +92,10 @@ case "$os_test" in
context="RHEL9 - Unsubscribed host"
compose="RHEL-9.1.0-Nightly"
;;
""|*)
echo "::error::os_test '$os_test' is not valid"
exit 5
;;
esac

# shellcheck disable=SC2129
Expand Down

0 comments on commit 9f8362c

Please sign in to comment.