Skip to content

Commit b34f897

Browse files
committed
Merge branch 'jrfconmap' into 'main'
JRF Domain on PV: Additional WDT models provided using WDT config map See merge request weblogic-cloud/weblogic-kubernetes-operator!4259
2 parents 442e6a9 + ae1357b commit b34f897

File tree

2 files changed

+104
-5
lines changed

2 files changed

+104
-5
lines changed

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

Lines changed: 101 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.io.IOException;
99
import java.nio.file.Paths;
1010
import java.util.ArrayList;
11+
import java.util.Arrays;
1112
import java.util.Collections;
1213
import java.util.List;
1314
import java.util.Properties;
@@ -46,6 +47,7 @@
4647
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
4748
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getUniqueName;
4849
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.verifyConfiguredSystemResource;
50+
import static oracle.weblogic.kubernetes.utils.ConfigMapUtils.createConfigMapAndVerify;
4951
import static oracle.weblogic.kubernetes.utils.DbUtils.createRcuAccessSecret;
5052
import static oracle.weblogic.kubernetes.utils.DbUtils.createRcuSchema;
5153
import static oracle.weblogic.kubernetes.utils.DbUtils.startOracleDB;
@@ -220,7 +222,7 @@ void testFmwDomainOnPvUserCreatesRCU() {
220222
TEST_IMAGES_REPO_SECRET_NAME,
221223
rcuaccessSecretName1,
222224
opsswalletpassSecretName1, null,
223-
pvName, pvcName, Collections.singletonList(domainCreationImage1));
225+
pvName, pvcName, Collections.singletonList(domainCreationImage1), null);
224226

225227
// create a domain custom resource and verify domain is created
226228
createDomainAndVerify(domain, domainNamespace);
@@ -256,7 +258,7 @@ void testFmwDomainOnPvUserProvideOpss() {
256258
TEST_IMAGES_REPO_SECRET_NAME,
257259
rcuaccessSecretName1,
258260
opsswalletpassSecretName1, opsswalletfileSecretName1,
259-
pvName, pvcName, Collections.singletonList(domainCreationImage1));
261+
pvName, pvcName, Collections.singletonList(domainCreationImage1), null);
260262
// create a domain custom resource and verify domain is created
261263
createDomainAndVerify(domain, domainNamespace);
262264

