Tests: Wait for DNS to really work before proceeding.
ws: Make test-server fail on warnings and criticals

The other tests all abort on warnings and criticals (except for
cases where these are expected). Make test-server behave similarly.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
tap-driver: Update TAP harness and compiler with fixes from elsewhere

Broader use of the TAP harness and compiler has shown several
bugs which have been fixed. We can benefit from these fixes.

Make test-server detect whether running under a test harness
by using an environment variable. Using --tap argument conflicted
with how tap-gtester was running tests.

This includes fixes needed by the next commit, which brings
valgrind into play.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Makefile.am: Add 'make check-memory' target which runs valgrind

Add some basic suppressions files. These can be expanded.

No leak checking yet, that's dependent on the glib wip/gcleanup
branch and not yet ready.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Closes #246
ws: Optionally return headers in HTTP error responses

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Add ability to return headers from CockpitAuth code

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Refactor CockpitCreds into its own class

This way we can avoid copying credentials, and start to abstract
the different kinds of credentials that result from different kinds
of authentication.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Make CockpitAuth 'authenticate' signal

And make the fallthrough authentication in test-server
be a handler for it.

In the future this will let us have multiple authentication
handlers handling the headers.

But this also lets us get rid of the fallthrough code in
cockpit_auth_check_headers() which was very dangerous.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Use 401 as the 'Authentication Failed' HTTP status

401 is the HTTP not-authorized status. 403 is forbidden, which is
something very different, although we should handle that correctly
at some point as well.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>