@@ -162,54 +162,6 @@ function cleanupMinor() {
162
162
echo
163
163
}
164
164
165
- # ############################################################################
166
- #
167
- # Helper function for running a job
168
- #
169
-
170
- function runJob() {
171
- trace " Info: Running job '${1?} ' for script '${2?} '."
172
-
173
- local job_name=${1?}
174
- local job_script=${2?}
175
- local yaml_template=${3?}
176
- local yaml_file=${4?}
177
-
178
- # Remove old job yaml in case its leftover from a previous run
179
-
180
- rm -f ${test_home} /${yaml_file}
181
-
182
- # Create the job yaml from its template
183
-
184
- env \
185
- JOB_SCRIPT=${job_script} \
186
- JOB_NAME=${job_name} \
187
- ${SCRIPTPATH} /util_subst.sh -g ${yaml_template} ${test_home} /${yaml_file} \
188
- || exit 1
189
-
190
- # Run the job
191
-
192
- tracen " Info: Waiting for job '$job_name ' to complete."
193
- printdots_start
194
- env \
195
- KUBECONFIG=$KUBECONFIG \
196
- JOB_YAML=${test_home} /${yaml_file} \
197
- JOB_NAME=${job_name} \
198
- NAMESPACE=$NAMESPACE \
199
- ${SCRIPTPATH} /util_job.sh \
200
- 2>&1 > ${test_home} /job-${1} .out
201
- local status=$?
202
- printdots_end
203
-
204
- if [ ! $status -eq 0 ]; then
205
- printdots_end
206
- trace " Error: job failed, job contents"
207
- cat ${test_home} /job-${1} .out
208
- trace " Error: end of failed job contents"
209
- exit 1
210
- fi
211
- }
212
-
213
165
# ############################################################################
214
166
#
215
167
# Helper function for deploying a yaml template. Template $1 is converted
@@ -359,25 +311,23 @@ function deployCustomOverridesConfigMap() {
359
311
#
360
312
361
313
function createTestRootPVDir() {
362
-
363
- trace " Info: Creating k8s cluster physical directory 'PV_ROOT/acceptance_test_pv/domain-${DOMAIN_UID} -storage'."
364
314
trace " Info: PV_ROOT='$PV_ROOT '"
365
- trace " Info: Test k8s resources use this physical directory via a PV/PVC '/shared' logical directory."
366
315
367
316
# TBD on Wercker/Jenkins PV_ROOT will differ and may already exist or be remote
368
317
# so we need to add logic/booleans to skip the following mkdir/chmod as needed
318
+
369
319
mkdir -p ${PV_ROOT} || exit 1
370
320
chmod 777 ${PV_ROOT} || exit 1
371
321
372
- # Create test root within PV_ROOT via a job
373
-
374
- deployYamlTemplate create-test-root-pv.yamlt create-test-root-pv.yaml
375
- deployYamlTemplate create-test-root-pvc.yamlt create-test-root-pvc.yaml
322
+ trace " Info: Creating k8s cluster physical directory 'PV_ROOT/acceptance_test_pv/domain-${DOMAIN_UID} -storage' via 'kubectl run'."
323
+ trace " Info: Test k8s resources use this physical directory via a PV/PVC '/shared' logical directory."
376
324
377
- runJob ${DOMAIN_UID} -create-test-root-job \
378
- /test-scripts/createTestRoot.sh \
379
- create-test-root-job.yamlt \
380
- create-test-root-job.yaml
325
+ ${SCRIPTPATH} /util_krun.sh -m ${PV_ROOT} :/pv-root \
326
+ -i ${WEBLOGIC_IMAGE_NAME} :${WEBLOGIC_IMAGE_TAG} \
327
+ -l ${WEBLOGIC_IMAGE_PULL_POLICY} \
328
+ -f ${SCRIPTPATH} /createTestRoot.sh \
329
+ -c " sh /tmpmount/createTestRoot.sh ${DOMAIN_UID} " \
330
+ || exit 1
381
331
}
382
332
383
333
# ############################################################################
@@ -695,18 +645,18 @@ deployDomainConfigMap
695
645
deployTestScriptConfigMap
696
646
deployCustomOverridesConfigMap
697
647
648
+ kubectl -n $NAMESPACE delete secret my-secret > /dev/null 2>&1
649
+ kubectl -n $NAMESPACE create secret generic my-secret \
650
+ --from-literal=key1=supersecret \
651
+ --from-literal=key2=topsecret 2>&1 | tracePipe " Info: kubectl output: "
652
+
698
653
if [ ! " $RERUN_INTROSPECT_ONLY " = " true" ]; then
699
654
createTestRootPVDir
700
655
deployMySQL
701
656
deployWebLogic_PV_PVC_and_Secret
702
657
deployCreateDomainJobPod
703
658
fi
704
659
705
- kubectl -n $NAMESPACE delete secret my-secret > /dev/null 2>&1
706
- kubectl -n $NAMESPACE create secret generic my-secret \
707
- --from-literal=key1=supersecret \
708
- --from-literal=key2=topsecret 2>&1 | tracePipe " Info: kubectl output: "
709
-
710
660
deployIntrospectJobPod
711
661
712
662
#
0 commit comments