2014-11-24 05:52:41 -05:00
|
|
|
[[Testing Framework Cheatsheet]]
|
|
|
|
= Testing
|
|
|
|
|
|
|
|
[partintro]
|
|
|
|
|
|
|
|
Elasticsearch and Shield use jUnit for testing, they also use randomness
|
|
|
|
in the tests, that can be set using a seed, please refer to the
|
|
|
|
Elasticsearch TESTING.asciidoc cheatsheet to know all about it.
|
|
|
|
|
|
|
|
Tests are executed with network transport and unicast discovery, as this is
|
|
|
|
the configuration that's secured by shield.
|
|
|
|
|
|
|
|
== Testing the REST layer
|
|
|
|
|
|
|
|
The available integration tests are specific for Shield functionalities
|
|
|
|
and make use of the java API to communicate with the elasticsearch nodes,
|
|
|
|
using the internal binary transport (port 9300 by default).
|
|
|
|
Shield is also tested using the REST tests provided by Elasticsearch core,
|
|
|
|
just by running those same tests against a cluster with Shield installed.
|
|
|
|
|
|
|
|
The REST tests are not run automatically when executing the maven test
|
2015-05-26 13:18:26 -04:00
|
|
|
command just yet (they are run with the regular suite when -Dtests.slow=true
|
|
|
|
is supplied). Some tests are blacklisted as they are known to fail against
|
|
|
|
shield due to different behaviours introduced by the security plugin.
|
2014-11-24 05:52:41 -05:00
|
|
|
|
|
|
|
---------------------------------------------------------------------------
|
2015-05-26 13:18:26 -04:00
|
|
|
mvn test -Dtests.filter="@Rest"
|
2014-11-24 05:52:41 -05:00
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
`ShieldRestTests` is the executable test class that runs all the
|
|
|
|
yaml suites available within the `rest-api-spec` folder.
|
|
|
|
|