|
205 | 205 | end |
206 | 206 | end |
207 | 207 |
|
| 208 | + it 'retrieves health report' do |
| 209 | + logstash_service = @fixture.get_service("logstash") |
| 210 | + logstash_service.start_with_stdin |
| 211 | + logstash_service.wait_for_logstash |
| 212 | + Stud.try(max_retry.times, [StandardError, RSpec::Expectations::ExpectationNotMetError]) do |
| 213 | + # health_report can fail if the subsystem isn't ready |
| 214 | + result = logstash_service.monitoring_api.health_report rescue nil |
| 215 | + expect(result).not_to be_nil |
| 216 | + expect(result).to be_a(Hash) |
| 217 | + expect(result).to include("status") |
| 218 | + expect(result["status"]).to match(/^(green|yellow|red)$/) |
| 219 | + end |
| 220 | + end |
| 221 | + |
| 222 | + it 'retrieves node plugins information' do |
| 223 | + logstash_service = @fixture.get_service("logstash") |
| 224 | + logstash_service.start_with_stdin |
| 225 | + logstash_service.wait_for_logstash |
| 226 | + Stud.try(max_retry.times, [StandardError, RSpec::Expectations::ExpectationNotMetError]) do |
| 227 | + # node_plugins can fail if the subsystem isn't ready |
| 228 | + result = logstash_service.monitoring_api.node_plugins rescue nil |
| 229 | + expect(result).not_to be_nil |
| 230 | + expect(result).to be_a(Hash) |
| 231 | + expect(result).to include("plugins") |
| 232 | + plugins = result["plugins"] |
| 233 | + expect(plugins).to be_a(Array) |
| 234 | + expect(plugins.size).to be > 0 |
| 235 | + # verify plugin structure and that stdin plugin is present |
| 236 | + stdin_plugin = plugins.find { |p| p["name"] == "logstash-input-stdin" } |
| 237 | + expect(stdin_plugin).not_to be_nil |
| 238 | + expect(stdin_plugin).to include("name") |
| 239 | + expect(stdin_plugin["name"]).to eq("logstash-input-stdin") |
| 240 | + expect(stdin_plugin).to include("version") |
| 241 | + end |
| 242 | + end |
| 243 | + |
208 | 244 | shared_examples "pipeline metrics" do |
209 | 245 | # let(:pipeline_id) { defined?(super()) or fail NotImplementedError } |
210 | 246 | let(:settings_overrides) do |
|
0 commit comments