|
117 | 117 | import static oracle.weblogic.kubernetes.actions.ActionConstants.RESOURCE_DIR;
|
118 | 118 | import static oracle.weblogic.kubernetes.actions.ActionConstants.WLS;
|
119 | 119 | import static oracle.weblogic.kubernetes.actions.TestActions.deleteImage;
|
| 120 | +import static oracle.weblogic.kubernetes.actions.TestActions.deleteIngress; |
120 | 121 | import static oracle.weblogic.kubernetes.actions.TestActions.deletePersistentVolume;
|
121 | 122 | import static oracle.weblogic.kubernetes.actions.TestActions.deletePersistentVolumeClaim;
|
122 | 123 | import static oracle.weblogic.kubernetes.actions.TestActions.deleteSecret;
|
123 | 124 | import static oracle.weblogic.kubernetes.actions.TestActions.getPod;
|
124 | 125 | import static oracle.weblogic.kubernetes.actions.TestActions.getServiceNodePort;
|
| 126 | +import static oracle.weblogic.kubernetes.actions.TestActions.listIngresses; |
125 | 127 | import static oracle.weblogic.kubernetes.actions.TestActions.uninstallNginx;
|
126 | 128 | import static oracle.weblogic.kubernetes.actions.impl.primitive.Kubernetes.copyFileToPod;
|
127 | 129 | import static oracle.weblogic.kubernetes.actions.impl.primitive.Kubernetes.deleteNamespace;
|
|
150 | 152 | import static oracle.weblogic.kubernetes.utils.MonitoringUtils.editPrometheusCM;
|
151 | 153 | import static oracle.weblogic.kubernetes.utils.MonitoringUtils.installAndVerifyGrafana;
|
152 | 154 | import static oracle.weblogic.kubernetes.utils.MonitoringUtils.installAndVerifyPrometheus;
|
153 |
| -import static oracle.weblogic.kubernetes.utils.MonitoringUtils.searchForKey; |
154 | 155 | import static oracle.weblogic.kubernetes.utils.OperatorUtils.installAndVerifyOperator;
|
155 | 156 | import static oracle.weblogic.kubernetes.utils.PatchDomainUtils.patchDomainResource;
|
156 | 157 | import static oracle.weblogic.kubernetes.utils.PersistentVolumeUtils.createPVPVCAndVerify;
|
@@ -358,8 +359,10 @@ void testEndToEndViaChart() throws Exception {
|
358 | 359 | logger.info("Create wdt domain and verify that it's running");
|
359 | 360 | createAndVerifyDomain(wdtImage, domain2Uid, domain2Namespace, "Image", replicaCount, false);
|
360 | 361 | String ingressClassName = nginxHelmParams.getIngressClassName();
|
| 362 | + Map<String, Integer> clusterNameMsPortMap1 = new HashMap<>(); |
| 363 | + clusterNameMsPortMap1.put(cluster1Name, managedServerPort); |
361 | 364 | ingressHost2List
|
362 |
| - = createIngressForDomainAndVerify(domain2Uid, domain2Namespace, 0, clusterNameMsPortMap, |
| 365 | + = createIngressForDomainAndVerify(domain2Uid, domain2Namespace, 0, clusterNameMsPortMap1, |
363 | 366 | false, ingressClassName, false, 0);
|
364 | 367 | logger.info("Installing Prometheus and Grafana");
|
365 | 368 | installPrometheusGrafana(PROMETHEUS_CHART_VERSION, GRAFANA_CHART_VERSION,
|
@@ -612,6 +615,12 @@ void testBasicFunctionality() throws Exception {
|
612 | 615 | replaceMetricsDomainQualifierTrueConfiguration();
|
613 | 616 | logger.info("Testing replace with no restPort configuration");
|
614 | 617 | replaceMetricsNoRestPortConfiguration();
|
| 618 | + |
| 619 | + //cleanup |
| 620 | + List<String> ingresses = listIngresses(domain4Namespace); |
| 621 | + for (String ingress : ingresses) { |
| 622 | + deleteIngress(ingress, domain4Namespace); |
| 623 | + } |
615 | 624 | }
|
616 | 625 |
|
617 | 626 |
|
@@ -814,58 +823,11 @@ private void installPrometheusGrafana(String promChartVersion,
|
814 | 823 | if (grafanaHelmParams == null) {
|
815 | 824 | //logger.info("Node Port for Grafana is " + nodeportgrafana);
|
816 | 825 | grafanaHelmParams = installAndVerifyGrafana("grafana",
|
817 |
| - monitoringNS, |
818 |
| - monitoringExporterEndToEndDir + "/grafana/values.yaml", |
819 |
| - grafanaChartVersion); |
| 826 | + monitoringNS, |
| 827 | + monitoringExporterEndToEndDir + "/grafana/values.yaml", |
| 828 | + grafanaChartVersion); |
820 | 829 | assertNotNull(grafanaHelmParams, "Grafana failed to install");
|
821 |
| - int nodeportgrafana = grafanaHelmParams.getNodePort(); |
822 |
| - //wait until it starts dashboard |
823 |
| - String curlCmd = String.format("curl -v -H 'Content-Type: application/json' " |
824 |
| - + " -X GET http://admin:12345678@%s:%s/api/dashboards", |
825 |
| - K8S_NODEPORT_HOST, nodeportgrafana); |
826 |
| - withStandardRetryPolicy |
827 |
| - .conditionEvaluationListener( |
828 |
| - condition -> logger.info("Check access to grafana dashboard " |
829 |
| - + "(elapsed time {0}ms, remaining time {1}ms)", |
830 |
| - condition.getElapsedTimeInMS(), |
831 |
| - condition.getRemainingTimeInMS())) |
832 |
| - .until(assertDoesNotThrow(() -> searchForKey(curlCmd, "grafana"), |
833 |
| - String.format("Check access to grafana dashboard" |
834 |
| - ))); |
835 |
| - logger.info("installing grafana dashboard"); |
836 |
| - // url |
837 |
| - String curlCmd0 = |
838 |
| - String.format("curl -v -H 'Content-Type: application/json' -H \"Content-Type: application/json\"" |
839 |
| - + " -X POST http://admin:12345678@%s:%s/api/datasources/" |
840 |
| - + " --data-binary @%sgrafana/datasource.json", |
841 |
| - K8S_NODEPORT_HOST, nodeportgrafana, monitoringExporterEndToEndDir); |
842 |
| - |
843 |
| - logger.info("Executing Curl cmd {0}", curlCmd); |
844 |
| - assertDoesNotThrow(() -> ExecCommand.exec(curlCmd0)); |
845 |
| - |
846 |
| - String curlCmd1 = |
847 |
| - String.format("curl -v -H 'Content-Type: application/json' -H \"Content-Type: application/json\"" |
848 |
| - + " -X POST http://admin:12345678@%s:%s/api/dashboards/db/" |
849 |
| - + " --data-binary @%sgrafana/dashboard.json", |
850 |
| - K8S_NODEPORT_HOST, nodeportgrafana, monitoringExporterEndToEndDir); |
851 |
| - logger.info("Executing Curl cmd {0}", curlCmd1); |
852 |
| - assertDoesNotThrow(() -> ExecCommand.exec(curlCmd1)); |
853 |
| - |
854 |
| - String curlCmd2 = String.format("curl -v -H 'Content-Type: application/json' " |
855 |
| - + " -X GET http://admin:12345678@%s:%s/api/dashboards/db/weblogic-server-dashboard", |
856 |
| - K8S_NODEPORT_HOST, nodeportgrafana); |
857 |
| - withStandardRetryPolicy |
858 |
| - .conditionEvaluationListener( |
859 |
| - condition -> logger.info("Check grafana dashboard metric against expected {0} " |
860 |
| - + "(elapsed time {2}ms, remaining time {3}ms)", |
861 |
| - "wls_jvm_uptime", |
862 |
| - condition.getElapsedTimeInMS(), |
863 |
| - condition.getRemainingTimeInMS())) |
864 |
| - .until(assertDoesNotThrow(() -> searchForKey(curlCmd2, "wls_jvm_uptime"), |
865 |
| - String.format("Check grafana dashboard wls against expected %s", |
866 |
| - "wls_jvm_uptime"))); |
867 | 830 | }
|
868 |
| - logger.info("Grafana is running"); |
869 | 831 | }
|
870 | 832 |
|
871 | 833 | /**
|
|
0 commit comments