|
8 | 8 | import java.io.IOException;
|
9 | 9 | import java.nio.file.Paths;
|
10 | 10 | import java.util.ArrayList;
|
| 11 | +import java.util.Arrays; |
11 | 12 | import java.util.Collections;
|
12 | 13 | import java.util.List;
|
13 | 14 | import java.util.Properties;
|
|
46 | 47 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
|
47 | 48 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getUniqueName;
|
48 | 49 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.verifyConfiguredSystemResource;
|
| 50 | +import static oracle.weblogic.kubernetes.utils.ConfigMapUtils.createConfigMapAndVerify; |
49 | 51 | import static oracle.weblogic.kubernetes.utils.DbUtils.createRcuAccessSecret;
|
50 | 52 | import static oracle.weblogic.kubernetes.utils.DbUtils.createRcuSchema;
|
51 | 53 | import static oracle.weblogic.kubernetes.utils.DbUtils.startOracleDB;
|
@@ -220,7 +222,7 @@ void testFmwDomainOnPvUserCreatesRCU() {
|
220 | 222 | TEST_IMAGES_REPO_SECRET_NAME,
|
221 | 223 | rcuaccessSecretName1,
|
222 | 224 | opsswalletpassSecretName1, null,
|
223 |
| - pvName, pvcName, Collections.singletonList(domainCreationImage1)); |
| 225 | + pvName, pvcName, Collections.singletonList(domainCreationImage1), null); |
224 | 226 |
|
225 | 227 | // create a domain custom resource and verify domain is created
|
226 | 228 | createDomainAndVerify(domain, domainNamespace);
|
@@ -256,7 +258,7 @@ void testFmwDomainOnPvUserProvideOpss() {
|
256 | 258 | TEST_IMAGES_REPO_SECRET_NAME,
|
257 | 259 | rcuaccessSecretName1,
|
258 | 260 | opsswalletpassSecretName1, opsswalletfileSecretName1,
|
259 |
| - pvName, pvcName, Collections.singletonList(domainCreationImage1)); |
| 261 | + pvName, pvcName, Collections.singletonList(domainCreationImage1), null); |
260 | 262 | // create a domain custom resource and verify domain is created
|
261 | 263 | createDomainAndVerify(domain, domainNamespace);
|
262 | 264 |
|
@@ -352,7 +354,103 @@ void testFmwDomainOnPvUserCreatesRCUMultiImages() {
|
352 | 354 | TEST_IMAGES_REPO_SECRET_NAME,
|
353 | 355 | rcuaccessSecretName,
|
354 | 356 | 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); |
356 | 454 |
|
357 | 455 | // create a domain custom resource and verify domain is created
|
358 | 456 | createDomainAndVerify(domain, domainNamespace);
|
@@ -395,7 +493,6 @@ private DomainCreationImage createImage(String fmwModelFile, File fmwModelPropF
|
395 | 493 |
|
396 | 494 | }
|
397 | 495 |
|
398 |
| - |
399 | 496 | private File createWdtPropertyFile(String domainUid, String rcuSchemaPrefix) {
|
400 | 497 |
|
401 | 498 | Properties p = new Properties();
|
|
0 commit comments