|
| 1 | +--- |
| 2 | +"Check User Can't Write To Substream Directly": |
| 3 | + - do: |
| 4 | + streams.logs_enable: { } |
| 5 | + - is_true: acknowledged |
| 6 | + |
| 7 | + - do: |
| 8 | + streams.status: { } |
| 9 | + - is_true: logs.enabled |
| 10 | + |
| 11 | + - do: |
| 12 | + bulk: |
| 13 | + body: | |
| 14 | + { "index": { "_index": "logs.foo" } } |
| 15 | + { "foo": "bar" } |
| 16 | + - match: { errors: true } |
| 17 | + - match: { items.0.index.status: 400 } |
| 18 | + - match: { items.0.index.error.type: "illegal_argument_exception" } |
| 19 | + - match: { items.0.index.error.reason: "Writes to child stream [logs.foo] are not allowed, use the parent stream instead: [logs]" } |
| 20 | + |
| 21 | +--- |
| 22 | +"Check User Can't Write To Substream Directly With Single Doc": |
| 23 | + - do: |
| 24 | + streams.logs_enable: { } |
| 25 | + - is_true: acknowledged |
| 26 | + |
| 27 | + - do: |
| 28 | + streams.status: { } |
| 29 | + - is_true: logs.enabled |
| 30 | + |
| 31 | + - do: |
| 32 | + catch: bad_request |
| 33 | + index: |
| 34 | + index: logs.foo |
| 35 | + id: "1" |
| 36 | + body: |
| 37 | + foo: bar |
| 38 | + - match: { error.type: "illegal_argument_exception" } |
| 39 | + - match: { error.reason: "Writes to child stream [logs.foo] are not allowed, use the parent stream instead: [logs]" } |
| 40 | + |
| 41 | +--- |
| 42 | +"Check Bulk Index With Reroute Processor To Substream Is Rejected": |
| 43 | + - do: |
| 44 | + streams.logs_enable: { } |
| 45 | + - is_true: acknowledged |
| 46 | + |
| 47 | + - do: |
| 48 | + streams.status: { } |
| 49 | + - is_true: logs.enabled |
| 50 | + |
| 51 | + - do: |
| 52 | + ingest.put_pipeline: |
| 53 | + id: "reroute-to-logs-foo" |
| 54 | + body: |
| 55 | + processors: |
| 56 | + - reroute: |
| 57 | + destination: "logs.foo" |
| 58 | + - do: |
| 59 | + indices.create: |
| 60 | + index: "bad-index" |
| 61 | + body: |
| 62 | + settings: |
| 63 | + index.default_pipeline: "reroute-to-logs-foo" |
| 64 | + - do: |
| 65 | + bulk: |
| 66 | + body: | |
| 67 | + { "index": { "_index": "bad-index" } } |
| 68 | + { "foo": "bar" } |
| 69 | + - match: { errors: true } |
| 70 | + - match: { items.0.index.status: 400 } |
| 71 | + - match: { items.0.index.error.type: "illegal_argument_exception" } |
| 72 | + - match: { items.0.index.error.reason: "Cannot reroute to substream [logs.foo] as only the stream itself can reroute to substreams. Please reroute to the stream [logs] instead." } |
0 commit comments