6565import static oracle .weblogic .kubernetes .actions .TestActions .getJob ;
6666import static oracle .weblogic .kubernetes .actions .TestActions .getPodLog ;
6767import static oracle .weblogic .kubernetes .actions .TestActions .listPods ;
68+ import static oracle .weblogic .kubernetes .actions .TestActions .scaleCluster ;
6869import static oracle .weblogic .kubernetes .assertions .TestAssertions .jobCompleted ;
70+ import static oracle .weblogic .kubernetes .utils .CommonPatchTestUtils .patchServerStartPolicy ;
6971import static oracle .weblogic .kubernetes .utils .CommonTestUtils .checkAppUsingHostHeader ;
72+ import static oracle .weblogic .kubernetes .utils .CommonTestUtils .checkPodDeleted ;
7073import static oracle .weblogic .kubernetes .utils .CommonTestUtils .checkPodReady ;
7174import static oracle .weblogic .kubernetes .utils .CommonTestUtils .checkServiceExists ;
7275import static oracle .weblogic .kubernetes .utils .CommonTestUtils .createDomainAndVerify ;
@@ -139,7 +142,6 @@ public static void initAll(@Namespaces(2) List<String> namespaces) {
139142
140143 // install operator and verify its running in ready state
141144 installAndVerifyOperator (opNamespace , domainNamespace );
142-
143145 }
144146
145147 /**
@@ -148,6 +150,8 @@ public static void initAll(@Namespaces(2) List<String> namespaces) {
148150 * Deploy istio gateways and virtual service.
149151 * Verify domain pods runs in ready state and services are created.
150152 * Verify login to WebLogic console is successful thru istio ingress Port.
153+ * Additionally, the test verifies that WebLogic cluster can be scaled down
154+ * and scaled up in the absence of Administration server.
151155 */
152156 @ Test
153157 @ DisplayName ("Create WebLogic domain in PV with Istio" )
@@ -324,6 +328,35 @@ public void testIstioDomainHomeInPv() {
324328 boolean checkApp = checkAppUsingHostHeader (url , domainNamespace + ".org" );
325329 assertTrue (checkApp , "Failed to access WebLogic application" );
326330
331+ // Refer JIRA https://jira.oraclecorp.com/jira/browse/OWLS-86407
332+ // Stop and Start the managed server in absense of administration server
333+ assertTrue (patchServerStartPolicy (domainUid , domainNamespace ,
334+ "/spec/adminServer/serverStartPolicy" , "NEVER" ),
335+ "Failed to patch administrationi server serverStartPolicy to NEVER" );
336+ logger .info ("Domain is patched to shutdown administration server" );
337+ checkPodDeleted (adminServerPodName , domainUid , domainNamespace );
338+ logger .info ("Administration server shutdown success" );
339+
340+ boolean scalingSuccess = assertDoesNotThrow (() ->
341+ scaleCluster (domainUid , domainNamespace , "cluster-1" , 1 ),
342+ String .format ("Scaling down cluster cluster-1 of domain %s in namespace %s failed" ,
343+ domainUid , domainNamespace ));
344+ assertTrue (scalingSuccess ,
345+ String .format ("Cluster scaling failed for domain %s in namespace %s" , domainUid , domainNamespace ));
346+ logger .info ("Cluster is scaled down in absense of administration server" );
347+ checkPodDeleted (managedServerPodNamePrefix + "2" , domainUid , domainNamespace );
348+ logger .info ("Managed Server stopped in absense of administration server" );
349+
350+ scalingSuccess = assertDoesNotThrow (() ->
351+ scaleCluster (domainUid , domainNamespace , "cluster-1" , 2 ),
352+ String .format ("Scaling up cluster cluster-1 of domain %s in namespace %s failed" ,
353+ domainUid , domainNamespace ));
354+ assertTrue (scalingSuccess ,
355+ String .format ("Cluster scaling failed for domain %s in namespace %s" , domainUid , domainNamespace ));
356+ logger .info ("Cluster is scaled up in absense of administration server" );
357+ checkServiceExists (managedServerPodNamePrefix + "2" , domainNamespace );
358+ checkPodReady (managedServerPodNamePrefix + "2" , domainUid , domainNamespace );
359+ logger .info ("Managed Server started in absense of administration server" );
327360 }
328361
329362 /**
0 commit comments