Skip to content

Commit f7ea2f8

Browse files
committed
add more jrf usecases
1 parent 883f597 commit f7ea2f8

File tree

2 files changed

+189
-3
lines changed

2 files changed

+189
-3
lines changed

integration-tests/JRFUSECASES.MD

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ Basic Use Cases described above are verified in all the domain configurations. A
4242
| Domain | Use Case |
4343
| --- | --- |
4444
| Domain on PV using WLST | as above in basic use cases |
45-
| Domain with ADMIN_ONLY | making sure only admin server is started and managed servers are not started. Shutdown domain by deleting domain CRD. Create domain on existing PV dir, pv is already populated by a shutdown domain. |
45+
| Domain with ADMIN_ONLY | verify only admin server is started and managed servers are not started. Shutdown domain by deleting domain CRD. Create domain on existing PV dir, pv is already populated by a shutdown domain. |
4646
| Domain with situational config | create domain with listen address not set for admin server and t3 channel/NAP and incorrect file for admin server log location. Introspector should override these with sit-config automatically. Also, with some junk value for t3 channel public address and using custom situational config override replace with valid public address using secret. Also, on Jenkins this domain uses NFS instead of HOSTPATH PV storage |
4747
| Two domains managed by two operators | verify scaling and restart of one domain doesn't impact another domain. Delete domain resources using delete script from samples. |
48+
| Two domains in the same namespace managed by one operator | create two FMW Infra Domains in the same namespace managed by one operator. Verify scaling and restart of one domain doesn't impact another domain. |
49+
| Two domains in the different namespaces managed by one operator | create two FMW Infra Domains in the different namespaces managed by one operator. Domain1 uses VOYAGER load balancer. Domain2 uses TRAEFIK load balancer. Verify scaling and restart of one domain doesn't impact another domain. |
4850
| Domain with Recycle policy | create domain with pvReclaimPolicy="Recycle" and using Configured cluster. Verify that the PV is deleted once the domain and PVC are deleted |
4951
| Domain with default sample values | create domain using mostly default values for inputs |
5052

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

