@@ -124,37 +124,60 @@ public static void staticUnPrepare() throws Exception {
124124 logger .info ("SUCCESS" );
125125 }
126126 }
127-
127+
128128 private static void verifyElasticStackReady () throws Exception {
129129 // Get Logstash info
130130 String healthStatus = execElasticStackStatusCheck ("*logstash*" , "$1" );
131131 String indexStatus = execElasticStackStatusCheck ("*logstash*" , "$2" );
132132 String indexName = execElasticStackStatusCheck ("*logstash*" , "$3" );
133133
134- // Verify that the health status of Logstash
135134 Assume .assumeNotNull (healthStatus );
135+ Assume .assumeNotNull (indexStatus );
136+ Assume .assumeNotNull (indexName );
137+ // Verify that the health status of Logstash
136138 Assume .assumeTrue (
137139 "Logstash is not ready!" ,
138- healthStatus .equalsIgnoreCase ("yellow" ) || healthStatus .equalsIgnoreCase ("green" ));
140+ healthStatus .equalsIgnoreCase ("yellow" ) ||
141+ healthStatus .equalsIgnoreCase ("green" ));
139142 // Verify that the index is open for use
140- Assume .assumeNotNull ( indexStatus );
141- Assume . assumeTrue ( "Logstash index is not open!" , indexStatus .equalsIgnoreCase ("open" ));
143+ Assume .assumeTrue ( "Logstash index is not open!" ,
144+ indexStatus .equalsIgnoreCase ("open" ));
142145 // Add the index name to a Map
143- Assume .assumeNotNull (indexName );
144146 testVarMap .put ("indexName" , indexName );
145147
146148 // Get Kibana info
147149 healthStatus = execElasticStackStatusCheck ("*kibana*" , "$1" );
148150 indexStatus = execElasticStackStatusCheck ("*kibana*" , "$2" );
149-
150- // Verify that the health status of Kibana
151+ indexName = execElasticStackStatusCheck ( "*kibana*" , "$3" );
152+
151153 Assume .assumeNotNull (healthStatus );
152- Assume .assumeTrue (
153- "Kibana is not ready!" ,
154- healthStatus .equalsIgnoreCase ("yellow" ) || healthStatus .equalsIgnoreCase ("green" ));
155- // Verify that the index is open for use
156154 Assume .assumeNotNull (indexStatus );
157- Assume .assumeTrue ("Kibana index is not open!" , indexStatus .equalsIgnoreCase ("open" ));
155+ Assume .assumeNotNull (indexName );
156+
157+ //There are multiple indexes from Kibana 6.8.0
158+ String [] kibanahealthStatusArr =
159+ healthStatus .split (System .getProperty ("line.separator" ));
160+ String [] kibanaindexStatusArr =
161+ indexStatus .split (System .getProperty ("line.separator" ));
162+ String [] kibanaindexNameArr =
163+ indexName .split (System .getProperty ("line.separator" ));
164+
165+ for (int i = 0 ; i < kibanaindexStatusArr .length ; i ++) {
166+ logger .info ("Health status of " + kibanaindexNameArr [i ] +
167+ "is:" + kibanahealthStatusArr [i ]);
168+ logger .info ("Index status of " + kibanaindexNameArr [i ] +
169+ "is:" + kibanaindexStatusArr [i ]);
170+ // Verify that the health status of Kibana
171+ Assume .assumeTrue (
172+ "Kibana is not ready!" ,
173+ kibanahealthStatusArr [i ].trim ().equalsIgnoreCase ("yellow" ) ||
174+ kibanahealthStatusArr [i ].trim ().equalsIgnoreCase ("green" ));
175+ // Verify that the index is open for use
176+ Assume .assumeTrue ("Kibana index is not open!" ,
177+ kibanaindexStatusArr [i ].trim ().equalsIgnoreCase ("open" ));
178+ }
179+
180+ logger .info ("ELK Stack is up and running and ready to use!" );
158181 }
159182
160183 private static String execElasticStackStatusCheck (String indexName , String varLoc )
0 commit comments