[Test] Converts LocalExporterTests.testLocalExporterFlush() as REST test (elastic/x-pack-elasticsearch#969)

The LocalExporterTests.testLocalExporterFlush() test was removed in elastic/x-pack-elasticsearch#835 when
LocalExporterTests was changed. This test verified that export exceptions are
thrown when monitoring documents are exported using the Monitoring Bulk API but
the underlying  monitoring indices are closed.

This commit reintroduces this test, but as a REST test this time.

relates elastic/x-pack-elasticsearch#416

Original commit: elastic/x-pack-elasticsearch@0a42f9a1be
This commit is contained in:
Tanguy Leroux 2017-05-16 10:08:40 +02:00 committed by GitHub
parent ef3b954f63
commit 9a06b5ee77
1 changed files with 47 additions and 0 deletions

View File

@ -111,3 +111,50 @@
body:
- '{"index": {}}'
- '{"field_1": "value_1"}'
---
"Bulk indexing of monitoring data on closed indices should throw an export exception":
- do:
xpack.monitoring.bulk:
system_id: "beats"
system_api_version: "2"
interval: "5s"
body:
- index:
_type: metric_beat
- modules:
nginx: true
mysql: false
- index:
_type: file_beat
- file:
path: /var/log/dmesg
size: 31kb
- is_false: errors
- do:
indices.refresh: {}
- do:
search:
index: .monitoring-beats-*
- match: { hits.total: 2 }
- do:
indices.close:
index: .monitoring-beats-*
- do:
catch: /export_exception/
xpack.monitoring.bulk:
system_id: "beats"
system_api_version: "2"
interval: "5s"
body:
- index:
_type: file_beat
- file:
path: /var/log/auth.log
size: 5kb