Skip to content

Commit 40cf274

Browse files
committed
address review comments
1 parent e25dee5 commit 40cf274

File tree

4 files changed

+24
-34
lines changed

4 files changed

+24
-34
lines changed

integration-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ The tests accepts optional env var overrides:
212212
| QUICKTEST | When set to "true", limits testing to a subset of the tests. |
213213
| WERCKER | Set to true if invoking from Wercker, set to false or "" if running stand-alone or from Jenkins. Default is "". |
214214
| JENKINS | Set to true if invoking from Jenkins, set to false or "" if running stand-alone or from Wercker. Default is "". |
215-
| NODEPORT_HOST | DNS name of a Kubernetes worker node. Default is the local host's hostname. |
215+
| K8S_NODEPORT_HOST | DNS name of a Kubernetes worker node. Default is the local host's hostname. |
216216
| BRANCH_NAME | Git branch name. Default is determined by calling 'git branch'. |
217217
| LEASE_ID | Set to a unique value to (A) periodically renew a lease on the k8s cluster that indicates that no other test run should attempt to use the cluster, and (B) delete this lease when the test completes. |
218218

integration-tests/src/test/java/oracle/kubernetes/operator/BaseTest.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,6 @@ public void testClusterScaling(Operator operator, Domain domain) throws Exceptio
331331
break;
332332
}
333333
}
334-
// Debug for https://bug.oraclecorp.com/pls/bug/webbug_edit.edit_info_top?rptno=29325139
335-
logger.info("***************Adding debug**************");
336-
ExecResult result = ExecCommand.exec("kubectl describe service -n " + domainNS);
337-
logger.info("kubectl describe service outpout " + result.stdout());
338-
339-
logger.info("***************Adding debug**************");
340-
341334
domain.verifyWebAppLoadBalancing(TESTWEBAPP);
342335

343336
replicas = 2;
@@ -509,15 +502,11 @@ private void copyScalingScriptToPod(
509502
TestUtils.createDirUnderDomainPV(dirPathToCreate);
510503

511504
// copy script to pod
512-
TestUtils.kubectlexec(
505+
TestUtils.copyFileViaCat(
506+
getProjectRoot() + "/src/scripts/scaling/scalingAction.sh",
507+
"/shared/domains/" + domainUID + "/bin/scripts/scalingAction.sh",
513508
podName,
514-
domainNS,
515-
" -- bash -c 'cat > "
516-
+ "/shared/domains/"
517-
+ domainUID
518-
+ "/bin/scripts/scalingAction.sh' < "
519-
+ getProjectRoot()
520-
+ "/src/scripts/scaling/scalingAction.sh");
509+
domainNS);
521510
}
522511

523512
private void callWebAppAndVerifyScaling(Domain domain, int replicas) throws Exception {

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -333,27 +333,20 @@ public void deployWebAppViaWLST(
333333
throws Exception {
334334
String adminPod = domainUid + "-" + adminServerName;
335335

336-
String cmd =
337-
" -- bash -c 'cat > " + appLocationInPod + "/" + webappName + ".war' < " + webappLocation;
338-
339-
TestUtils.kubectlexec(adminPod, domainNS, cmd);
336+
TestUtils.copyFileViaCat(
337+
webappLocation, appLocationInPod + "/" + webappName + ".war", adminPod, domainNS);
340338

341-
TestUtils.kubectlexec(
339+
TestUtils.copyFileViaCat(
340+
projectRoot + "/integration-tests/src/test/resources/deploywebapp.py",
341+
appLocationInPod + "/deploywebapp.py",
342342
adminPod,
343-
domainNS,
344-
" -- bash -c 'cat > "
345-
+ appLocationInPod
346-
+ "/deploywebapp.py' < "
347-
+ projectRoot
348-
+ "/integration-tests/src/test/resources/deploywebapp.py");
349-
TestUtils.kubectlexec(
343+
domainNS);
344+
345+
TestUtils.copyFileViaCat(
346+
projectRoot + "/integration-tests/src/test/resources/callpyscript.sh",
347+
appLocationInPod + "/callpyscript.sh",
350348
adminPod,
351-
domainNS,
352-
" -- bash -c 'cat > "
353-
+ appLocationInPod
354-
+ "/callpyscript.sh' < "
355-
+ projectRoot
356-
+ "/integration-tests/src/test/resources/callpyscript.sh");
349+
domainNS);
357350

358351
callShellScriptByExecToPod(username, password, webappName, appLocationInPod);
359352
}

integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,14 @@ public static void kubectlcp(
305305
}
306306
}
307307

308+
public static void copyFileViaCat(
309+
String srcFileOnHost, String destLocationInPod, String podName, String namespace)
310+
throws Exception {
311+
312+
TestUtils.kubectlexec(
313+
podName, namespace, " -- bash -c 'cat > " + destLocationInPod + "' < " + srcFileOnHost);
314+
}
315+
308316
public static ExecResult kubectlexecNoCheck(String podName, String namespace, String scriptPath)
309317
throws Exception {
310318

0 commit comments

Comments
 (0)