Skip to content

Commit 2dc047b

Browse files
committed
Fine tune test case for creating domain with startupControl "ADMIN"
Signed-off-by: Dongbo Xiao <[email protected]>
1 parent 838bde2 commit 2dc047b

File tree

1 file changed

+38
-4
lines changed
  • src/integration-tests/bash

1 file changed

+38
-4
lines changed

src/integration-tests/bash/run.sh

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,24 @@ function get_cluster_replicas {
890890
echo $replicas
891891
}
892892

893+
function get_startup_control {
894+
if [ "$#" != 1 ] ; then
895+
fail "requires 1 parameter: domainkey"
896+
fi
897+
898+
local NAMESPACE="`dom_get $1 NAMESPACE`"
899+
local DOMAIN_UID="`dom_get $1 DOMAIN_UID`"
900+
901+
local startup_control_cmd="kubectl get domain $DOMAIN_UID -n $NAMESPACE -o jsonpath='{.spec.startupControl}'"
902+
local startup_control=`eval $startup_control_cmd`
903+
904+
if [ -z ${startup_control} ]; then
905+
fail "startupControl not found in domain $DOMAIN_UID"
906+
fi
907+
908+
echo $startup_control
909+
}
910+
893911
function verify_managed_servers_ready {
894912
if [ "$#" != 1 ] ; then
895913
fail "requires 1 parameter: domainkey"
@@ -1893,7 +1911,6 @@ function verify_domain_created {
18931911

18941912
local NAMESPACE="`dom_get $1 NAMESPACE`"
18951913
local DOMAIN_UID="`dom_get $1 DOMAIN_UID`"
1896-
local STARTUP_CONTROL="`dom_get $1 STARTUP_CONTROL`"
18971914
local MS_BASE_NAME="`dom_get $1 MS_BASE_NAME`"
18981915

18991916
trace "verify domain $DOMAIN_UID in $NAMESPACE namespace"
@@ -1913,8 +1930,10 @@ function verify_domain_created {
19131930
trace "verify the service and pod of admin server"
19141931
verify_service_and_pod_created $DOM_KEY 0
19151932

1933+
local startup_control=`get_startup_control $DOM_KEY`
1934+
19161935
local verify_as_only=false
1917-
if [ "$STARTUP_CONTROL" = "ADMIN" ] ; then
1936+
if [ "${startup_control}" = "ADMIN" ] ; then
19181937
verify_as_only=true
19191938
fi
19201939

@@ -2223,6 +2242,22 @@ function test_operator_lifecycle {
22232242
declare_test_pass
22242243
}
22252244

2245+
function test_create_domain_startup_control_admin {
2246+
declare_new_test 1 "$@"
2247+
2248+
if [ "$#" != 1 ] ; then
2249+
fail "requires 1 parameters: domainKey"
2250+
fi
2251+
2252+
local DOM_KEY=${1}
2253+
local DOMAIN_UID="`dom_get $1 DOMAIN_UID`"
2254+
2255+
run_create_domain_job $DOMAIN_UID
2256+
verify_domain_created $DOMAIN_UID
2257+
2258+
declare_test_pass
2259+
}
2260+
22262261
# scale domain $1 up and down, and optionally verify the scaling had no effect on domain $2
22272262
function test_cluster_scale {
22282263
declare_new_test 1 "$@"
@@ -2559,8 +2594,7 @@ function test_suite {
25592594
test_domain_lifecycle domain1 domain4
25602595

25612596
# create another domain in the default namespace with startupControl="ADMIN", and verify that only admin server is created
2562-
run_create_domain_job domain5
2563-
verify_domain_created domain5
2597+
test_create_domain_startup_control_admin domain5
25642598

25652599
# test managed server 1 pod auto-restart
25662600
test_wls_liveness_probe domain1

0 commit comments

Comments
 (0)