@@ -119,7 +119,6 @@ public static void staticUnPrepare() throws Exception {
119
119
if (operator != null ) {
120
120
operator .destroy ();
121
121
}
122
- // deletePrometheusGrafana();
123
122
tearDown (new Object () {}.getClass ().getEnclosingClass ().getSimpleName ());
124
123
logger .info ("SUCCESS" );
125
124
}
@@ -396,7 +395,7 @@ private static void upgradeTraefikHostName() throws Exception {
396
395
/**
397
396
* Check that configuration can be reviewed via Prometheus.
398
397
*
399
- * @throws Exception exception
398
+ * @throws Exception if test fails
400
399
*/
401
400
@ Test
402
401
public void test01_CheckMetricsViaPrometheus () throws Exception {
@@ -412,7 +411,7 @@ public void test01_CheckMetricsViaPrometheus() throws Exception {
412
411
/**
413
412
* Replace monitoring exporter configuration and verify it was applied to both managed servers.
414
413
*
415
- * @throws Exception exception
414
+ * @throws Exception if test fails
416
415
*/
417
416
@ Test
418
417
public void test02_ReplaceConfiguration () throws Exception {
@@ -459,7 +458,7 @@ public void test02_ReplaceConfiguration() throws Exception {
459
458
/**
460
459
* Add additional monitoring exporter configuration and verify it was applied.
461
460
*
462
- * @throws Exception exception
461
+ * @throws Exception if test fails
463
462
*/
464
463
@ Test
465
464
public void test03_AppendConfiguration () throws Exception {
@@ -492,7 +491,7 @@ public void test03_AppendConfiguration() throws Exception {
492
491
/**
493
492
* Replace monitoring exporter configuration with only one attribute and verify it was applied.
494
493
*
495
- * @throws Exception exception
494
+ * @throws Exception if test fails
496
495
*/
497
496
@ Test
498
497
public void test04_ReplaceOneAttributeValueAsArrayConfiguration () throws Exception {
@@ -513,7 +512,7 @@ public void test04_ReplaceOneAttributeValueAsArrayConfiguration() throws Excepti
513
512
* Append monitoring exporter configuration with one more attribute and verify it was applied
514
513
* append to [a] new config [a,b].
515
514
*
516
- * @throws Exception exception
515
+ * @throws Exception if test fails
517
516
*/
518
517
@ Test
519
518
public void test05_AppendArrayWithOneExistedAndOneDifferentAttributeValueAsArrayConfiguration ()
@@ -533,7 +532,7 @@ public void test05_AppendArrayWithOneExistedAndOneDifferentAttributeValueAsArray
533
532
/**
534
533
* Replace monitoring exporter configuration with empty configuration.
535
534
*
536
- * @throws Exception exception
535
+ * @throws Exception if test fails
537
536
*/
538
537
@ Test
539
538
public void test06_ReplaceWithEmptyConfiguration () throws Exception {
@@ -568,7 +567,7 @@ public void test07_AppendWithEmptyConfiguration() throws Exception {
568
567
/**
569
568
* Try to append monitoring exporter configuration with configuration file not in the yaml format.
570
569
*
571
- * @throws Exception exception
570
+ * @throws Exception if test fails
572
571
*/
573
572
@ Test
574
573
public void test08_1AppendWithNotYmlConfiguration () throws Exception {
@@ -601,7 +600,7 @@ public void test08_2ReplaceWithNotYmlConfiguration() throws Exception {
601
600
* Try to append monitoring exporter configuration with configuration file in the corrupted yaml
602
601
* format.
603
602
*
604
- * @throws Exception exception
603
+ * @throws Exception if test fails
605
604
*/
606
605
public void test09_AppendWithCorruptedYmlConfiguration () throws Exception {
607
606
Assume .assumeFalse (QUICKTEST );
@@ -637,7 +636,7 @@ public void test10_ReplaceWithCorruptedYmlConfiguration() throws Exception {
637
636
* Try to replace monitoring exporter configuration with configuration file with dublicated
638
637
* values.
639
638
*
640
- * @throws Exception exception
639
+ * @throws Exception if test fails
641
640
*/
642
641
@ Test
643
642
public void test11_ReplaceWithDublicatedValuesConfiguration () throws Exception {
@@ -655,7 +654,7 @@ public void test11_ReplaceWithDublicatedValuesConfiguration() throws Exception {
655
654
/**
656
655
* Try to append monitoring exporter configuration with configuration file with duplicated values.
657
656
*
658
- * @throws Exception exception
657
+ * @throws Exception if test fails
659
658
*/
660
659
@ Test
661
660
public void test12_AppendWithDuplicatedValuesConfiguration () throws Exception {
@@ -758,7 +757,7 @@ public void test16_ChangeConfigInvalidPass() throws Exception {
758
757
/**
759
758
* Try to change monitoring exporter configuration with empty username.
760
759
*
761
- * @throws Exception excpetion
760
+ * @throws Exception if test fails
762
761
*/
763
762
@ Test
764
763
public void test17_ChangeConfigEmptyUser () throws Exception {
@@ -777,7 +776,7 @@ public void test17_ChangeConfigEmptyUser() throws Exception {
777
776
/**
778
777
* Try to change monitoring exporter configuration with empty pass.
779
778
*
780
- * @throws Exception exception
779
+ * @throws Exception if test fails
781
780
*/
782
781
@ Test
783
782
public void test18_ChangeConfigEmptyPass () throws Exception {
@@ -796,7 +795,7 @@ public void test18_ChangeConfigEmptyPass() throws Exception {
796
795
/**
797
796
* Test End to End example from MonitoringExporter github project
798
797
*
799
- * @throws Exception
798
+ * @throws Exception if test fails
800
799
*/
801
800
@ Test
802
801
public void test19_EndToEndViaChart () throws Exception {
@@ -821,8 +820,10 @@ public void test19_EndToEndViaChart() throws Exception {
821
820
installPrometheusGrafanaViaChart ();
822
821
fireAlert ();
823
822
} finally {
823
+ /*
824
824
uninstallWebHookPrometheusGrafanaViaChart();
825
825
uninstallMySQL();
826
+
826
827
String crdCmd =
827
828
" kubectl delete -f " + monitoringExporterEndToEndDir + "/demo-domains/domain1.yaml";
828
829
ExecCommand.exec(crdCmd);
@@ -831,6 +832,8 @@ public void test19_EndToEndViaChart() throws Exception {
831
832
if (operator1 != null) {
832
833
operator1.destroy();
833
834
}
835
+ */
836
+
834
837
}
835
838
testCompletedSuccessfully = true ;
836
839
logger .info ("SUCCESS - " + testMethodName );
@@ -847,9 +850,12 @@ private void fireAlert() throws Exception {
847
850
848
851
TestUtils .checkPodReady ("domain1-admin-server" , "default" );
849
852
TestUtils .checkPodReady ("domain1-managed-server-1" , "default" );
853
+ //sleep for 1 min to fire alert
854
+ Thread .sleep (60000 );
850
855
String webhookPod = getPodName ("webhook" , "webhook" );
851
856
String command = "kubectl -n webhook logs " + webhookPod ;
852
857
ExecResult webhookResult = TestUtils .exec (command );
858
+ logger .info (" webhook log " + webhookResult .stdout ());
853
859
assertTrue ( webhookResult .stdout ().contains ("Some WLS cluster has only one running server for more than 1 minutes" ));
854
860
}
855
861
@@ -946,7 +952,7 @@ private HtmlPage submitConfigureForm(
946
952
* Remove monitoring exporter directory if exists and clone latest from github for monitoring
947
953
* exporter code
948
954
*
949
- * @throws Exception if could not run the command successfully to clone from github
955
+ * @throws Exception if could not run the command successfully to install database
950
956
*/
951
957
private static void setupPVMYSQL () throws Exception {
952
958
String pvDir = monitoringExporterEndToEndDir + "pvDir" ;
@@ -1036,7 +1042,7 @@ private static void setupPVMYSQL() throws Exception {
1036
1042
/**
1037
1043
* Install wls image tool and update wls pods
1038
1044
*
1039
- * @throws Exception if could not run the command successfully to clone from github
1045
+ * @throws Exception if could not run the command successfully to create WLSImage and deploy
1040
1046
*/
1041
1047
private static void createWLSImageAndDeploy () throws Exception {
1042
1048
operator1 = TestUtils .createOperator (OPERATOR1_YAML );
@@ -1080,7 +1086,7 @@ private static void createWLSImageAndDeploy() throws Exception {
1080
1086
/**
1081
1087
* Install Prometheus and Grafana using helm chart
1082
1088
*
1083
- * @throws Exception if could not run the command successfully to clone from github
1089
+ * @throws Exception if could not run the command successfully to install Prometheus and Grafana
1084
1090
*/
1085
1091
private static void installPrometheusGrafanaViaChart () throws Exception {
1086
1092
// delete any running pods
@@ -1139,7 +1145,7 @@ private static void installPrometheusGrafanaViaChart() throws Exception {
1139
1145
/**
1140
1146
* Install Prometheus and Grafana using helm chart
1141
1147
*
1142
- * @throws Exception if could not run the command successfully to clone from github
1148
+ * @throws Exception if could not run the command successfully to install webhook and alert manager
1143
1149
*/
1144
1150
private static void installWebHookAndAlertManager () throws Exception {
1145
1151
@@ -1162,7 +1168,7 @@ private static void installWebHookAndAlertManager() throws Exception {
1162
1168
/**
1163
1169
* Uninstall Prometheus and Grafana using helm chart
1164
1170
*
1165
- * @throws Exception if could not run the command successfully to clone from github
1171
+ * @throws Exception if could not run the command successfully to uninstall deployments
1166
1172
*/
1167
1173
private static void uninstallWebHookPrometheusGrafanaViaChart () throws Exception {
1168
1174
logger .info ("Uninstalling webhook" );
@@ -1199,7 +1205,7 @@ private static void uninstallWebHookPrometheusGrafanaViaChart() throws Exception
1199
1205
/**
1200
1206
* Unnstall MYSQL
1201
1207
*
1202
- * @throws Exception if could not run the command successfully to clone from github
1208
+ * @throws Exception if could not run the command successfully to uninstall MySQL
1203
1209
*/
1204
1210
private static void uninstallMySQL () throws Exception {
1205
1211
String monitoringExporterEndToEndDir =
@@ -1218,7 +1224,7 @@ private static void uninstallMySQL() throws Exception {
1218
1224
/**
1219
1225
* Delete PvDir via docker
1220
1226
*
1221
- * @throws Exception if could not run the command successfully to clone from github
1227
+ * @throws Exception if could not run the command successfully to delete PV
1222
1228
*/
1223
1229
private static void deletePvDir () throws Exception {
1224
1230
String pvDir = monitoringExporterEndToEndDir + "pvDir" ;
@@ -1276,7 +1282,7 @@ private static void createCrossNSRBACFile(String domainNS, String operatorNS) th
1276
1282
* call operator to scale to specified number of replicas
1277
1283
*
1278
1284
* @param replicas - number of managed servers
1279
- * @throws Exception exception
1285
+ * @throws Exception if scaling fails
1280
1286
*/
1281
1287
private void scaleCluster (int replicas ) throws Exception {
1282
1288
logger .info ("Scale up/down to " + replicas + " managed servers" );
@@ -1288,7 +1294,7 @@ private void scaleCluster(int replicas) throws Exception {
1288
1294
*
1289
1295
* @param searchKey - metric query expression
1290
1296
* @param expectedVal - expected metrics to search
1291
- * @throws Exception exception
1297
+ * @throws Exception if command to check metrics fails
1292
1298
*/
1293
1299
private static boolean checkMetricsViaPrometheus (String searchKey , String expectedVal )
1294
1300
throws Exception {
0 commit comments