Lines changed: 186 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public void testTwoJRFDomainsManagedByTwoOperators() throws Exception {
160160
Map<String, Object> domain1Map = TestUtils.loadYaml(JRF_DOMAIN_ON_PV_WLST_FILE);
161161
domain1Map.put("domainUID", "jrfdomain1");
162162
domain1Map.put("adminNodePort", 30702);
163-
domain1Map.put("t3ChannelPort", 30023);
163+
domain1Map.put("t3ChannelPort", 30025);
164164
domain1Map.put("voyagerWebPort", 30307);
165165
domain1Map.put("rcuSchemaPrefix", "jrfdomain1");
166166
domain1Map.put("namespace", "default");
@@ -171,7 +171,7 @@ public void testTwoJRFDomainsManagedByTwoOperators() throws Exception {
171171
Map<String, Object> domain2Map = TestUtils.loadYaml(JRF_DOMAIN_ON_PV_WLST_FILE_2);
172172
domain2Map.put("domainUID", "jrfdomain2");
173173
domain2Map.put("adminNodePort", 30703);
174-
domain2Map.put("t3ChannelPort", 30024);
174+
domain2Map.put("t3ChannelPort", 30026);
175175
domain2Map.put("voyagerWebPort", 30308);
176176

177177
// run RCU script to load db schema
@@ -230,6 +230,190 @@ public void testTwoJRFDomainsManagedByTwoOperators() throws Exception {
230230
logger.info("SUCCESS - " + testMethodName);
231231
}
232232

233+
/**
234+
* create two JRF domains in the same namespace and managed by one operator. Verify scaling up and
235+
* down for domain1 cluster will have no impact on domain2. Cycle domain2 down and back up, verify
236+
* there is no impact on domain1. shutdown by the domains using the delete resource script from
237+
* samples.
238+
*
239+
* @throws Exception - if any error occurs
240+
*/
241+
@Test
242+
public void testTwoJRFDomainsManagedByOneOperatorInSameNS() throws Exception {
243+
Assume.assumeFalse(QUICKTEST);
244+
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
245+
logTestBegin(testMethodName);
246+
247+
logger.info("Checking if operator1 and domain1 are running, if not creating");
248+
if (operator1 == null) {
249+
operator1 = TestUtils.createOperator(JRF_OPERATOR_FILE_1);
250+
}
251+
252+
JRFDomain domain1 = null, domain2 = null;
253+
boolean testCompletedSuccessfully = false;
254+
try {
255+
// load input yaml to map and add configOverrides
256+
Map<String, Object> domain1Map = TestUtils.loadYaml(JRF_DOMAIN_ON_PV_WLST_FILE);
257+
domain1Map.put("domainUID", "jrfd1");
258+
domain1Map.put("adminNodePort", 30705);
259+
domain1Map.put("t3ChannelPort", 30023);
260+
domain1Map.put("voyagerWebPort", 30309);
261+
domain1Map.put("rcuSchemaPrefix", "jrfd1");
262+
263+
// run RCU script to load db schema
264+
DBUtils.runRCU(rcuPodName, domain1Map);
265+
266+
Map<String, Object> domain2Map = TestUtils.loadYaml(JRF_DOMAIN_ON_PV_WLST_FILE);
267+
domain2Map.put("domainUID", "jrfd2");
268+
domain2Map.put("adminNodePort", 30706);
269+
domain2Map.put("t3ChannelPort", 30024);
270+
domain2Map.put("voyagerWebPort", 30310);
271+
domain2Map.put("rcuSchemaPrefix", "jrfd2");
272+
273+
// run RCU script to load db schema
274+
DBUtils.runRCU(rcuPodName, domain2Map);
275+
276+
// create domain1
277+
logger.info("Creating Domain domain1 & verifying the domain creation");
278+
domain1 = new JRFDomain(domain1Map);
279+
domain1.verifyDomainCreated();
280+
281+
testBasicUseCases(domain1);
282+
283+
// create domain2
284+
domain2 = new JRFDomain(domain2Map);
285+
domain2.verifyDomainCreated();
286+
287+
testBasicUseCases(domain2);
288+
289+
logger.info("Verify the running domain domain1 is unaffected");
290+
domain1.verifyDomainCreated();
291+
292+
testClusterScaling(operator1, domain1);
293+
294+
logger.info("Verify the running domain domain2 is unaffected");
295+
domain2.verifyDomainCreated();
296+
297+
logger.info("Destroy and create domain2 and verify no impact on domain1");
298+
domain2.destroy();
299+
domain2.create();
300+
301+
logger.info("Verify no impact on domain1");
302+
domain1.verifyDomainCreated();
303+
testCompletedSuccessfully = true;
304+
305+
} finally {
306+
String domainUidsToBeDeleted = "";
307+
308+
if (domain1 != null && (JENKINS || testCompletedSuccessfully)) {
309+
domainUidsToBeDeleted = domain1.getDomainUid();
310+
}
311+
if (domain2 != null && (JENKINS || testCompletedSuccessfully)) {
312+
domainUidsToBeDeleted = domainUidsToBeDeleted + "," + domain2.getDomainUid();
313+
}
314+
if (!domainUidsToBeDeleted.equals("")) {
315+
logger.info("About to delete domains: " + domainUidsToBeDeleted);
316+
TestUtils.deleteWeblogicDomainResources(domainUidsToBeDeleted);
317+
TestUtils.verifyAfterDeletion(domain1);
318+
TestUtils.verifyAfterDeletion(domain2);
319+
}
320+
}
321+
logger.info("SUCCESS - " + testMethodName);
322+
}
323+
324+
/**
325+
* create two JRF domains in the different namespaces and managed by one operator. Domain1 uses
326+
* Voyager load balancer, Domain2 uses Traefik load balancer. Verify scaling up and down for
327+
* domain1 cluster will have no impact on domain2. Cycle domain2 down and back up, verify there is
328+
* no impact on domain1. shutdown by the domains using the delete resource script from samples.
329+
*
330+
* @throws Exception - if any error occurs
331+
*/
332+
@Test
333+
public void testTwoJRFDomainsManagedByOneOperatorInDifferentNS() throws Exception {
334+
Assume.assumeFalse(QUICKTEST);
335+
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
336+
logTestBegin(testMethodName);
337+
338+
logger.info("Checking if operator1 and domain1 are running, if not creating");
339+
if (operator1 == null) {
340+
operator1 = TestUtils.createOperator(JRF_OPERATOR_FILE_1);
341+
}
342+
343+
JRFDomain domain1 = null, domain2 = null;
344+
boolean testCompletedSuccessfully = false;
345+
try {
346+
// load input yaml to map and add configOverrides
347+
Map<String, Object> domain1Map = TestUtils.loadYaml(JRF_DOMAIN_ON_PV_WLST_FILE);
348+
domain1Map.put("domainUID", "jrfd11");
349+
domain1Map.put("adminNodePort", 30707);
350+
domain1Map.put("t3ChannelPort", 30025);
351+
domain1Map.put("voyagerWebPort", 30311);
352+
domain1Map.put("rcuSchemaPrefix", "jrfd11");
353+
domain1Map.put("namespace", "default");
354+
domain1Map.put("loadBalancer", "VOYAGER");
355+
356+
// run RCU script to load db schema
357+
DBUtils.runRCU(rcuPodName, domain1Map);
358+
359+
Map<String, Object> domain2Map = TestUtils.loadYaml(JRF_DOMAIN_ON_PV_WLST_FILE);
360+
domain2Map.put("domainUID", "jrfd21");
361+
domain2Map.put("adminNodePort", 30708);
362+
domain2Map.put("t3ChannelPort", 30026);
363+
domain2Map.put("voyagerWebPort", 30312);
364+
domain2Map.put("rcuSchemaPrefix", "jrfd21");
365+
366+
// run RCU script to load db schema
367+
DBUtils.runRCU(rcuPodName, domain2Map);
368+
369+
// create domain1
370+
logger.info("Creating Domain domain1 & verifying the domain creation");
371+
domain1 = new JRFDomain(domain1Map);
372+
domain1.verifyDomainCreated();
373+
374+
testBasicUseCases(domain1);
375+
376+
// create domain2
377+
domain2 = new JRFDomain(domain2Map);
378+
domain2.verifyDomainCreated();
379+
380+
testBasicUseCases(domain2);
381+
382+
logger.info("Verify the running domain domain1 is unaffected");
383+
domain1.verifyDomainCreated();
384+
385+
testClusterScaling(operator1, domain1);
386+
387+
logger.info("Verify the running domain domain2 is unaffected");
388+
domain2.verifyDomainCreated();
389+
390+
logger.info("Destroy and create domain2 and verify no impact on domain1");
391+
domain2.destroy();
392+
domain2.create();
393+
394+
logger.info("Verify no impact on domain1");
395+
domain1.verifyDomainCreated();
396+
testCompletedSuccessfully = true;
397+
398+
} finally {
399+
String domainUidsToBeDeleted = "";
400+
401+
if (domain1 != null && (JENKINS || testCompletedSuccessfully)) {
402+
domainUidsToBeDeleted = domain1.getDomainUid();
403+
}
404+
if (domain2 != null && (JENKINS || testCompletedSuccessfully)) {
405+
domainUidsToBeDeleted = domainUidsToBeDeleted + "," + domain2.getDomainUid();
406+
}
407+
if (!domainUidsToBeDeleted.equals("")) {
408+
logger.info("About to delete domains: " + domainUidsToBeDeleted);
409+
TestUtils.deleteWeblogicDomainResources(domainUidsToBeDeleted);
410+
TestUtils.verifyAfterDeletion(domain1);
411+
TestUtils.verifyAfterDeletion(domain2);
412+
}
413+
}
414+
logger.info("SUCCESS - " + testMethodName);
415+
}
416+
233417
/**
234418
* Create operator if its not running and create domain with serverStartPolicy="ADMIN_ONLY".
235419
* Verify only admin server is created. shutdown by deleting domain CRD. Create domain on existing

0 commit comments

Comments
 (0)