@@ -162,54 +162,6 @@ function cleanupMinor() {
162162 echo
163163}
164164
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-
213165# ############################################################################
214166#
215167# Helper function for deploying a yaml template. Template $1 is converted
@@ -359,25 +311,23 @@ function deployCustomOverridesConfigMap() {
359311#
360312
361313function createTestRootPVDir() {
362-
363- trace " Info: Creating k8s cluster physical directory 'PV_ROOT/acceptance_test_pv/domain-${DOMAIN_UID} -storage'."
364314 trace " Info: PV_ROOT='$PV_ROOT '"
365- trace " Info: Test k8s resources use this physical directory via a PV/PVC '/shared' logical directory."
366315
367316 # TBD on Wercker/Jenkins PV_ROOT will differ and may already exist or be remote
368317 # so we need to add logic/booleans to skip the following mkdir/chmod as needed
318+
369319 mkdir -p ${PV_ROOT} || exit 1
370320 chmod 777 ${PV_ROOT} || exit 1
371321
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."
376324
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
381331}
382332
383333# ############################################################################
@@ -695,18 +645,18 @@ deployDomainConfigMap
695645deployTestScriptConfigMap
696646deployCustomOverridesConfigMap
697647
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+
698653if [ ! " $RERUN_INTROSPECT_ONLY " = " true" ]; then
699654 createTestRootPVDir
700655 deployMySQL
701656 deployWebLogic_PV_PVC_and_Secret
702657 deployCreateDomainJobPod
703658fi
704659
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-
710660deployIntrospectJobPod
711661
712662#
0 commit comments