Test: index dump on test failure

This changes adds the ability for a test to create an index dump if a search request fails the test. This can be helpful to be able to analyse the index state after the test has failed
We are requesting the get repository by name. This method will throw an exception if the repository doesn't exist. I actually expect the catch block to be used all the time and the check of the response is just a safety.  Although, maybe there is an ignore_missing option I can turn on so that I don't have to deal with the exception and can just check the response. I'll have a look