-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract and reuse same code as in test-prow-e2e.sh
- Loading branch information
1 parent
8c48b58
commit 8cc5692
Showing
4 changed files
with
47 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -exuo pipefail | ||
|
||
function waitForAuthOperatorProgressing { | ||
output='' | ||
count=0 | ||
sleepDuration=15 | ||
maxRetries=40 # 10 minutes | ||
action="started" | ||
if [ "$1" == "False" ]; then | ||
action="finished" | ||
fi | ||
|
||
until [ "$output" == "$1" ] || [ $count -gt $maxRetries ]; do | ||
output=$(oc get co/authentication -o 'jsonpath={.status.conditions[?(@.type=="Progressing")].status}') | ||
((count=count+1)) | ||
sleep $sleepDuration | ||
done | ||
|
||
secs=$((count*sleepDuration)); | ||
printf -v durationStr '%dm:%ds' $((secs%3600/60)) $((secs%60)) | ||
if [ "$output" == "$1" ]; then | ||
echo "authentication operator $action Progressing 'test' idp (duration: $durationStr)" | ||
else | ||
echo "authentication operator: maximum retries reached (duration: $durationStr)" | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Add htpasswd IDP | ||
# Skip wait for authentication operator to start Progressing when the Secret already exists. | ||
# And ignore any kind of errors when the Secret doesn't exist. | ||
htpasswd_secret_name=$(oc get --ignore-not-found secret -n openshift-config htpass-secret -o name 2> /dev/null) | ||
|
||
if [ "$htpasswd_secret_name" == "" ]; then | ||
oc create -f ./frontend/integration-tests/data/htpasswd-secret.yaml | ||
oc patch oauths cluster --patch "$(cat ./frontend/integration-tests/data/patch-htpasswd.yaml)" --type=merge | ||
set +x | ||
echo "waiting for authentication operator to start Progressing 'test' idp..." | ||
waitForAuthOperatorProgressing "True" | ||
echo "waiting for authentication operator to finish Progressing 'test' idp..." | ||
waitForAuthOperatorProgressing "False" | ||
set -x | ||
fi |
2 changes: 1 addition & 1 deletion
2
frontend/packages/dev-console/integration-tests/support/commands/hooks.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
frontend/packages/dev-console/integration-tests/testData/create_user.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters