Skip to content

Commit ba2dc58

Browse files
author
Tom Barnes
committed
Config overrides test update.
1 parent b8afbc2 commit ba2dc58

File tree

9 files changed

+78
-115
lines changed

9 files changed

+78
-115
lines changed

src/integration-tests/introspector/introspectTest.sh

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,7 @@ function deployMySQL() {
402402
cat ${test_home}/docker_build.out
403403
exit 1
404404
fi
405-
deployYamlTemplate mysql-secret.yamlt mysql-secret.yaml
406-
deployYamlTemplate mysql-pv.yamlt mysql-pv.yaml
407-
deployYamlTemplate mysql-pvc.yamlt mysql-pvc.yaml
408-
deployYamlTemplate mysql-pod.yamlt mysql-pod.yaml
405+
deployYamlTemplate mysql.yamlt mysql.yaml
409406
}
410407

411408
#############################################################################
@@ -437,29 +434,6 @@ function deployCreateDomainJobPod() {
437434
# Wait for pod to come up successfully
438435

439436
waitForPod $pod_name
440-
441-
# TODO: We can eliminate the following code if we (1) have job pod script touch
442-
# a file upon completion, and (2) have job pod ready check look for this file
443-
444-
local startSecs=$SECONDS
445-
local maxsecs=30
446-
local exitString=""
447-
tracen "Info: Waiting up to $maxsecs seconds for pod '$pod_name' to run the wl-create-domain-pod.py script."
448-
printdots_start
449-
while [ $((SECONDS - startSecs)) -lt $maxsecs ] && [ "$exitString" = "" ]; do
450-
exitString="`kubectl -n $NAMESPACE logs $pod_name 2>&1 | grep CREATE_DOMAIN_EXIT`"
451-
sleep 1
452-
done
453-
printdots_end
454-
if [ "$exitString" = "" ]; then
455-
trace "Error: Timed out, see 'kubectl -n $NAMESPACE logs $pod_name'."
456-
exit 1
457-
fi
458-
if [ ! "$exitString" = "CREATE_DOMAIN_EXIT=0" ]; then
459-
trace "Error: Pod script failed, see 'kubectl -n $NAMESPACE logs $pod_name'."
460-
exit 1
461-
fi
462-
463437
}
464438

465439
#############################################################################
@@ -490,16 +464,8 @@ function deployIntrospectJobPod() {
490464
trace "Info: Deploying job pod '$pod_name' and waiting for it to be ready."
491465

492466
(
493-
export SERVER_NAME=introspect
494467
export JOB_NAME=${DOMAIN_UID}--introspect-domain-pod
495468
export JOB_SCRIPT=/test-scripts/wl-introspect-pod.sh
496-
export SERVICE_NAME=`toDNS1123Legal ${DOMAIN_UID}-${server_name}`
497-
export AS_SERVICE_NAME=`toDNS1123Legal ${DOMAIN_UID}-${ADMIN_NAME}`
498-
if [ "${SERVER_NAME}" = "${ADMIN_NAME}" ]; then
499-
export LOCAL_SERVER_DEFAULT_PORT=$ADMIN_PORT
500-
else
501-
export LOCAL_SERVER_DEFAULT_PORT=$MANAGED_SERVER_PORT
502-
fi
503469
${SCRIPTPATH}/util_subst.sh -g wl-introspect-pod.yamlt ${target_yaml} || exit 1
504470
) || exit 1
505471

@@ -510,28 +476,6 @@ function deployIntrospectJobPod() {
510476

511477
waitForPod $pod_name
512478

513-
# TODO: We can eliminate the following code if we (1) have job pod script touch
514-
# a file upon completion, and (2) have job pod ready check look for this file
515-
516-
local startSecs=$SECONDS
517-
local maxsecs=30
518-
local exitString=""
519-
tracen "Info: Waiting up to $maxsecs seconds for pod '$pod_name' to run the introspectDomain.py script."
520-
printdots_start
521-
while [ $((SECONDS - startSecs)) -lt $maxsecs ] && [ "$exitString" = "" ]; do
522-
exitString="`kubectl -n $NAMESPACE logs $pod_name 2>&1 | grep INTROSPECT_DOMAIN_EXIT`"
523-
sleep 1
524-
done
525-
printdots_end
526-
if [ "$exitString" = "" ]; then
527-
trace "Error: Introspector timed out, see 'kubectl -n $NAMESPACE logs $pod_name'."
528-
exit 1
529-
fi
530-
if [ ! "$exitString" = "INTROSPECT_DOMAIN_EXIT=0" ]; then
531-
trace "Error: Introspector pod script failed, see 'kubectl -n $NAMESPACE logs $pod_name'."
532-
exit 1
533-
fi
534-
535479
# parse job pod's output files
536480

537481
kubectl -n $NAMESPACE logs $pod_name > ${test_home}/job-${DOMAIN_UID}-introspect-domain-pod-job.out

src/integration-tests/introspector/mysql-pv.yamlt

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/integration-tests/introspector/mysql-pvc.yamlt

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/integration-tests/introspector/mysql-secret.yamlt

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/integration-tests/introspector/mysql-pod.yamlt renamed to src/integration-tests/introspector/mysql.yamlt

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,50 @@
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

44
apiVersion: v1
5-
kind: Service
5+
kind: Secret
66
metadata:
7+
name: ${DOMAIN_UID}-mysql-secret
78
labels:
9+
weblogic.domainName: ${DOMAIN_NAME}
810
weblogic.domainUID: ${DOMAIN_UID}
9-
name: ${DOMAIN_UID}-mysql
11+
data:
12+
# echo -n "root" | base64
13+
root-user: cm9vdA==
14+
# echo -n "password" | base64
15+
root-password: cGFzc3dvcmQ=
16+
---
17+
apiVersion: v1
18+
kind: PersistentVolume
19+
metadata:
20+
labels:
21+
weblogic.domainUID: ${DOMAIN_UID}
22+
name: ${DOMAIN_UID}-mysql-pv
23+
spec:
24+
accessModes:
25+
- ReadWriteMany
26+
capacity:
27+
storage: 10Gi
28+
hostPath:
29+
path: ${PV_ROOT}/acceptance_test_pv/domain-${DOMAIN_UID}-storage/mysql
30+
type: ""
31+
persistentVolumeReclaimPolicy: Retain
32+
storageClassName: ${DOMAIN_UID}-mysql-storage-class
33+
---
34+
apiVersion: v1
35+
kind: PersistentVolumeClaim
36+
metadata:
37+
labels:
38+
weblogic.domainUID: ${DOMAIN_UID}
39+
name: ${DOMAIN_UID}-mysql-pvc
1040
namespace: ${NAMESPACE}
1141
spec:
12-
ports:
13-
- port: 3306
14-
selector:
15-
app: ${DOMAIN_UID}-mysql
16-
clusterIP: None
42+
accessModes:
43+
- ReadWriteMany
44+
resources:
45+
requests:
46+
storage: 10Gi
47+
storageClassName: ${DOMAIN_UID}-mysql-storage-class
48+
volumeName: ${DOMAIN_UID}-mysql-pv
1749
---
1850
apiVersion: v1
1951
kind: Pod
@@ -44,3 +76,17 @@ spec:
4476
- name: mysql-storage-volume
4577
persistentVolumeClaim:
4678
claimName: ${DOMAIN_UID}-mysql-pvc
79+
---
80+
apiVersion: v1
81+
kind: Service
82+
metadata:
83+
labels:
84+
weblogic.domainUID: ${DOMAIN_UID}
85+
name: ${DOMAIN_UID}-mysql
86+
namespace: ${NAMESPACE}
87+
spec:
88+
ports:
89+
- port: 3306
90+
selector:
91+
app: ${DOMAIN_UID}-mysql
92+
clusterIP: None

src/integration-tests/introspector/wl-create-domain-pod.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ while [ 1 -eq 1 ] ; do
2525

2626
echo "CREATE_DOMAIN_EXIT=0"
2727

28+
# The pod's readiness probe checks for this file:
29+
touch /tmp/ready
30+
2831
while [ 1 -eq 1 ] ; do
2932
sleep 10
3033
done

src/integration-tests/introspector/wl-create-domain-pod.yamlt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ spec:
3333
image: "${WEBLOGIC_IMAGE_NAME}:${WEBLOGIC_IMAGE_TAG}"
3434
imagePullPolicy: ${WEBLOGIC_IMAGE_PULL_POLICY}
3535
name: weblogic-server
36+
readinessProbe:
37+
exec:
38+
command:
39+
- cat
40+
- /tmp/ready
41+
initialDelaySeconds: 5
42+
periodSeconds: 1
3643
volumeMounts:
3744
- name: my-secret-volume
3845
mountPath: /weblogic-operator/config-overrides-secrets/my-secret

src/integration-tests/introspector/wl-introspect-pod.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

55
/weblogic-operator/scripts/introspectDomain.sh
6+
ret="$?"
67

7-
# the introspectTest.sh script looks for this exact line:
8-
echo "INTROSPECT_DOMAIN_EXIT=$?"
8+
echo "INTROSPECT_DOMAIN_EXIT=$ret"
9+
10+
if [ "$ret" = "0" ]; then
11+
# The pod's readiness probe check for this file
12+
touch /tmp/ready
13+
fi
914

1015
echo In "$0" SLEEPING
1116

src/integration-tests/introspector/wl-introspect-pod.yamlt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ spec:
3434
image: "${WEBLOGIC_IMAGE_NAME}:${WEBLOGIC_IMAGE_TAG}"
3535
imagePullPolicy: ${WEBLOGIC_IMAGE_PULL_POLICY}
3636
name: weblogic-server
37+
readinessProbe:
38+
exec:
39+
command:
40+
- cat
41+
- /tmp/ready
42+
initialDelaySeconds: 5
43+
periodSeconds: 1
3744
volumeMounts:
3845
- name: weblogic-credentials-volume
3946
mountPath: /weblogic-operator/secrets

0 commit comments

Comments
 (0)