Skip to content

Commit c7af8a0

Browse files
committed
Check certificate
1 parent cda358e commit c7af8a0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

scripts/pit/lib/lib-ccenter.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ installTls() {
9090
rm -f $f1 $f2
9191
pod=`kubectl -n $CC_NS get pods | grep control-center-ingress-nginx-controller | awk '{print $1}'` || return 1
9292
[ -n "$pod" ] && runCmd "$TEST" "Reloading nginx in $pod" "kubectl exec $pod -n "$CC_NS" -- nginx -s reload" || return 1
93-
runCmd "$TEST" "Waiting for reloaging" sleep 10
93+
runCmd "$TEST" "Waiting for reloading ingress" sleep 10
9494
# runCmd "$TEST" "Restaring ingress" \
9595
# "kubectl -n $CC_NS rollout restart deployment control-center-ingress-nginx-controller" || return 1
9696
}
@@ -108,11 +108,16 @@ showTemporaryPassword() {
108108
runPwTests() {
109109
computeNpm
110110
[ -n "$SKIPPW" ] && return 0
111-
[ -z "$CC_CERT" -o -z "$CC_KEY" ] && NO_TLS=--notls
111+
NO_TLS=--notls
112112
for f in $CC_TESTS; do
113113
## loop until we get a valid https response from the control-center and keycloak
114114
waitUntilHttpResponse https://$CC_CONTROL '^< HTTP/2 401' || return 1
115115
waitUntilHttpResponse https://$CC_AUTH Keycloak || return 1
116+
if [ -n "$CC_CERT" -a -n "$CC_KEY" ];then
117+
waitUntilHttpResponse https://$CC_CONTROL 'SSL certificate verify ok|subject: CN=.*.alcala.org' || return 1
118+
waitUntilHttpResponse https://$CC_AUTH 'SSL certificate verify ok|subject: CN=.*.alcala.org' || return 1
119+
NO_TLS=""
120+
fi
116121
runPlaywrightTests "$PIT_SCR_FOLDER/its/$f" "" "prod" "control-center" --url=https://$CC_CONTROL --email=$CC_EMAIL $NO_TLS || return 1
117122
sleep 3
118123
done

scripts/pit/lib/lib-utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ waitUntilHttpResponse() {
421421
[ $err != 0 ] && echo "$H" | grep " refused" && printf "\n" && warn "ERROR Server not listening in URL $1" && return 1
422422
[ $err = 0 ] && echo "$H" | eval $cgrep && printf "\n" && return 0 || (printf . && sleep 3)
423423
elapsed=`expr $elapsed + 3`
424-
[ "$elapsed" -ge "${3:-180}" ] && printf "\n" && log "Timeout ${3:-180} sec. exceeded." && return 1
424+
[ "$elapsed" -ge "${3:-180}" ] && printf "\n" && log "Timeout ${3:-180} sec. exceeded.\n$H" && return 1
425425
done
426426
}
427427

0 commit comments

Comments
 (0)