Skip to content

Commit 03f139a

Browse files
committed
Merge branch 'wko-141200' into 'release/4.2'
test changes needed in 4.2 for 14.1.2 images See merge request weblogic-cloud/weblogic-kubernetes-operator!4905
2 parents 0c9a931 + 47afbfa commit 03f139a

24 files changed

+170
-49
lines changed

Jenkinsfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ pipeline {
143143
defaultValue: "test-images/weblogic"
144144
)
145145
string(name: 'WEBLOGIC_IMAGE_TAG',
146-
description: '12.2.1.4, 12.2.1.4-dev(12.2.1.4-dev-ol7) , 12.2.1.4-slim(12.2.1.4-slim-ol7), 12.2.1.4-ol8, 12.2.1.4-dev-ol8, 12.2.1.4-slim-ol8, 14.1.1.0-11-ol7, 14.1.1.0-dev-11-ol7, 14.1.1.0-slim-11-ol7, 14.1.1.0-8-ol7, 14.1.1.0-dev-8-ol7, 14.1.1.0-slim-8-ol7, 14.1.1.0-11-ol8, 14.1.1.0-dev-11-ol8, 14.1.1.0-slim-11-ol8, 14.1.1.0-8-ol8, 14.1.1.0-dev-8-ol8, 14.1.1.0-slim-8-ol8',
147-
defaultValue: '12.2.1.4'
146+
description: '14.1.2.0-generic-jdk17-ol8, 14.1.2.0-generic-jdk17-ol9, 14.1.2.0-generic-jdk21-ol8, 14.1.2.0-generic-jdk21-ol9, 12.2.1.4, 12.2.1.4-dev(12.2.1.4-dev-ol7) , 12.2.1.4-slim(12.2.1.4-slim-ol7), 12.2.1.4-ol8, 12.2.1.4-dev-ol8, 12.2.1.4-slim-ol8, 14.1.1.0-11-ol7, 14.1.1.0-dev-11-ol7, 14.1.1.0-slim-11-ol7, 14.1.1.0-8-ol7, 14.1.1.0-dev-8-ol7, 14.1.1.0-slim-8-ol7, 14.1.1.0-11-ol8, 14.1.1.0-dev-11-ol8, 14.1.1.0-slim-11-ol8, 14.1.1.0-8-ol8, 14.1.1.0-dev-8-ol8, 14.1.1.0-slim-8-ol8',
147+
defaultValue: '14.1.2.0-generic-jdk17-ol8'
148148
)
149149
string(name: 'FMWINFRA_IMAGE_NAME',
150150
description: 'FWM Infra image name. Default is the image name in BASE_IMAGES_REPO. Use middleware/fmw-infrastructure for OCR.',
151151
defaultValue: "test-images/fmw-infrastructure"
152152
)
153153
string(name: 'FMWINFRA_IMAGE_TAG',
154-
description: 'FWM Infra image tag',
155-
defaultValue: '12.2.1.4'
154+
description: '14.1.2.0-jdk17-ol8, 14.1.2.0-jdk17-ol9, 14.1.2.0-jdk21-ol8, 14.1.2.0-jdk21-ol9',
155+
defaultValue: '14.1.2.0-jdk17-ol8'
156156
)
157157
string(name: 'DB_IMAGE_NAME',
158158
description: 'Oracle DB image name. Default is the image name in BASE_IMAGES_REPO, use database/enterprise for OCR.',

Jenkinsfile.kindnightly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pipeline {
152152
defaultValue: "${env.WKT_OCIR_HOST}"
153153
)
154154
choice(name: 'BASE_IMAGES_REPO',
155-
choices: ["${env.WKT_OCIR_HOST}", 'container-registry.oracle.com'],
155+
choices: ["${env.WKT_OCIR_HOST}", 'container-registry.oracle.com'],
156156
description: 'Repository to pull the base images. Make sure to modify the image names if you are modifying this parameter value.'
157157
)
158158
string(name: 'WEBLOGIC_IMAGE_NAME',

Jenkinsfile.podman

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,16 @@ pipeline {
153153
defaultValue: "test-images/weblogic"
154154
)
155155
string(name: 'WEBLOGIC_IMAGE_TAG',
156-
description: '12.2.1.4, 12.2.1.4-dev(12.2.1.4-dev-ol7) , 12.2.1.4-slim(12.2.1.4-slim-ol7), 12.2.1.4-ol8, 12.2.1.4-dev-ol8, 12.2.1.4-slim-ol8, 14.1.1.0-11-ol7, 14.1.1.0-dev-11-ol7, 14.1.1.0-slim-11-ol7, 14.1.1.0-8-ol7, 14.1.1.0-dev-8-ol7, 14.1.1.0-slim-8-ol7, 14.1.1.0-11-ol8, 14.1.1.0-dev-11-ol8, 14.1.1.0-slim-11-ol8, 14.1.1.0-8-ol8, 14.1.1.0-dev-8-ol8, 14.1.1.0-slim-8-ol8',
157-
defaultValue: '12.2.1.4'
156+
description: '14.1.2.0-generic-jdk17-ol8, 14.1.2.0-generic-jdk17-ol9, 14.1.2.0-generic-jdk21-ol8, 14.1.2.0-generic-jdk21-ol9, 12.2.1.4, 12.2.1.4-dev(12.2.1.4-dev-ol7) , 12.2.1.4-slim(12.2.1.4-slim-ol7), 12.2.1.4-ol8, 12.2.1.4-dev-ol8, 12.2.1.4-slim-ol8, 14.1.1.0-11-ol7, 14.1.1.0-dev-11-ol7, 14.1.1.0-slim-11-ol7, 14.1.1.0-8-ol7, 14.1.1.0-dev-8-ol7, 14.1.1.0-slim-8-ol7, 14.1.1.0-11-ol8, 14.1.1.0-dev-11-ol8, 14.1.1.0-slim-11-ol8, 14.1.1.0-8-ol8, 14.1.1.0-dev-8-ol8, 14.1.1.0-slim-8-ol8',
157+
defaultValue: '14.1.2.0-generic-jdk17-ol8'
158158
)
159159
string(name: 'FMWINFRA_IMAGE_NAME',
160160
description: 'FWM Infra image name. Default is the image name in BASE_IMAGES_REPO. Use middleware/fmw-infrastructure for OCR.',
161161
defaultValue: "test-images/fmw-infrastructure"
162162
)
163163
string(name: 'FMWINFRA_IMAGE_TAG',
164-
description: 'FWM Infra image tag',
165-
defaultValue: '12.2.1.4'
164+
description: '14.1.2.0-jdk17-ol8, 14.1.2.0-jdk17-ol9, 14.1.2.0-jdk21-ol8, 14.1.2.0-jdk21-ol9',
165+
defaultValue: '14.1.2.0-jdk17-ol8'
166166
)
167167
string(name: 'DB_IMAGE_NAME',
168168
description: 'Oracle DB image name. Default is the image name in BASE_IMAGES_REPO, use database/enterprise for OCR.',

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838

3939
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_PASSWORD_DEFAULT;
4040
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_USERNAME_DEFAULT;
41-
import static oracle.weblogic.kubernetes.TestConstants.DB_IMAGE_TO_USE_IN_SPEC;
4241
import static oracle.weblogic.kubernetes.TestConstants.ELASTICSEARCH_HOST;
4342
import static oracle.weblogic.kubernetes.TestConstants.FMWINFRA_IMAGE_TO_USE_IN_SPEC;
4443
import static oracle.weblogic.kubernetes.TestConstants.MII_AUXILIARY_IMAGE_NAME;
@@ -60,11 +59,11 @@
6059
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.addSccToDBSvcAccount;
6160
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodReadyAndServiceExists;
6261
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.createCustomConditionFactory;
63-
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
6462
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getUniqueName;
6563
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil;
6664
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.verifyConfiguredSystemResource;
6765
import static oracle.weblogic.kubernetes.utils.ConfigMapUtils.createConfigMapAndVerify;
66+
import static oracle.weblogic.kubernetes.utils.DbUtils.createOracleDBUsingOperator;
6867
import static oracle.weblogic.kubernetes.utils.DbUtils.createRcuAccessSecret;
6968
import static oracle.weblogic.kubernetes.utils.DbUtils.createRcuSchema;
7069
import static oracle.weblogic.kubernetes.utils.DbUtils.startOracleDB;
@@ -132,6 +131,8 @@ public class ItFmwDomainInPvUserCreateRcu {
132131
private final String opsswalletfileSecretName1 = domainUid1 + "-opss-wallet-file-secret";
133132
private final String opsswalletfileSecretName3 = domainUid3 + "-opss-wallet-file-secret";
134133
private final String opsswalletfileSecretName4 = domainUid4 + "-opss-wallet-file-secret";
134+
private static String dbName = "my-orcl-sidb";
135+
private static final String RCUSYSPASSWORD = "Oradoc_db1";
135136
private static final int replicaCount = 1;
136137

137138
private final String fmwModelFilePrefix = "model-fmwdomainonpv-rcu-wdt";
@@ -154,9 +155,6 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
154155
logger.info("Assign a unique namespace for DB and RCU");
155156
assertNotNull(namespaces.get(0), "Namespace is null");
156157
dbNamespace = namespaces.get(0);
157-
final int dbListenerPort = getNextFreePort();
158-
ORACLEDBSUFFIX = ".svc.cluster.local:" + dbListenerPort + "/devpdb.k8s";
159-
dbUrl = ORACLEDBURLPREFIX + dbNamespace + ORACLEDBSUFFIX;
160158

161159
// get a new unique opNamespace
162160
logger.info("Assign a unique namespace for operator1");
@@ -169,11 +167,7 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
169167
domainNamespace = namespaces.get(2);
170168

171169
// start DB
172-
logger.info("Start DB in namespace: {0}, dbListenerPort: {1}, dbUrl: {2}, dbImage: {3}",
173-
dbNamespace, dbListenerPort, dbUrl, DB_IMAGE_TO_USE_IN_SPEC);
174-
assertDoesNotThrow(() -> setupDB(DB_IMAGE_TO_USE_IN_SPEC, dbNamespace, getNextFreePort(), dbListenerPort),
175-
String.format("Failed to setup DB in the namespace %s with dbUrl %s, dbListenerPost %s",
176-
dbNamespace, dbUrl, dbListenerPort));
170+
dbUrl = assertDoesNotThrow(() -> createOracleDBUsingOperator(dbName, RCUSYSPASSWORD, dbNamespace));
177171

178172
// install operator with DomainOnPvSimplification=true"
179173
HelmParams opHelmParams =

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
import static oracle.weblogic.kubernetes.TestConstants.TRAEFIK_INGRESS_HTTP_HOSTPORT;
8888
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_NAME;
8989
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_NAME_DEFAULT;
90+
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_TAG;
9091
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_TO_USE_IN_SPEC;
9192
import static oracle.weblogic.kubernetes.actions.ActionConstants.APP_DIR;
9293
import static oracle.weblogic.kubernetes.actions.ActionConstants.ITTESTS_DIR;
@@ -223,7 +224,16 @@ class ItIntrospectVersion {
223224

224225
private static Path clusterViewAppPath;
225226
private static LoggingFacade logger = null;
226-
private static final int managedServerPort = 7100;
227+
private static int managedServerPort;
228+
229+
static {
230+
if (WEBLOGIC_IMAGE_TAG.contains("12")) {
231+
managedServerPort = 7100;
232+
} else {
233+
managedServerPort = 7001;
234+
}
235+
}
236+
227237
private static int adminPort = 7001;
228238
private static String hostHeader;
229239

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

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
package oracle.weblogic.kubernetes;
55

6+
import java.net.UnknownHostException;
67
import java.nio.file.Path;
78
import java.nio.file.Paths;
89
import java.util.ArrayList;
@@ -28,6 +29,7 @@
2829
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
2930
import static oracle.weblogic.kubernetes.TestConstants.MANAGED_SERVER_NAME_BASE;
3031
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER;
32+
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_TAG;
3133
import static oracle.weblogic.kubernetes.actions.ActionConstants.RESOURCE_DIR;
3234
import static oracle.weblogic.kubernetes.actions.TestActions.addLabelsToNamespace;
3335
import static oracle.weblogic.kubernetes.utils.ApplicationUtils.checkAppUsingHostHeader;
@@ -90,6 +92,12 @@ class ItIstioGatewaySessionMigration {
9092
private static int istioIngressPort = 0;
9193
private static String testWebAppWarLoc = null;
9294
private static int managedServerPort = 7100;
95+
96+
static {
97+
if (!WEBLOGIC_IMAGE_TAG.startsWith("12")) {
98+
managedServerPort = 7001;
99+
}
100+
}
93101

94102
private static final String istioNamespace = "istio-system";
95103
private static final String istioIngressServiceName = "istio-ingressgateway";
@@ -171,7 +179,7 @@ public static void initAll(@Namespaces(2) List<String> namespaces) {
171179
@Test
172180
@DisplayName("When istio is enabled using Istio gateway, stop the primary server, "
173181
+ "verify that a new primary server is picked and HTTP session state is migrated")
174-
void testSessionMigrationIstioGateway() {
182+
void testSessionMigrationIstioGateway() throws UnknownHostException {
175183
final String primaryServerAttr = "primary";
176184
final String secondaryServerAttr = "secondary";
177185
final String sessionCreateTimeAttr = "sessioncreatetime";
@@ -183,15 +191,21 @@ void testSessionMigrationIstioGateway() {
183191
// In internal OKE env, use Istio EXTERNAL-IP; in non-OKE env, use K8S_NODEPORT_HOST + ":" + istioIngressPort
184192
String istioIngressIP = getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) != null
185193
? getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) : formatIPv6Host(K8S_NODEPORT_HOST);
186-
194+
int servicePort = istioIngressPort;
195+
if (TestConstants.KIND_CLUSTER
196+
&& !TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
197+
istioIngressIP = domainUid + "-cluster-cluster-1." + domainNamespace + ".svc.cluster.local";
198+
servicePort = 7001;
199+
}
200+
187201
// send a HTTP request to set http session state(count number) and save HTTP session info
188202
// before shutting down the primary server
189203
// the NodePort services created by the operator are not usable, because they would expose ports
190204
// on the worker node’s private IP addresses only, which are not reachable from outside the cluster
191205
Map<String, String> httpDataInfo = OKE_CLUSTER ? getServerAndSessionInfoAndVerify(domainNamespace,
192206
adminServerPodName, serverName, istioIngressIP, 0, webServiceSetUrl, " -c ")
193207
: getServerAndSessionInfoAndVerify(domainNamespace,
194-
adminServerPodName, serverName, istioIngressIP, istioIngressPort, webServiceSetUrl, " -c ");
208+
adminServerPodName, serverName, istioIngressIP, servicePort, webServiceSetUrl, " -c ");
195209
// get server and session info from web service deployed on the cluster
196210
String origPrimaryServerName = httpDataInfo.get(primaryServerAttr);
197211
String origSecondaryServerName = httpDataInfo.get(secondaryServerAttr);
@@ -209,7 +223,7 @@ void testSessionMigrationIstioGateway() {
209223
httpDataInfo = OKE_CLUSTER ? getServerAndSessionInfoAndVerify(domainNamespace,
210224
adminServerPodName, serverName, istioIngressIP, 0, webServiceGetUrl, " -b ")
211225
: getServerAndSessionInfoAndVerify(domainNamespace,
212-
adminServerPodName, serverName, istioIngressIP, istioIngressPort, webServiceGetUrl, " -b ");
226+
adminServerPodName, serverName, istioIngressIP, servicePort, webServiceGetUrl, " -b ");
213227
// get server and session info from web service deployed on the cluster
214228
String primaryServerName = httpDataInfo.get(primaryServerAttr);
215229
String sessionCreateTime = httpDataInfo.get(sessionCreateTimeAttr);
@@ -247,11 +261,15 @@ private static int configIstioGatewayModelInImageDomain(String miiImage,
247261

248262
String clusterService = domainUid + "-cluster-" + clusterName + "." + domainNamespace + ".svc.cluster.local";
249263

250-
Map<String, String> templateMap = new HashMap<>();
264+
Map<String, String> templateMap = new HashMap<>();
251265
templateMap.put("NAMESPACE", domainNamespace);
252266
templateMap.put("DUID", domainUid);
253-
templateMap.put("ADMIN_SERVICE",adminServerPodName);
267+
templateMap.put("ADMIN_SERVICE", adminServerPodName);
254268
templateMap.put("CLUSTER_SERVICE", clusterService);
269+
if (!WEBLOGIC_IMAGE_TAG.startsWith("12")) {
270+
templateMap.put("7100", String.valueOf(managedServerPort));
271+
templateMap.put("8001", String.valueOf(managedServerPort));
272+
}
255273

256274
// create Istio gateway
257275
Path srcHttpFile = Paths.get(RESOURCE_DIR, "istio", istioGatewayConfigFile);

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_SERVER_NAME_BASE;
2323
import static oracle.weblogic.kubernetes.TestConstants.MANAGED_SERVER_NAME_BASE;
24+
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_TAG;
2425
import static oracle.weblogic.kubernetes.actions.TestActions.addLabelsToNamespace;
2526
import static oracle.weblogic.kubernetes.utils.CommonMiiTestUtils.configIstioModelInImageDomain;
2627
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.generateNewModelFileWithUpdatedDomainUid;
@@ -62,7 +63,16 @@ class ItIstioSessionMigration {
6263
private static String clusterName = "cluster-1";
6364
private static String adminServerPodName = domainUid + "-" + ADMIN_SERVER_NAME_BASE;
6465
private static String managedServerPrefix = domainUid + "-" + MANAGED_SERVER_NAME_BASE;
65-
private static int managedServerPort = 7100;
66+
private static int managedServerPort;
67+
68+
static {
69+
if (WEBLOGIC_IMAGE_TAG.contains("12")) {
70+
managedServerPort = 7100;
71+
} else {
72+
managedServerPort = 7001;
73+
}
74+
}
75+
6676
private static String finalPrimaryServerName = null;
6777
private static String configMapName = "istio-configmap";
6878
private static int replicaCount = 2;

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER_PRIVATEIP;
4444
import static oracle.weblogic.kubernetes.TestConstants.RESULTS_TEMPFILE_DIR;
4545
import static oracle.weblogic.kubernetes.TestConstants.SKIP_CLEANUP;
46+
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_TAG;
4647
import static oracle.weblogic.kubernetes.TestConstants.WLSIMG_BUILDER;
4748
import static oracle.weblogic.kubernetes.TestConstants.WLSIMG_BUILDER_DEFAULT;
4849
import static oracle.weblogic.kubernetes.actions.TestActions.createIngress;
@@ -94,7 +95,16 @@ class ItLBTwoDomainsNginx {
9495

9596
// domain constants
9697
private static final int replicaCount = 2;
97-
private static final int MANAGED_SERVER_PORT = 7100;
98+
private static int MANAGED_SERVER_PORT;
99+
100+
static {
101+
if (WEBLOGIC_IMAGE_TAG.contains("12")) {
102+
MANAGED_SERVER_PORT = 7100;
103+
} else {
104+
MANAGED_SERVER_PORT = 7001;
105+
}
106+
}
107+
98108
private static final int ADMIN_SERVER_PORT = 7001;
99109
private static final String clusterName = "cluster-1";
100110

@@ -289,6 +299,7 @@ private static void createNginxIngressHostRoutingForTwoDomains(String ingressCla
289299
List<V1IngressTLS> tlsList = new ArrayList<>();
290300
for (String domainUid : domainUids) {
291301

302+
292303
V1HTTPIngressPath httpIngressPath = new V1HTTPIngressPath()
293304
.path(null)
294305
.pathType("ImplementationSpecific")

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import static oracle.weblogic.kubernetes.TestConstants.TRAEFIK_INGRESS_HTTPS_NODEPORT;
4040
import static oracle.weblogic.kubernetes.TestConstants.TRAEFIK_INGRESS_HTTP_HOSTPORT;
4141
import static oracle.weblogic.kubernetes.TestConstants.TRAEFIK_INGRESS_HTTP_NODEPORT;
42+
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_TAG;
4243
import static oracle.weblogic.kubernetes.TestConstants.WLSIMG_BUILDER;
4344
import static oracle.weblogic.kubernetes.TestConstants.WLSIMG_BUILDER_DEFAULT;
4445
import static oracle.weblogic.kubernetes.actions.TestActions.deletePersistentVolume;
@@ -85,7 +86,16 @@ class ItLBTwoDomainsTraefik {
8586

8687
// domain constants
8788
private static final int replicaCount = 2;
88-
private static final int MANAGED_SERVER_PORT = 7100;
89+
private static int MANAGED_SERVER_PORT;
90+
91+
static {
92+
if (WEBLOGIC_IMAGE_TAG.contains("12")) {
93+
MANAGED_SERVER_PORT = 7100;
94+
} else {
95+
MANAGED_SERVER_PORT = 7001;
96+
}
97+
}
98+
8999
private static final int ADMIN_SERVER_PORT = 7001;
90100
private static final String clusterName = "cluster-1";
91101

@@ -267,9 +277,16 @@ private static void createTraefikIngressRoutingRules(String domainNamespace) {
267277
assertDoesNotThrow(() -> {
268278
Files.deleteIfExists(dstFile);
269279
Files.createDirectories(dstFile.getParent());
280+
String msPort;
281+
if (WEBLOGIC_IMAGE_TAG.contains("12")) {
282+
msPort = "7100";
283+
} else {
284+
msPort = "7001";
285+
}
270286
Files.write(dstFile, Files.readString(srcFile).replaceAll("@NS@", domainNamespace)
271287
.replaceAll("@domain1uid@", domainUids.get(0))
272288
.replaceAll("@domain2uid@", domainUids.get(1))
289+
.replaceAll("7100", msPort)
273290
.getBytes(StandardCharsets.UTF_8));
274291
});
275292
String command = KUBERNETES_CLI + " create -f " + dstFile;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import oracle.weblogic.kubernetes.annotations.Namespaces;
3434
import oracle.weblogic.kubernetes.logging.LoggingFacade;
3535
import oracle.weblogic.kubernetes.utils.ExecResult;
36+
import oracle.weblogic.kubernetes.utils.LoggingUtil;
3637
import oracle.weblogic.kubernetes.utils.MonitoringUtils;
3738
import org.junit.jupiter.api.AfterAll;
3839
import org.junit.jupiter.api.BeforeAll;
@@ -153,6 +154,7 @@ class ItMonitoringExporterWebApp {
153154
private static String grafanaReleaseName = "grafana" + releaseSuffix;
154155
private static String monitoringExporterDir;
155156
private static String hostPortPrometheus = null;
157+
private static List<String> ns;
156158

157159

158160
/**
@@ -167,6 +169,7 @@ class ItMonitoringExporterWebApp {
167169
public static void initAll(@Namespaces(6) List<String> namespaces) throws UnknownHostException {
168170

169171
logger = getLogger();
172+
ns = namespaces;
170173
monitoringExporterDir = Paths.get(RESULTS_ROOT,
171174
"ItMonitoringExporterWebApp", "monitoringexp").toString();
172175
monitoringExporterSrcDir = Paths.get(monitoringExporterDir, "srcdir").toString();
@@ -390,6 +393,7 @@ void testAdminPortEnabled() throws Exception {
390393
@DisplayName("Test Monitoring Exporter access to metrics via https.")
391394
void testAccessExporterViaHttps() throws Exception {
392395
String miiImage1 = null;
396+
boolean collectLogs = true;
393397

394398
try {
395399
logger.info("create and verify WebLogic domain image using model in image with model files for norestport");
@@ -427,7 +431,11 @@ void testAccessExporterViaHttps() throws Exception {
427431
true, clusterName),
428432
"monitoring exporter metrics page can't be accessed via https");
429433
});
434+
collectLogs = false;
430435
} finally {
436+
if (collectLogs) {
437+
LoggingUtil.generateLog(this, ns);
438+
}
431439
logger.info("Shutting down domain3");
432440
shutdownDomain(domain3Uid, domain3Namespace);
433441
if (miiImage1 != null) {

0 commit comments

Comments
 (0)