[Ingest Manager] Add tests to validate base template and indexing strategy
On startup, Elasticsearch installs two base index templates for logs-*-* and metrics-*-*. This is especially important for the Elastic Agent in standalone mode. We should add tests to validate the following items:
- Are templates loaded and contain the information we expected for the
data_stream.*and@timestampfields? - If we ship data from Elastic Agent in standalone mode, do the events stored in Elasticsearch contain the correct mapping?
- Does the Elastic Agent ship data to the current indices with the default config:
logs-generic-default(for logs) - Does changing the
data_stream.datasetanddata_stream.namespaceon an input work as expected, creating the correct data streams with the correct mappings?
The above should help give us some confidence that the Elastic Agent works as expected in standalone mode.
I think this should be covered by the e2e test for standalone cc @EricDavisX
I don't believe the stand-alone test covers any of this yet, the test is very basic at current.
I do love that we added a ticket! Thank you much @ruflin. Truthfully, it's almost big enough to be a 'Meta' ticket. We'll need to break this down and assess the individual ES and Kibana (and Agent host side) assertions we can run and what expected values are for the usage we have in place.
I would love it if we can get the Agent team involved in this.
Kind of separately, one thought I had is that the 'stand-alone' tests can be updated routinely (where applicable) with likely most of the same .feature file side steps, after they are implemented. All we really need to do is insert in the configuration side changes (easily captured from Ingest UI). Tho, the real desire / challenge long-term is not to have to update the config in N number of places if something changes, ideally the test framework would build the config somehow dynamically from different parts so that if anyone part changes only the relating section needs updating. In this way, we somewhat inherit the test coverage for stand-alone by any Fleet side tests.