@@ -352,7 +354,103 @@ void testFmwDomainOnPvUserCreatesRCUMultiImages() {
352354
TEST_IMAGES_REPO_SECRET_NAME,
353355
rcuaccessSecretName,
354356
opsswalletpassSecretName, null,
355-
pvName, pvcName, domainCreationImages);
357+
pvName, pvcName, domainCreationImages, null);
358+
359+
// create a domain custom resource and verify domain is created
360+
createDomainAndVerify(domain, domainNamespace);
361+
362+
// verify that all servers are ready
363+
verifyDomainReady(domainNamespace, domainUid, replicaCount, "nosuffix");
364+
365+
//create router for admin service on OKD
366+
String adminServerPodName = domainUid + "-admin-server";
367+
String adminSvcExtHost = createRouteForOKD(getExternalServicePodName(adminServerPodName), domainNamespace);
368+
logger.info("admin svc host = {0}", adminSvcExtHost);
369+
370+
// check configuration for JMS
371+
checkConfiguredJMSresouce(domainNamespace, adminServerPodName, adminSvcExtHost);
372+
373+
// delete the domain
374+
deleteDomainResource(domainNamespace, domainUid);
375+
//delete the rcu pod
376+
assertDoesNotThrow(() -> deletePod("rcu", dbNamespace),
377+
"Got exception while deleting server " + "rcu");
378+
checkPodDoesNotExist("rcu", null, dbNamespace);
379+
380+
}
381+
382+
383+
/**
384+
* User creates RCU, Operate creates PV/PVC and FMW domain with additional WDT config map.
385+
* Verify Pod is ready and service exists for both admin server and managed servers.
386+
*/
387+
@Test
388+
@Order(4)
389+
@DisplayName("Create a FMW domain on PV with multiple images when user per-creates RCU")
390+
void testFmwDomainOnPvUserCreatesRCUwdtConfigMap() {
391+
String domainUid = "jrfdomainonpv-userrcu4";
392+
String adminSecretName = domainUid + "-weblogic-credentials";
393+
String rcuaccessSecretName = domainUid + "-rcu-credentials";
394+
String opsswalletpassSecretName = domainUid + "-opss-wallet-password-secret";
395+
final String pvName = getUniqueName(domainUid + "-pv-");
396+
final String pvcName = getUniqueName(domainUid + "-pvc-");
397+
398+
//create RCU schema
399+
assertDoesNotThrow(() -> createRcuSchema(FMWINFRA_IMAGE_TO_USE_IN_SPEC, RCUSCHEMAPREFIX + "4",
400+
dbUrl, dbNamespace), "create RCU schema failed");
401+
402+
// create a model property file
403+
File fmwModelPropFile = createWdtPropertyFile(domainUid, RCUSCHEMAPREFIX + "4");
404+
405+
// Create the repo secret to pull the image
406+
// this secret is used only for non-kind cluster
407+
createTestRepoSecret(domainNamespace);
408+
409+
// create secret for admin credentials
410+
logger.info("Create secret for admin credentials");
411+
assertDoesNotThrow(() -> createSecretWithUsernamePassword(
412+
adminSecretName,
413+
domainNamespace,
414+
ADMIN_USERNAME_DEFAULT,
415+
ADMIN_PASSWORD_DEFAULT),
416+
String.format("createSecret failed for %s", adminSecretName));
417+
418+
// create RCU access secret
419+
logger.info("Creating RCU access secret: {0}, with prefix: {1}, dbUrl: {2}, schemapassword: {3})",
420+
rcuaccessSecretName, RCUSCHEMAPREFIX + "4", RCUSCHEMAPASSWORD, dbUrl);
421+
assertDoesNotThrow(() -> createRcuAccessSecret(
422+
rcuaccessSecretName,
423+
domainNamespace,
424+
RCUSCHEMAPREFIX + "4",
425+
RCUSCHEMAPASSWORD,
426+
dbUrl),
427+
String.format("createSecret failed for %s", rcuaccessSecretName));
428+
429+
logger.info("Create OPSS wallet password secret");
430+
assertDoesNotThrow(() -> createOpsswalletpasswordSecret(
431+
opsswalletpassSecretName,
432+
domainNamespace,
433+
ADMIN_PASSWORD_DEFAULT),
434+
String.format("createSecret failed for %s", opsswalletpassSecretName));
435+
436+
DomainCreationImage domainCreationImage1 = createImage(fmwModelFile,fmwModelPropFile,"jrf4");
437+
List<DomainCreationImage> domainCreationImages = new ArrayList<>();
438+
domainCreationImages.add(domainCreationImage1);
439+
440+
logger.info("create WDT configMap with jms model");
441+
String configMapName = "jmsconfigmap";
442+
createConfigMapAndVerify(
443+
configMapName, domainUid, domainNamespace,
444+
Arrays.asList(MODEL_DIR + "/model.jms2.yaml"));
445+
446+
// create a domain custom resource configuration object
447+
logger.info("Creating domain custom resource with pvName: {0}", pvName);
448+
DomainResource domain = createDomainResourceSimplifyJrfPv(
449+
domainUid, domainNamespace, adminSecretName,
450+
TEST_IMAGES_REPO_SECRET_NAME,
451+
rcuaccessSecretName,
452+
opsswalletpassSecretName, null,
453+
pvName, pvcName, domainCreationImages, configMapName);
356454

357455
// create a domain custom resource and verify domain is created
358456
createDomainAndVerify(domain, domainNamespace);
@@ -395,7 +493,6 @@ private DomainCreationImage createImage(String fmwModelFile, File fmwModelPropF
395493

396494
}
397495

398-
399496
private File createWdtPropertyFile(String domainUid, String rcuSchemaPrefix) {
400497

401498
Properties p = new Properties();

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/FmwUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ public static DomainResource createDomainResourceSimplifyJrfPv(
363363
String repoSecretName, String rcuAccessSecretName, String opssWalletPasswordSecretName,
364364
String opssWalletFileSecretName,
365365
String pvName, String pvcName,
366-
List<DomainCreationImage> domainCreationImages) {
366+
List<DomainCreationImage> domainCreationImages,
367+
String domainCreationConfigMap) {
367368

368369
Map<String, Quantity> capacity = new HashMap<>();
369370
capacity.put("storage", Quantity.fromString("10Gi"));
@@ -444,6 +445,7 @@ public static DomainResource createDomainResourceSimplifyJrfPv(
444445
.createMode(CreateIfNotExists.DOMAIN)
445446
.domainType(DomainOnPVType.JRF)
446447
.domainCreationImages(domainCreationImages)
448+
.domainCreationConfigMap(domainCreationConfigMap)
447449
.opss(new Opss()
448450
.walletPasswordSecret(opssWalletPasswordSecretName)
449451
.walletFileSecret(opssWalletFileSecretName))

0 commit comments

Comments
 (0)