Skip to content

Commit d7c5841

Browse files
committed
Merge remote-tracking branch 'origin/release/3.3' into release/3.4
2 parents a3ab9e4 + 1c5fca8 commit d7c5841

File tree

15 files changed

+237
-217
lines changed

15 files changed

+237
-217
lines changed

integration-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@
320320
<includes-failsafe>
321321
**/ItT3Channel,
322322
**/ItDedicatedMode,
323-
**/ItOpUpgradeFmwDomainInPV,
323+
**/ItOperatorFmwUpgrade,
324324
**/ItOperatorWlsUpgrade,
325325
**/ItFmwDynamicDomainInPV,
326326
**/ItFmwDomainInPVUsingWDT

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCrossDomainTransaction.java

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import oracle.weblogic.kubernetes.utils.ExecResult;
3636
import org.awaitility.core.ConditionFactory;
3737
import org.junit.jupiter.api.BeforeAll;
38+
import org.junit.jupiter.api.BeforeEach;
3839
import org.junit.jupiter.api.DisplayName;
3940
import org.junit.jupiter.api.MethodOrderer;
4041
import org.junit.jupiter.api.Order;
@@ -54,11 +55,13 @@
5455
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_SLIM;
5556
import static oracle.weblogic.kubernetes.actions.ActionConstants.APP_DIR;
5657
import static oracle.weblogic.kubernetes.actions.ActionConstants.MODEL_DIR;
58+
import static oracle.weblogic.kubernetes.actions.ActionConstants.WORK_DIR;
5759
import static oracle.weblogic.kubernetes.actions.TestActions.createDomainCustomResource;
5860
import static oracle.weblogic.kubernetes.actions.TestActions.getServiceNodePort;
5961
import static oracle.weblogic.kubernetes.assertions.TestAssertions.domainExists;
6062
import static oracle.weblogic.kubernetes.utils.ApplicationUtils.checkAppIsActive;
6163
import static oracle.weblogic.kubernetes.utils.BuildApplication.buildApplication;
64+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodReadyAndServiceExists;
6265
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkServiceExists;
6366
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
6467
import static oracle.weblogic.kubernetes.utils.DbUtils.getDBNodePort;
@@ -71,8 +74,6 @@
7174
import static oracle.weblogic.kubernetes.utils.ImageUtils.createSecretForBaseImages;
7275
import static oracle.weblogic.kubernetes.utils.ImageUtils.dockerLoginAndPushImageToRegistry;
7376
import static oracle.weblogic.kubernetes.utils.OperatorUtils.installAndVerifyOperator;
74-
import static oracle.weblogic.kubernetes.utils.PodUtils.checkPodExists;
75-
import static oracle.weblogic.kubernetes.utils.PodUtils.checkPodReady;
7677
import static oracle.weblogic.kubernetes.utils.PodUtils.getExternalServicePodName;
7778
import static oracle.weblogic.kubernetes.utils.PodUtils.setPodAntiAffinity;
7879
import static oracle.weblogic.kubernetes.utils.SecretUtils.createSecretWithUsernamePassword;
@@ -172,6 +173,23 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
172173
buildApplicationsAndDomains();
173174
}
174175

