Skip to content

Commit 8a41746

Browse files
committed
debugging on external Jenkins
1 parent b333408 commit 8a41746

File tree

4 files changed

+45
-6
lines changed

4 files changed

+45
-6
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public class BaseTest {
7272
private static String appLocationOnHost;
7373
private static Properties appProps;
7474
private static String weblogicImageTag;
75+
private static String weblogicImageDevTag;
7576
private static String weblogicImageName;
7677
private static String weblogicImageServer;
7778
private static String domainApiVersion;
@@ -114,6 +115,10 @@ public static void initialize(String appPropsFile) throws Exception {
114115
System.getenv("IMAGE_TAG_WEBLOGIC") != null
115116
? System.getenv("IMAGE_TAG_WEBLOGIC")
116117
: appProps.getProperty("weblogicImageTag");
118+
weblogicImageDevTag =
119+
System.getenv("IMAGE_DEVTAG_WEBLOGIC") != null
120+
? System.getenv("IMAGE_DEVTAG_WEBLOGIC")
121+
: appProps.getProperty("weblogicImageDevTag");
117122
weblogicImageName =
118123
System.getenv("IMAGE_NAME_WEBLOGIC") != null
119124
? System.getenv("IMAGE_NAME_WEBLOGIC")
@@ -257,6 +262,15 @@ public static void initialize(String appPropsFile) throws Exception {
257262
public static String getWeblogicImageTag() {
258263
return weblogicImageTag;
259264
}
265+
266+
/**
267+
* getter method for weblogicImageTag field.
268+
*
269+
* @return image tag of the WLS docker images
270+
*/
271+
public static String getWeblogicImageDevTag() {
272+
return weblogicImageDevTag;
273+
}
260274

261275
/**
262276
* getter method for weblogicImageName.

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,16 @@ public void testServerPodsRestartByChangingZImage() throws Exception {
229229
+ " to "
230230
+ "/weblogick8s/middleware/weblogic:duplicate");
231231

232-
String newImage = getWeblogicImageServer()+ "/middleware/weblogic:12.2.1.3-dev";
232+
/*String newImage = getWeblogicImageName() + ":" + getWeblogicImageDevTag();
233233
TestUtils.exec("docker pull " + newImage, true);
234234
// apply new domain yaml and verify pod restart
235235
domain.verifyDomainServerPodRestart(
236236
"\"" + getWeblogicImageName() + ":" + getWeblogicImageTag() + "\"",
237-
"\"" + newImage + "\"");
237+
"\"" + newImage + "\"");*/
238238

239-
/*if (BaseTest.SHARED_CLUSTER) {
239+
if (BaseTest.SHARED_CLUSTER) {
240240
String newImage =
241-
System.getenv("REPO_REGISTRY") + "/weblogick8s/middleware/weblogic:duplicate";
241+
System.getenv("REPO_REGISTRY") + "/middleware/weblogic:duplicate";
242242
// tag image with repo name
243243
String tag =
244244
"docker tag " + getWeblogicImageName() + ":" + getWeblogicImageTag() + " " + newImage;
@@ -257,6 +257,9 @@ public void testServerPodsRestartByChangingZImage() throws Exception {
257257
System.getenv("REPO_PASSWORD"),
258258
System.getenv("REPO_EMAIL"),
259259
domain.getDomainNs());
260+
261+
//for debugging
262+
TestUtils.loginAndPullImageFromOcir(newImage);
260263

261264
// apply new domain yaml and verify pod restart
262265
domain.verifyDomainServerPodRestart(
@@ -275,7 +278,7 @@ public void testServerPodsRestartByChangingZImage() throws Exception {
275278
domain.verifyDomainServerPodRestart(
276279
"\"" + getWeblogicImageName() + ":" + getWeblogicImageTag() + "\"",
277280
"\"" + getWeblogicImageName() + ":duplicate" + "\"");
278-
}*/
281+
}
279282
} finally {
280283
if (!BaseTest.SHARED_CLUSTER) {
281284
TestUtils.exec("docker rmi -f " + getWeblogicImageName() + ":duplicate");

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,28 @@ public static ExecResult loginAndPushImageToOcir(String image) throws Exception
14821482
+ result.stderr());
14831483
return result;
14841484
}
1485+
1486+
public static ExecResult loginAndPullImageFromOcir(String image) throws Exception {
1487+
String dockerLoginAndPullCmd =
1488+
"docker login "
1489+
+ System.getenv("REPO_REGISTRY")
1490+
+ " -u "
1491+
+ System.getenv("REPO_USERNAME")
1492+
+ " -p \""
1493+
+ System.getenv("REPO_PASSWORD")
1494+
+ "\" && docker pull "
1495+
+ image;
1496+
ExecResult result = TestUtils.exec(dockerLoginAndPullCmd);
1497+
logger.info(
1498+
"cmd "
1499+
+ dockerLoginAndPushCmd
1500+
+ "\n result "
1501+
+ result.stdout()
1502+
+ "\n err "
1503+
+ result.stderr());
1504+
return result;
1505+
}
1506+
14851507

14861508
public static ExecResult kubectlpatch(String domainUid, String domainNS, String patchStr)
14871509
throws Exception {

integration-tests/src/test/resources/OperatorIT.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ password=welcome1
88
maxIterationsPod=25
99
waitTimePod=10
1010
weblogicImageTag = 12.2.1.3
11+
weblogicImageDevTag = 12.2.1.3-dev
1112
weblogicImageName = container-registry.oracle.com/middleware/weblogic
1213
OCR_SERVER=container-registry.oracle.com
1314
DOMAIN_API_VERSION = weblogic.oracle/v4
14-

0 commit comments

Comments
 (0)