Skip to content

Commit 2928e4a

Browse files
committed
update run.sh to be in sync with operator values
1 parent 01516d9 commit 2928e4a

File tree

1 file changed

+30
-5
lines changed
  • src/integration-tests/bash

1 file changed

+30
-5
lines changed

src/integration-tests/bash/run.sh

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ function deploy_operator {
775775
local outfile="${TMP_DIR}/create-weblogic-operator-helm.out"
776776
trace "Run helm install to deploy the weblogic operator, see \"$outfile\" for tracking."
777777
cd $PROJECT_ROOT/kubernetes/charts
778-
helm install weblogic-operator --name ${NAMESPACE} -f $inputs 2>&1 | opt_tee ${outfile}
778+
helm install weblogic-operator --name ${opkey} -f $inputs 2>&1 | opt_tee ${outfile}
779779
trace "helm install output:"
780780
cat $outfile
781781
operator_ready_wait $opkey
@@ -2487,6 +2487,27 @@ function test_domain_lifecycle {
24872487
declare_test_pass
24882488
}
24892489

2490+
function wait_for_operator_shutdown {
2491+
name=$1
2492+
deleted=false
2493+
iter=1
2494+
trace "waiting for operator shutdown by verifying that namespace ${name} no longer exist "
2495+
while [ ${deleted} == false -a $iter -lt 101 ]; do
2496+
kubectl get namespace ${name}
2497+
if [ $? != 0 ]; then
2498+
deleted=true
2499+
else
2500+
iter=`expr $iter + 1`
2501+
sleep 5
2502+
fi
2503+
done
2504+
if [ ${deleted} == false ]; then
2505+
fail 'operator fail to be deleted'
2506+
else
2507+
trace "operator namespace ${name} has been deleted"
2508+
fi
2509+
}
2510+
24902511
function shutdown_operator {
24912512
if [ "$#" != 1 ] ; then
24922513
fail "requires 1 parameter: operatorKey"
@@ -2496,7 +2517,8 @@ function shutdown_operator {
24962517
local TMP_DIR="`op_get $OP_KEY TMP_DIR`"
24972518

24982519
if [ "$USE_HELM" = "true" ]; then
2499-
helm delete $OPERATOR_NS --purge
2520+
helm delete $OP_KEY --purge
2521+
wait_for_operator_shutdown $OPERATOR_NS
25002522
else
25012523
kubectl delete -f $TMP_DIR/weblogic-operator.yaml
25022524
fi
@@ -2522,7 +2544,7 @@ function startup_operator {
25222544
if [ "$USE_HELM" = "true" ]; then
25232545
local inputs="$TMP_DIR/weblogic-operator-values.yaml"
25242546
local outfile="$TMP_DIR/startup-weblogic-operator.out"
2525-
helm install weblogic-operator --name ${OPERATOR_NS} -f $inputs 2>&1 | opt_tee ${outfile}
2547+
helm install weblogic-operator --name ${OP_KEY} -f $inputs 2>&1 | opt_tee ${outfile}
25262548
trace "helm install output:"
25272549
cat $outfile
25282550
else
@@ -2993,8 +3015,11 @@ function test_suite {
29933015
kubectl create namespace test1 2>&1 | sed 's/^/+/g'
29943016
kubectl create namespace test2 2>&1 | sed 's/^/+/g'
29953017

2996-
kubectl create namespace weblogic-operator-1 2>&1 | sed 's/^/+/g'
2997-
kubectl create namespace weblogic-operator-2 2>&1 | sed 's/^/+/g'
3018+
if ! [ "$USE_HELM" = "true" ]; then
3019+
# do not create ooperator namespace when using helm charts
3020+
kubectl create namespace weblogic-operator-1 2>&1 | sed 's/^/+/g'
3021+
kubectl create namespace weblogic-operator-2 2>&1 | sed 's/^/+/g'
3022+
fi
29983023

29993024
# This test pass pairs with 'declare_new_test 1 define_operators_and_domains' above
30003025
declare_test_pass

0 commit comments

Comments
 (0)