diff --git a/.ci/openshift_integration.sh b/.ci/openshift_integration.sh index d4479436..4330c808 100755 --- a/.ci/openshift_integration.sh +++ b/.ci/openshift_integration.sh @@ -1,18 +1,18 @@ #!/bin/bash + +# Copyright Red Hat # -# Copyright 2021-2022 Red Hat, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. #!/usr/bin/env bash # exit immediately when a command fails @@ -69,4 +69,4 @@ $(realpath odo) registry delete DefaultDevfileRegistry -f $(realpath odo) registry add TestDevfileRegistry http://$REGISTRY_HOSTNAME # Run the devfile validation tests -ENV=openshift REGISTRY=remote tests/check_odov2.sh $(realpath odo) $YQ_PATH +ENV=openshift REGISTRY=remote ENABLE_TLS="false" tests/check_odov2.sh $(realpath odo) $YQ_PATH diff --git a/tests/check_odov2.sh b/tests/check_odov2.sh index 2cf609d7..af52a08e 100755 --- a/tests/check_odov2.sh +++ b/tests/check_odov2.sh @@ -1,8 +1,24 @@ #!/usr/bin/env bash +# +# Copyright Red Hat +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + set -x DEVFILES_DIR="$(pwd)/stacks" FAILED_TESTS=() +ENABLE_TLS=${ENABLE_TLS:-"true"} # The stacks to test as a string separated by spaces STACKS=$(bash "$(pwd)/tests/get_stacks.sh") @@ -42,7 +58,16 @@ waitForHTTPStatus() { for i in $(seq 1 10); do echo "try: $i" - content=$(curl -i "$url") + if [[ $ENABLE_TLS == "true" ]] + then + content=$(curl -i "$url") + elif [[ $ENABLE_TLS == "false" ]] + then + content=$(curl -i --insecure "$url") + else + echo "ERROR: ENABLE_TLS must be either true or false" + return 1 + fi echo "Checking if $url is returning HTTP $status_code" echo "$content" | grep -q -E "HTTP/[0-9.]+ $status_code" ret_val=$?