Just like all other test assertions, this one should also be retried
until it succeeds or times out. It seems this wasn't a problem before,
but with the upcoming changes to Icinga 2.16, this assertion will fail
occasionally since the queries are now sent with a bit of delay. By
retrying the assertion, we can ensure that it will eventually succeed
once the queries are processed or time out after a reasonable period.
A recent change in icinga2 [1] prevents modifying some object attributes via
the API, most notably those that influence the name of the object. Previously,
the tests would also include these attributes in the POST requests that modify
the objects (but with the same value as before), something that is now
rejected. Therefore, this commits allows to label attributes as "nomodify" so
that they won't be sent in this case.
[1]: https://github.com/Icinga/icinga2/pull/9407
The new version deploys its own ApiUser so there is no more need to do this
here and also waits for reloads to finish, so no more need for some sleeps.