35
35
import oracle .weblogic .kubernetes .logging .LoggingFacade ;
36
36
import oracle .weblogic .kubernetes .utils .DomainUtils ;
37
37
import oracle .weblogic .kubernetes .utils .ExecResult ;
38
- import org .awaitility .core .ConditionFactory ;
39
38
import org .junit .jupiter .api .BeforeAll ;
40
39
import org .junit .jupiter .api .DisplayName ;
41
40
import org .junit .jupiter .api .Test ;
42
41
import org .junit .jupiter .params .ParameterizedTest ;
43
42
import org .junit .jupiter .params .provider .ValueSource ;
44
43
45
44
import static java .nio .file .Paths .get ;
46
- import static java .util .concurrent .TimeUnit .MINUTES ;
47
- import static java .util .concurrent .TimeUnit .SECONDS ;
48
45
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_PASSWORD_DEFAULT ;
49
46
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_SERVER_NAME_BASE ;
50
47
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_USERNAME_DEFAULT ;
109
106
import static oracle .weblogic .kubernetes .utils .PodUtils .setPodAntiAffinity ;
110
107
import static oracle .weblogic .kubernetes .utils .SecretUtils .createSecretWithUsernamePassword ;
111
108
import static oracle .weblogic .kubernetes .utils .ThreadSafeLogger .getLogger ;
112
- import static org .assertj .core .api .Assertions .assertThat ;
113
- import static org .awaitility .Awaitility .with ;
114
109
import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
115
110
import static org .junit .jupiter .api .Assertions .assertFalse ;
116
111
import static org .junit .jupiter .api .Assertions .assertNotEquals ;
@@ -145,11 +140,11 @@ class ItMultiDomainModelsWithLoadBalancer {
145
140
private static final String WLDF_OPENSESSION_APP_CONTEXT_ROOT = "opensession" ;
146
141
private static final String wlSecretName = "weblogic-credentials" ;
147
142
private static final String DATA_HOME_OVERRIDE = "/u01/mydata" ;
148
- private static final String miiImageName = "mii-image" ;
143
+ private static final String miiImageName = "mdlb- mii-image" ;
149
144
private static final String wdtModelFileForMiiDomain = "model-multiclusterdomain-sampleapp-wls.yaml" ;
150
- private static final String miiDomainUid = "miidomain" ;
151
- private static final String dimDomainUid = "domaininimage" ;
152
- private static final String domainOnPVUid = "domainonpv" ;
145
+ private static final String miiDomainUid = "mdlb- miidomain" ;
146
+ private static final String dimDomainUid = "mdlb- domaininimage" ;
147
+ private static final String domainOnPVUid = "mdlb- domainonpv" ;
153
148
private static final String wdtModelFileForDomainInImage = "wdt-singlecluster-multiapps-usingprop-wls.yaml" ;
154
149
155
150
private static String opNamespace = null ;
@@ -167,11 +162,6 @@ class ItMultiDomainModelsWithLoadBalancer {
167
162
private static String encryptionSecretName = "encryptionsecret" ;
168
163
private String curlCmd = null ;
169
164
170
- private ConditionFactory withStandardRetryPolicy =
171
- with ().pollDelay (1 , SECONDS )
172
- .and ().with ().pollInterval (5 , SECONDS )
173
- .atMost (1 , MINUTES ).await ();
174
-
175
165
/**
176
166
* Install operator and NGINX.
177
167
* Create three different type of domains: model in image, domain in PV and domain in image.
@@ -418,7 +408,6 @@ void testLivenessProbe() {
418
408
String domainNamespace = domain .getMetadata ().getNamespace ();
419
409
int numClusters = domain .getSpec ().getClusters ().size ();
420
410
421
- String serverName ;
422
411
String serverNamePrefix ;
423
412
if (numClusters > 1 ) {
424
413
serverNamePrefix = domainUid + "-" + clusterName + "-" + MANAGED_SERVER_NAME_BASE ;
@@ -503,10 +492,10 @@ void testLivenessProbe() {
503
492
logger .info ("Accessing the sample app through NGINX load balancer" );
504
493
String curlCmd = generateCurlCmd (domainUid , domainNamespace , clusterName , SAMPLE_APP_CONTEXT_ROOT );
505
494
List <String > managedServers = listManagedServersBeforeScale (numClusters , clusterName , replicaCount );
506
- assertThat ( callWebAppAndCheckForServerNameInResponse (curlCmd , managedServers , 20 ))
507
- . as ( "Verify NGINX can access the test web app from all managed servers in the domain" )
508
- . withFailMessage ( "NGINX can not access the test web app from one or more of the managed servers" )
509
- . isTrue ( );
495
+ testUntil (() -> callWebAppAndCheckForServerNameInResponse (curlCmd , managedServers , 20 ),
496
+ logger ,
497
+ "NGINX can access the test web app from all managed servers {0} in the domain" ,
498
+ managedServers );
510
499
511
500
// shutdown domain and verify the domain is shutdown
512
501
shutdownDomainAndVerify (domainNamespace , domainUid , replicaCount );
@@ -879,6 +868,21 @@ private static Domain createDomainOnPvUsingWdt(String domainUid, String domainNa
879
868
domainNamespace );
880
869
}
881
870
871
+ // check that admin server pod is ready and service exists in domain namespace
872
+ logger .info ("Checking that admin server pod {0} is ready and service exists in namespace {1}" ,
873
+ adminServerPodName , domainNamespace );
874
+ checkPodReadyAndServiceExists (adminServerPodName , domainUid , domainNamespace );
875
+
876
+ // check the readiness for the managed servers in each cluster
877
+ for (int j = 1 ; j <= replicaCount ; j ++) {
878
+ String managedServerPodName = domainUid + "-" + MANAGED_SERVER_NAME_BASE + j ;
879
+
880
+ // check managed server pod is ready and service exists in the namespace
881
+ logger .info ("Checking that managed server pod {0} is ready and service exists in namespace {1}" ,
882
+ managedServerPodName , domainNamespace );
883
+ checkPodReadyAndServiceExists (managedServerPodName , domainUid , domainNamespace );
884
+ }
885
+
882
886
return domain ;
883
887
}
884
888
@@ -1245,7 +1249,12 @@ private void verifyAdminConsoleLoginUsingIngressController(String domainUid, Str
1245
1249
+ "/console/login/LoginForm.jsp --write-out %{http_code} -o /dev/null" ;
1246
1250
1247
1251
logger .info ("Executing curl command {0}" , curlCmd );
1248
- assertTrue (callWebAppAndWaitTillReady (curlCmd , 60 ));
1252
+ testUntil (() -> callWebAppAndWaitTillReady (curlCmd , 5 ),
1253
+ logger ,
1254
+ "WebLogic console on domain {0} in namespace {1} is accessible" ,
1255
+ domainUid ,
1256
+ domainNamespace );
1257
+
1249
1258
logger .info ("WebLogic console on domain1 is accessible" );
1250
1259
} else {
1251
1260
logger .info ("Skipping the admin console login test using ingress controller in OKD environment" );
0 commit comments