Skip to content

Commit

Permalink
tls enablement for check_odov2.sh and openshift_integration.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Valdron <[email protected]>
  • Loading branch information
michael-valdron committed Dec 24, 2024
1 parent 136e079 commit 55dcd5f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
24 changes: 12 additions & 12 deletions .ci/openshift_integration.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
27 changes: 26 additions & 1 deletion tests/check_odov2.sh
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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=$?
Expand Down

0 comments on commit 55dcd5f

Please sign in to comment.