CBQE-2237: hostname tests refactoring

Change-Id: I3b6ea4beb69dce22f8d8169fb8309a541f699a18
Reviewed-on: http://review.couchbase.org/36891
Reviewed-by: Andrei Baranouski <andrei.baranouski@gmail.com>
Tested-by: buildbot <build@couchbase.com>