@@ -229,6 +229,87 @@ public void testTwoDomainsManagedByTwoOperators() throws Exception {
229
229
}
230
230
logger .info ("SUCCESS - " + testMethodName );
231
231
}
232
+
233
+ /**
234
+ * Create one operator if it is not running. Create domain domain1 and domain2 dynamic cluster in
235
+ * default namespace, managed by operator. Both domains sharre one PV. Verify scaling for domain2
236
+ * cluster from 2 to 3 servers and back to 2, plus verify no impact on domain1. Cycle domain1 down
237
+ * and back up, plus verify no impact on domain2. shutdown by the domains using the delete
238
+ * resource script from samples.
239
+ *
240
+ * <p>ToDo: configured cluster support is removed from samples, modify the test to create
241
+ *
242
+ * @throws Exception
243
+ */
244
+ @ Test
245
+ public void testTwoDomainsManagedByOneOperatorSharingPV () throws Exception {
246
+ Assume .assumeFalse (QUICKTEST );
247
+ String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
248
+ logTestBegin (testMethodName );
249
+ logger .info ("Creating Domain domain1 & verifing the domain creation" );
250
+
251
+ logger .info ("Checking if operator1 and domain1 are running, if not creating" );
252
+ if (operator1 == null ) {
253
+ operator1 = TestUtils .createOperator (OPERATOR1_YAML );
254
+ }
255
+
256
+ Domain domain1 = null , domain2 = null ;
257
+ boolean testCompletedSuccessfully = false ;
258
+ try {
259
+ // load input yaml to map and add configOverrides
260
+ Map <String , Object > domain1Map = TestUtils .loadYaml (DOMAINONSHARINGPV_WLST_YAML );
261
+ domain1Map .put ("domainUID" , "d1onpv" );
262
+ domain1Map .put ("adminNodePort" , new Integer ("30711" ));
263
+ domain1Map .put ("t3ChannelPort" , new Integer ("30011" ));
264
+ domain1Map .put ("voyagerWebPort" , new Integer ("30388" ));
265
+ domain1 = TestUtils .createDomain (domain1Map );
266
+ domain1 .verifyDomainCreated ();
267
+ testBasicUseCases (domain1 );
268
+
269
+ Map <String , Object > domain2Map = TestUtils .loadYaml (DOMAINONSHARINGPV_WLST_YAML );
270
+ domain2Map .put ("domainUID" , "d2onpv" );
271
+ domain2Map .put ("adminNodePort" , new Integer ("30712" ));
272
+ domain2Map .put ("t3ChannelPort" , new Integer ("30021" ));
273
+ // wdtDomainMap.put("clusterType", "Configured");
274
+ domain2Map .put ("voyagerWebPort" , new Integer ("30399" ));
275
+ domain2 = TestUtils .createDomain (domain2Map );
276
+ domain2 .verifyDomainCreated ();
277
+ testBasicUseCases (domain2 );
278
+ logger .info ("Verify the only remaining running domain domain1 is unaffected" );
279
+ domain1 .verifyDomainCreated ();
280
+
281
+ testClusterScaling (operator1 , domain2 );
282
+
283
+ logger .info ("Verify the only remaining running domain domain1 is unaffected" );
284
+ domain1 .verifyDomainCreated ();
285
+
286
+ logger .info ("Destroy and create domain1 and verify no impact on domain2" );
287
+ domain1 .destroy ();
288
+ domain1 .create ();
289
+
290
+ logger .info ("Verify no impact on domain2" );
291
+ domain2 .verifyDomainCreated ();
292
+ testCompletedSuccessfully = true ;
293
+
294
+ } finally {
295
+ String domainUidsToBeDeleted = "" ;
296
+
297
+ if (domain1 != null && (JENKINS || testCompletedSuccessfully )) {
298
+ domainUidsToBeDeleted = domain1 .getDomainUid ();
299
+ }
300
+ if (domain2 != null && (JENKINS || testCompletedSuccessfully )) {
301
+ domainUidsToBeDeleted = domainUidsToBeDeleted + "," + domain2 .getDomainUid ();
302
+ }
303
+ if (!domainUidsToBeDeleted .equals ("" )) {
304
+ logger .info ("About to delete domains: " + domainUidsToBeDeleted );
305
+ TestUtils .deleteWeblogicDomainResources (domainUidsToBeDeleted );
306
+ TestUtils .verifyAfterDeletion (domain1 );
307
+ TestUtils .verifyAfterDeletion (domain2 );
308
+ }
309
+ }
310
+ logger .info ("SUCCESS - " + testMethodName );
311
+ }
312
+
232
313
/**
233
314
* Create operator if its not running and create domain with serverStartPolicy="ADMIN_ONLY".
234
315
* Verify only admin server is created. shutdown by deleting domain CRD. Create domain on existing
0 commit comments