Skip to content

Commit c931b27

Browse files
committed
Remove unnecessary changes
1 parent 82de7bb commit c931b27

16 files changed

+190
-310
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLogging.java

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
package oracle.weblogic.kubernetes;
55

6-
import java.util.ArrayList;
7-
import java.util.Collections;
86
import java.util.HashMap;
97
import java.util.List;
108
import java.util.Map;
@@ -18,13 +16,15 @@
1816
import oracle.weblogic.kubernetes.annotations.Namespaces;
1917
import oracle.weblogic.kubernetes.logging.LoggingFacade;
2018
import oracle.weblogic.kubernetes.utils.ExecResult;
19+
import org.awaitility.core.ConditionFactory;
2120
import org.junit.jupiter.api.AfterAll;
2221
import org.junit.jupiter.api.BeforeAll;
2322
import org.junit.jupiter.api.Disabled;
2423
import org.junit.jupiter.api.DisplayName;
2524
import org.junit.jupiter.api.Test;
26-
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
2725

26+
import static java.util.concurrent.TimeUnit.MINUTES;
27+
import static java.util.concurrent.TimeUnit.SECONDS;
2828
import static oracle.weblogic.kubernetes.TestConstants.COPY_WLS_LOGGING_EXPORTER_FILE_NAME;
2929
import static oracle.weblogic.kubernetes.TestConstants.ELASTICSEARCH_HTTPS_PORT;
3030
import static oracle.weblogic.kubernetes.TestConstants.ELASTICSEARCH_HTTP_PORT;
@@ -37,13 +37,11 @@
3737
import static oracle.weblogic.kubernetes.TestConstants.KIBANA_TYPE;
3838
import static oracle.weblogic.kubernetes.TestConstants.LOGSTASH_INDEX_KEY;
3939
import static oracle.weblogic.kubernetes.TestConstants.MII_BASIC_APP_NAME;
40-
import static oracle.weblogic.kubernetes.TestConstants.OKD;
4140
import static oracle.weblogic.kubernetes.TestConstants.OPERATOR_CHART_DIR;
4241
import static oracle.weblogic.kubernetes.TestConstants.OPERATOR_RELEASE_NAME;
4342
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_INDEX_KEY;
4443
import static oracle.weblogic.kubernetes.TestConstants.WLS_LOGGING_EXPORTER_YAML_FILE_NAME;
4544
import static oracle.weblogic.kubernetes.actions.ActionConstants.DOWNLOAD_DIR;
46-
import static oracle.weblogic.kubernetes.actions.ActionConstants.MODEL_DIR;
4745
import static oracle.weblogic.kubernetes.actions.ActionConstants.RESOURCE_DIR;
4846
import static oracle.weblogic.kubernetes.actions.ActionConstants.SNAKE_DOWNLOADED_FILENAME;
4947
import static oracle.weblogic.kubernetes.actions.ActionConstants.WLE_DOWNLOAD_FILENAME_DEFAULT;
@@ -53,7 +51,6 @@
5351
import static oracle.weblogic.kubernetes.assertions.TestAssertions.operatorIsReady;
5452
import static oracle.weblogic.kubernetes.utils.CommonMiiTestUtils.createMiiDomainAndVerify;
5553
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil;
56-
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.withStandardRetryPolicy;
5754
import static oracle.weblogic.kubernetes.utils.ImageUtils.createMiiImageAndVerify;
5855
import static oracle.weblogic.kubernetes.utils.ImageUtils.createOcirRepoSecret;
5956
import static oracle.weblogic.kubernetes.utils.ImageUtils.dockerLoginAndPushImageToRegistry;
@@ -66,6 +63,7 @@
6663
import static oracle.weblogic.kubernetes.utils.OperatorUtils.installAndVerifyOperator;
6764
import static oracle.weblogic.kubernetes.utils.OperatorUtils.upgradeAndVerifyOperator;
6865
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
66+
import static org.awaitility.Awaitility.with;
6967
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
7068
import static org.junit.jupiter.api.Assertions.assertFalse;
7169
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -111,6 +109,7 @@ class ItElasticLogging {
111109

112110
private static String opNamespace = null;
113111
private static String domainNamespace = null;
112+
private static ConditionFactory withStandardRetryPolicy = null;
114113

115114
private static LoggingExporterParams elasticsearchParams = null;
116115
private static LoggingExporterParams kibanaParams = null;
@@ -132,6 +131,10 @@ class ItElasticLogging {
132131
@BeforeAll
133132
public static void init(@Namespaces(3) List<String> namespaces) {
134133
logger = getLogger();
134+
// create standard, reusable retry/backoff policy
135+
withStandardRetryPolicy = with().pollDelay(2, SECONDS)
136+
.and().with().pollInterval(10, SECONDS)
137+
.atMost(5, MINUTES).await();
135138

136139
// get a new unique opNamespace
137140
logger.info("Assigning a unique namespace for Operator");
@@ -186,9 +189,7 @@ public static void init(@Namespaces(3) List<String> namespaces) {
186189
opNamespace);
187190

188191
// install WebLogic Logging Exporter if in non-OKD env
189-
if (!OKD) {
190-
installAndVerifyWlsLoggingExporter(managedServerFilter, wlsLoggingExporterYamlFileLoc, elasticSearchNs);
191-
}
192+
installAndVerifyWlsLoggingExporter(managedServerFilter, wlsLoggingExporterYamlFileLoc, elasticSearchNs);
192193

193194
// create and verify WebLogic domain image using model in image with model files
194195
String imageName = createAndVerifyDomainImage();
@@ -305,7 +306,6 @@ void testWebLogicLogSearch() {
305306
*/
306307
@Test
307308
@DisplayName("Use Elasticsearch Search APIs to query WebLogic log info in WLS server pod and verify")
308-
@DisabledIfEnvironmentVariable(named = "OKD", matches = "true")
309309
void testWlsLoggingExporter() throws Exception {
310310
Map<String, String> wlsMap = verifyLoggingExporterReady(opNamespace, elasticSearchNs, null, WEBLOGIC_INDEX_KEY);
311311
// merge testVarMap and wlsMap
@@ -340,38 +340,24 @@ void testWlsLoggingExporter() throws Exception {
340340
}
341341

342342
private static String createAndVerifyDomainImage() {
343-
String miiImage = null;
344-
345343
// create image with model files
346-
if (!OKD) {
347-
String additionalBuildCommands = WORK_DIR + "/" + COPY_WLS_LOGGING_EXPORTER_FILE_NAME;
348-
StringBuffer additionalBuildFilesVarargsBuff = new StringBuffer()
349-
.append(WORK_DIR)
350-
.append("/")
351-
.append(WLS_LOGGING_EXPORTER_YAML_FILE_NAME)
352-
.append(",")
353-
.append(DOWNLOAD_DIR)
354-
.append("/")
355-
.append(WLE_DOWNLOAD_FILENAME_DEFAULT)
356-
.append(",")
357-
.append(DOWNLOAD_DIR)
358-
.append("/")
359-
.append(SNAKE_DOWNLOADED_FILENAME);
360-
361-
logger.info("Create image with model file and verify");
362-
miiImage = createMiiImageAndVerify(WLS_LOGGING_IMAGE_NAME, WLS_LOGGING_MODEL_FILE,
363-
MII_BASIC_APP_NAME, additionalBuildCommands, additionalBuildFilesVarargsBuff.toString());
364-
} else {
365-
List<String> appList = new ArrayList();
366-
appList.add(MII_BASIC_APP_NAME);
367-
368-
// build the model file list
369-
final List<String> modelList = Collections.singletonList(MODEL_DIR + "/" + WLS_LOGGING_MODEL_FILE);
344+
String additionalBuildCommands = WORK_DIR + "/" + COPY_WLS_LOGGING_EXPORTER_FILE_NAME;
345+
StringBuffer additionalBuildFilesVarargsBuff = new StringBuffer()
346+
.append(WORK_DIR)
347+
.append("/")
348+
.append(WLS_LOGGING_EXPORTER_YAML_FILE_NAME)
349+
.append(",")
350+
.append(DOWNLOAD_DIR)
351+
.append("/")
352+
.append(WLE_DOWNLOAD_FILENAME_DEFAULT)
353+
.append(",")
354+
.append(DOWNLOAD_DIR)
355+
.append("/")
356+
.append(SNAKE_DOWNLOADED_FILENAME);
370357

371-
// create image with model files
372-
logger.info("Create image with model file and verify");
373-
miiImage = createMiiImageAndVerify(WLS_LOGGING_IMAGE_NAME, modelList, appList);
374-
}
358+
logger.info("Create image with model file and verify");
359+
String miiImage = createMiiImageAndVerify(WLS_LOGGING_IMAGE_NAME, WLS_LOGGING_MODEL_FILE,
360+
MII_BASIC_APP_NAME, additionalBuildCommands, additionalBuildFilesVarargsBuff.toString());
375361

376362
// docker login and push image to docker registry if necessary
377363
dockerLoginAndPushImageToRegistry(miiImage);

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLoggingFluentd.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,15 @@
4444
import oracle.weblogic.kubernetes.annotations.Namespaces;
4545
import oracle.weblogic.kubernetes.logging.LoggingFacade;
4646
import oracle.weblogic.kubernetes.utils.ExecResult;
47+
import org.awaitility.core.ConditionFactory;
4748
import org.junit.jupiter.api.AfterAll;
4849
import org.junit.jupiter.api.BeforeAll;
4950
import org.junit.jupiter.api.DisplayName;
5051
import org.junit.jupiter.api.Test;
5152

5253
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
54+
import static java.util.concurrent.TimeUnit.MINUTES;
55+
import static java.util.concurrent.TimeUnit.SECONDS;
5356
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_PASSWORD_DEFAULT;
5457
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_USERNAME_DEFAULT;
5558
import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_API_VERSION;
@@ -90,6 +93,7 @@
9093
import static oracle.weblogic.kubernetes.utils.PodUtils.setPodAntiAffinity;
9194
import static oracle.weblogic.kubernetes.utils.SecretUtils.createSecretWithUsernamePasswordElk;
9295
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
96+
import static org.awaitility.Awaitility.with;
9397
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
9498
import static org.junit.jupiter.api.Assertions.assertNotNull;
9599
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -126,6 +130,7 @@ class ItElasticLoggingFluentd {
126130

127131
private static String opNamespace = null;
128132
private static String domainNamespace = null;
133+
private static ConditionFactory withStandardRetryPolicy = null;
129134

130135
private static LoggingExporterParams elasticsearchParams = null;
131136
private static LoggingExporterParams kibanaParams = null;
@@ -146,6 +151,10 @@ class ItElasticLoggingFluentd {
146151
@BeforeAll
147152
public static void init(@Namespaces(3) List<String> namespaces) {
148153
logger = getLogger();
154+
// create standard, reusable retry/backoff policy
155+
withStandardRetryPolicy = with().pollDelay(2, SECONDS)
156+
.and().with().pollInterval(10, SECONDS)
157+
.atMost(5, MINUTES).await();
149158

150159
// get a new unique opNamespace
151160
logger.info("Assigning a unique namespace for Operator");

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalLbTunneling.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ void testExternalRmiAccessThruRouteHttpTunneling() {
503503
/**
504504
* Verify tls RMI access to WLS through routes with edge termination - only for OKD cluster.
505505
*/
506-
@Disabled("need to add itls key and certs")
506+
@Disabled("need to add tls key and certs")
507507
@EnabledIfEnvironmentVariable(named = "OKD", matches = "true")
508508
@Test
509509
@DisplayName("Verify tls RMI access WLS through Route in OKD ")

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLBTwoDomainsNginx.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,10 @@ private static void createNginxTLSPathRoutingForTwoDomains() {
384384
.path("/" + domainUid.substring(4) + "(.+)")
385385
.pathType("ImplementationSpecific")
386386
.backend(new V1IngressBackend()
387-
.service(new V1IngressServiceBackend()
388-
.name(domainUid + "-cluster-cluster-1")
389-
.port(new V1ServiceBackendPort()
390-
.number(MANAGED_SERVER_PORT)))
387+
.service(new V1IngressServiceBackend()
388+
.name(domainUid + "-cluster-cluster-1")
389+
.port(new V1ServiceBackendPort()
390+
.number(MANAGED_SERVER_PORT)))
391391
);
392392
httpIngressPaths.add(httpIngressPath);
393393
}

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMultiDomainModelsWithLoadBalancer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ public static void initAll(@Namespaces(6) List<String> namespaces) {
272272
@DisplayName("verify the operator log has expected error msg when encryption secret not created for a mii domain")
273273
void testOperatorLogSevereMsg() {
274274
createMiiDomainNegative("miidomainnegative", miiDomainNegativeNamespace);
275-
String operatorPodName = assertDoesNotThrow(() -> getOperatorPodName(OPERATOR_RELEASE_NAME, opNamespace));
275+
String operatorPodName =
276+
assertDoesNotThrow(() -> getOperatorPodName(OPERATOR_RELEASE_NAME, opNamespace));
276277
checkPodLogContainsString(opNamespace, operatorPodName,
277278
"Domain miidomainnegative is not valid: RuntimeEncryption secret '" + encryptionSecretName
278279
+ "' not found in namespace '" + miiDomainNegativeNamespace + "'");
@@ -849,9 +850,9 @@ private static Domain createMiiDomainWithMultiClusters(String domainNamespace) {
849850
logger.info("Creating docker registry secret in namespace {0}", domainNamespace);
850851
createOcirRepoSecret(domainNamespace);
851852

852-
String adminSecretName = "weblogic-credentials";
853853
// create secret for admin credentials
854854
logger.info("Creating secret for admin credentials");
855+
String adminSecretName = "weblogic-credentials";
855856
createSecretWithUsernamePassword(adminSecretName, domainNamespace, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT);
856857

857858
// create encryption secret

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItRemoteConsole.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ private static void createNginxIngressPathRoutingRules() {
226226
.path("/")
227227
.pathType("Prefix")
228228
.backend(new V1IngressBackend()
229-
.service(new V1IngressServiceBackend()
230-
.name(domainUid + "-admin-server")
231-
.port(new V1ServiceBackendPort()
232-
.number(ADMIN_SERVER_PORT)))
229+
.service(new V1IngressServiceBackend()
230+
.name(domainUid + "-admin-server")
231+
.port(new V1ServiceBackendPort()
232+
.number(ADMIN_SERVER_PORT)))
233233
);
234234
httpIngressPaths.add(httpIngressPath);
235235

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItWlsSamples.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ void testSampleDomainInImage(String model) {
180180
if (script.equals("wlst")) {
181181
assertDoesNotThrow(() -> {
182182
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
183-
"mode: wdt",
184-
"mode: wlst");
183+
"mode: wdt",
184+
"mode: wlst");
185185
});
186186
}
187187

integration-tests/src/test/java/oracle/weblogic/kubernetes/TestConstants.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ public interface TestConstants {
8282
public static final String OCR_FMWINFRA_IMAGE_TAG = "12.2.1.4";
8383
public static final String OCR_DB_IMAGE_NAME = "database/enterprise";
8484
public static final String OCR_DB_IMAGE_TAG = "12.2.0.1-slim";
85-
public static final String OCR_DB_19C_IMAGE_TAG = "19.3.0.0";
8685

8786
// ----------------------------- base images constants ---------------------
8887
// Get BASE_IMAGES_REPO from env var, if its not provided use OCIR as default to pull base images
@@ -158,9 +157,6 @@ public interface TestConstants {
158157
public static final String NGINX_REPO_NAME = "ingress-nginx";
159158
public static final String NGINX_CHART_NAME = "ingress-nginx";
160159
public static final String NGINX_CHART_VERSION = "4.0.17";
161-
public static final String NGINX_INGRESS_IMAGE_TAG = "v1.1.1";
162-
public static final String OCIR_NGINX_IMAGE_NAME = "weblogick8s/ingress-nginx/controller";
163-
public static final String GCR_NGINX_IMAGE_NAME = "k8s.gcr.io/ingress-nginx/controller";
164160

165161
// Traefik constants
166162
public static final String TRAEFIK_REPO_URL = "https://helm.traefik.io/traefik";
@@ -274,9 +270,6 @@ public interface TestConstants {
274270
public static final String ADMIN_USERNAME_PATCH = "weblogicnew";
275271
public static final String ADMIN_PASSWORD_PATCH = "welcome1new";
276272

277-
public static final String ENCRYPION_USERNAME_DEFAULT = "weblogicenc";
278-
public static final String ENCRYPION_PASSWORD_DEFAULT = "weblogicenc";
279-
280273
// REST API
281274
public static final String PROJECT_ROOT = System.getProperty("user.dir");
282275
public static final String GEN_EXTERNAL_REST_IDENTITY_FILE =
@@ -319,22 +312,4 @@ public interface TestConstants {
319312

320313
public static final String WEBLOGIC_VERSION = "12.2.1.4.0";
321314
public static final String HTTPS_PROXY = Optional.ofNullable(System.getenv("https_proxy")).orElse("");
322-
323-
// domain status condition type
324-
public static final String DOMAIN_STATUS_CONDITION_COMPLETED_TYPE = "Completed";
325-
public static final String DOMAIN_STATUS_CONDITION_AVAILABLE_TYPE = "Available";
326-
public static final String DOMAIN_STATUS_CONDITION_FAILED_TYPE = "Failed";
327-
328-
//Oracle database operator constants
329-
public static final String ORACLE_DB_OPERATOR_RELEASE_LATEST = "release/0.1.0";
330-
public static final String ORACLE_DB_OPERATOR_RELEASE = Optional.ofNullable(
331-
System.getenv("ORACLE_DB_OPERATOR_RELEASE")).orElse(ORACLE_DB_OPERATOR_RELEASE_LATEST);
332-
public static final String CERT_MANAGER
333-
= "https://github.com/jetstack/cert-manager/releases/latest/download/cert-manager.yaml";
334-
public static final String DB_OPERATOR_YAML_URL = "https://raw.githubusercontent.com/"
335-
+ "oracle/oracle-database-operator/" + ORACLE_DB_OPERATOR_RELEASE + "/oracle-database-operator.yaml";
336-
public static final String SIDB_YAML_URL = "https://raw.githubusercontent.com/oracle/oracle-database-operator/main/"
337-
+ "config/samples/sidb/singleinstancedatabase.yaml";
338-
public static final String ORACLELINUX_TEST_VERSION =
339-
Optional.ofNullable(System.getenv("ORACLELINUX_TEST_VERSION")).orElse("7");
340315
}

integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/TestActions.java

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -201,21 +201,6 @@ public static oracle.weblogic.domain.Domain getDomainCustomResource(String domai
201201
return Domain.getDomainCustomResource(domainUid, namespace);
202202
}
203203

204-
/**
205-
* Get the Domain Custom Resource.
206-
*
207-
* @param domainUid unique domain identifier
208-
* @param namespace name of namespace
209-
* @param domainVersion version of domain
210-
* @return Domain Custom Resource or null if Domain does not exist
211-
* @throws ApiException if Kubernetes client API call fails
212-
*/
213-
public static oracle.weblogic.domain.Domain getDomainCustomResource(String domainUid,
214-
String namespace,
215-
String domainVersion) throws ApiException {
216-
return Domain.getDomainCustomResource(domainUid, namespace, domainVersion);
217-
}
218-
219204
/**
220205
* Shutdown the domain.
221206
*
@@ -1054,9 +1039,9 @@ public static boolean buildAppArchive(AppParams params) {
10541039
*/
10551040
public static boolean buildCoherenceArchive(AppParams params) {
10561041
return
1057-
AppBuilder
1058-
.withParams(params)
1059-
.buildCoherence();
1042+
AppBuilder
1043+
.withParams(params)
1044+
.buildCoherence();
10601045
}
10611046

10621047
/**

integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/Domain.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -163,21 +163,6 @@ public static oracle.weblogic.domain.Domain getDomainCustomResource(String domai
163163
return Kubernetes.getDomainCustomResource(domainUid, namespace);
164164
}
165165

166-
/**
167-
* Get a Domain Custom Resource.
168-
*
169-
* @param domainUid unique domain identifier
170-
* @param namespace name of namespace
171-
* @param domainVersion domain version
172-
* @return domain custom resource or null if Domain does not exist
173-
* @throws ApiException if Kubernetes request fails
174-
*/
175-
public static oracle.weblogic.domain.Domain getDomainCustomResource(String domainUid,
176-
String namespace,
177-
String domainVersion) throws ApiException {
178-
return Kubernetes.getDomainCustomResource(domainUid, namespace, domainVersion);
179-
}
180-
181166
/**
182167
* Patch the Domain Custom Resource.
183168
*

0 commit comments

Comments
 (0)