Commits


icinga_test: Don't assign group for random hosts We can test hostgroup assignment in other tests if desired.


icinga_test: Inline permissions response No need for a file on disk; it's only referenced once.


Test against a fake in-processs icinga server A lot of the testing doesn't really flex what a real icinga2 server does. We can implement a simple fake server with about 250 lines of Go, then we get all the benefits of really quick feedback and no dependency on an icinga2 server (which isn't super easy to set up) for most tests. More complicated tests are still performed against a real server listening on loopback (if available).


Correctly return ErrNoMatch when rescheduling a check For some reason the API returns an internal server error status rather than a Not Found status (as in other methods in the API). We can catch the condition when results are empty and return ErrNoMatch.


Properly encode spaces in filter expressions This is a bit tricky. url.QueryEscape() encodes spaces in queries as "+", but Icinga2 wants them as "%20". A test case is included because this was kinda tricky to debug.


Correctly return ErrNoMatch The check was incorrect before. The HTTP status on responses is still 200 OK, but with empty results if there are no matches to the filter.


Implement checker interface for HostGroup This also adds a test for checking all hosts in a HostGroup.


Support cascading delete of objects


Add checking of services and hosts And also add a icinga_test package that does the black-box tests i.e. tests which speak to a real icinga server.