176+
/**
177+
* Verify all server pods are running.
178+
* Verify k8s services for all servers are created.
179+
*/
180+
@BeforeEach
181+
public void beforeEach() {
182+
int replicaCount = 2;
183+
for (int i = 1; i <= replicaCount; i++) {
184+
checkPodReadyAndServiceExists(domain2ManagedServerPrefix + i,
185+
domainUid2, domain2Namespace);
186+
}
187+
for (int i = 1; i <= replicaCount; i++) {
188+
checkPodReadyAndServiceExists(domain1ManagedServerPrefix + i,
189+
domainUid1, domain1Namespace);
190+
}
191+
}
192+
175193
private static void updatePropertyFile() {
176194
//create a temporary directory to copy and update the properties file
177195
Path target = Paths.get(PROPS_TEMP_DIR);
@@ -214,8 +232,10 @@ private static void addToPropertyFile(String propFileName, String domainNamespac
214232
private static void buildApplicationsAndDomains() {
215233

216234
//build application archive
235+
Path targetDir = Paths.get(WORK_DIR,
236+
ItCrossDomainTransaction.class.getSimpleName() + "/txforward");
217237
Path distDir = buildApplication(Paths.get(APP_DIR, "txforward"), null, null,
218-
"build", domain1Namespace);
238+
"build", domain1Namespace, targetDir);
219239
logger.info("distDir is {0}", distDir.toString());
220240
assertTrue(Paths.get(distDir.toString(),
221241
"txforward.ear").toFile().exists(),
@@ -224,8 +244,10 @@ private static void buildApplicationsAndDomains() {
224244
logger.info("Application is in {0}", appSource);
225245

226246
//build application archive
247+
targetDir = Paths.get(WORK_DIR,
248+
ItCrossDomainTransaction.class.getSimpleName() + "/cdtservlet");
227249
distDir = buildApplication(Paths.get(APP_DIR, "cdtservlet"), null, null,
228-
"build", domain1Namespace);
250+
"build", domain1Namespace, targetDir);
229251
logger.info("distDir is {0}", distDir.toString());
230252
assertTrue(Paths.get(distDir.toString(),
231253
"cdttxservlet.war").toFile().exists(),
@@ -234,8 +256,10 @@ private static void buildApplicationsAndDomains() {
234256
logger.info("Application is in {0}", appSource1);
235257

236258
//build application archive for JMS Send/Receive
259+
targetDir = Paths.get(WORK_DIR,
260+
ItCrossDomainTransaction.class.getSimpleName() + "/jmsservlet");
237261
distDir = buildApplication(Paths.get(APP_DIR, "jmsservlet"), null, null,
238-
"build", domain1Namespace);
262+
"build", domain1Namespace, targetDir);
239263
logger.info("distDir is {0}", distDir.toString());
240264
assertTrue(Paths.get(distDir.toString(),
241265
"jmsservlet.war").toFile().exists(),
@@ -260,8 +284,10 @@ private static void buildApplicationsAndDomains() {
260284
"Could not modify the domain2Namespace in MDB Template file");
261285

262286
//build application archive for MDB
287+
targetDir = Paths.get(WORK_DIR,
288+
ItCrossDomainTransaction.class.getSimpleName() + "/mdbtopic");
263289
distDir = buildApplication(Paths.get(PROPS_TEMP_DIR, "mdbtopic"), null, null,
264-
"build", domain1Namespace);
290+
"build", domain1Namespace, targetDir);
265291
logger.info("distDir is {0}", distDir.toString());
266292
assertTrue(Paths.get(distDir.toString(),
267293
"mdbtopic.jar").toFile().exists(),
@@ -508,25 +534,13 @@ private static void createDomain(String domainUid, String domainNamespace, Strin
508534
// check admin server pod exists
509535
logger.info("Check for admin server pod {0} existence in namespace {1}",
510536
adminServerPodName, domainNamespace);
511-
checkPodExists(adminServerPodName, domainUid, domainNamespace);
512-
513-
// check managed server pods exist
514-
for (int i = 1; i <= replicaCount; i++) {
515-
logger.info("Check for managed server pod {0} existence in namespace {1}",
516-
managedServerPrefix + i, domainNamespace);
517-
checkPodExists(managedServerPrefix + i, domainUid, domainNamespace);
518-
}
519-
520-
// check admin server pod is ready
521-
logger.info("Wait for admin server pod {0} to be ready in namespace {1}",
522-
adminServerPodName, domainNamespace);
523-
checkPodReady(adminServerPodName, domainUid, domainNamespace);
537+
checkPodReadyAndServiceExists(adminServerPodName, domainUid, domainNamespace);
524538

525539
// check managed server pods are ready
526540
for (int i = 1; i <= replicaCount; i++) {
527541
logger.info("Wait for managed server pod {0} to be ready in namespace {1}",
528542
managedServerPrefix + i, domainNamespace);
529-
checkPodReady(managedServerPrefix + i, domainUid, domainNamespace);
543+
checkPodReadyAndServiceExists(managedServerPrefix + i, domainUid, domainNamespace);
530544
}
531545

532546
logger.info("Check admin service {0} is created in namespace {1}",

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossDomainTransaction.java

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -35,6 +35,7 @@
3535
import oracle.weblogic.kubernetes.utils.ExecResult;
3636
import org.awaitility.core.ConditionFactory;
3737
import org.junit.jupiter.api.BeforeAll;
38+
import org.junit.jupiter.api.BeforeEach;
3839
import org.junit.jupiter.api.DisplayName;
3940
import org.junit.jupiter.api.MethodOrderer;
4041
import org.junit.jupiter.api.Order;
@@ -55,13 +56,14 @@
5556
import static oracle.weblogic.kubernetes.actions.ActionConstants.APP_DIR;
5657
import static oracle.weblogic.kubernetes.actions.ActionConstants.MODEL_DIR;
5758
import static oracle.weblogic.kubernetes.actions.ActionConstants.RESOURCE_DIR;
59+
import static oracle.weblogic.kubernetes.actions.ActionConstants.WORK_DIR;
5860
import static oracle.weblogic.kubernetes.actions.TestActions.addLabelsToNamespace;
5961
import static oracle.weblogic.kubernetes.actions.TestActions.createDomainCustomResource;
6062
import static oracle.weblogic.kubernetes.assertions.TestAssertions.domainExists;
6163
import static oracle.weblogic.kubernetes.utils.ApplicationUtils.checkAppIsActive;
6264
import static oracle.weblogic.kubernetes.utils.ApplicationUtils.checkAppUsingHostHeader;
6365
import static oracle.weblogic.kubernetes.utils.BuildApplication.buildApplication;
64-
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkServiceExists;
66+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodReadyAndServiceExists;
6567
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
6668
import static oracle.weblogic.kubernetes.utils.DbUtils.getDBNodePort;
6769
import static oracle.weblogic.kubernetes.utils.DbUtils.startOracleDB;
@@ -77,7 +79,6 @@
7779
import static oracle.weblogic.kubernetes.utils.IstioUtils.getIstioHttpIngressPort;
7880
import static oracle.weblogic.kubernetes.utils.IstioUtils.isLocalHostBindingsEnabled;
7981
import static oracle.weblogic.kubernetes.utils.OperatorUtils.installAndVerifyOperator;
80-
import static oracle.weblogic.kubernetes.utils.PodUtils.checkPodReady;
8182
import static oracle.weblogic.kubernetes.utils.PodUtils.setPodAntiAffinity;
8283
import static oracle.weblogic.kubernetes.utils.SecretUtils.createSecretWithUsernamePassword;
8384
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
@@ -178,10 +179,26 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
178179

179180
// install and verify operator
180181
installAndVerifyOperator(opNamespace, domain1Namespace, domain2Namespace);
181-
182182
buildApplicationsAndDomains();
183-
184183
}
184+
185+
/**
186+
* Verify all server pods are running.
187+
* Verify k8s services for all servers are created.
188+
*/
189+
@BeforeEach
190+
public void beforeEach() {
191+
int replicaCount = 2;
192+
for (int i = 1; i <= replicaCount; i++) {
193+
checkPodReadyAndServiceExists(domain2ManagedServerPrefix + i,
194+
domainUid2, domain2Namespace);
195+
}
196+
for (int i = 1; i <= replicaCount; i++) {
197+
checkPodReadyAndServiceExists(domain1ManagedServerPrefix + i,
198+
domainUid1, domain1Namespace);
199+
}
200+
}
201+
185202

186203
private static void updatePropertyFile() {
187204
//create a temporary directory to copy and update the properties file
@@ -225,8 +242,11 @@ private static void addToPropertyFile(String propFileName, String domainNamespac
225242
private static void buildApplicationsAndDomains() {
226243

227244
//build application archive
245+
246+
Path targetDir = Paths.get(WORK_DIR,
247+
ItIstioCrossDomainTransaction.class.getSimpleName() + "/txforward");
228248
Path distDir = buildApplication(Paths.get(APP_DIR, "txforward"), null, null,
229-
"build", domain1Namespace);
249+
"build", domain1Namespace, targetDir);
230250
logger.info("distDir is {0}", distDir.toString());
231251
assertTrue(Paths.get(distDir.toString(),
232252
"txforward.ear").toFile().exists(),
@@ -235,6 +255,8 @@ private static void buildApplicationsAndDomains() {
235255
logger.info("Application is in {0}", appSource);
236256

237257
//build application archive
258+
targetDir = Paths.get(WORK_DIR,
259+
ItIstioCrossDomainTransaction.class.getSimpleName() + "/cdtservlet");
238260
distDir = buildApplication(Paths.get(APP_DIR, "cdtservlet"), null, null,
239261
"build", domain1Namespace);
240262
logger.info("distDir is {0}", distDir.toString());
@@ -245,8 +267,10 @@ private static void buildApplicationsAndDomains() {
245267
logger.info("Application is in {0}", appSource1);
246268

247269
//build application archive for JMS Send/Receive
270+
targetDir = Paths.get(WORK_DIR,
271+
ItIstioCrossDomainTransaction.class.getSimpleName() + "/jmsservlet");
248272
distDir = buildApplication(Paths.get(APP_DIR, "jmsservlet"), null, null,
249-
"build", domain1Namespace);
273+
"build", domain1Namespace, targetDir);
250274
logger.info("distDir is {0}", distDir.toString());
251275
assertTrue(Paths.get(distDir.toString(),
252276
"jmsservlet.war").toFile().exists(),
@@ -271,6 +295,8 @@ private static void buildApplicationsAndDomains() {
271295
"Could not modify the domain2Namespace in MDB Template file");
272296

273297
//build application archive for MDB
298+
targetDir = Paths.get(WORK_DIR,
299+
ItIstioCrossDomainTransaction.class.getSimpleName() + "/mdbtopic");
274300
distDir = buildApplication(Paths.get(PROPS_TEMP_DIR, "mdbtopic"), null, null,
275301
"build", domain1Namespace);
276302
logger.info("distDir is {0}", distDir.toString());
@@ -544,27 +570,14 @@ private static void createDomain(String domainUid, String domainNamespace, Strin
544570

545571
logger.info("Check admin service {0} is created in namespace {1}",
546572
adminServerPodName, domainNamespace);
547-
checkServiceExists(adminServerPodName, domainNamespace);
548-
549-
// check admin server pod is ready
550-
logger.info("Wait for admin server pod {0} to be ready in namespace {1}",
551-
adminServerPodName, domainNamespace);
552-
checkPodReady(adminServerPodName, domainUid, domainNamespace);
573+
checkPodReadyAndServiceExists(adminServerPodName, domainUid, domainNamespace);
553574

554575
// check managed server services created
555576
for (int i = 1; i <= replicaCount; i++) {
556577
logger.info("Check managed server service {0} is created in namespace {1}",
557578
managedServerPrefix + i, domainNamespace);
558-
checkServiceExists(managedServerPrefix + i, domainNamespace);
579+
checkPodReadyAndServiceExists(managedServerPrefix + i, domainUid, domainNamespace);
559580
}
560-
561-
// check managed server pods are ready
562-
for (int i = 1; i <= replicaCount; i++) {
563-
logger.info("Wait for managed server pod {0} to be ready in namespace {1}",
564-
managedServerPrefix + i, domainNamespace);
565-
checkPodReady(managedServerPrefix + i, domainUid, domainNamespace);
566-
}
567-
568581
}
569582

570583
private static void createDomainResource(String domainUid, String domNamespace, String adminSecretName,

0 commit comments

Comments
 (0)