unit-tests: Don't fail host_create_from_dns() test if IPv6 not supported
On some systems, such as the Ubuntu daily build machine, localhost does not resolve to an IPv6 address. Accept such a lookup failure.
This commit is contained in:
@@ -245,12 +245,18 @@ static void test_create_from_dns(int family, chunk_t addr)
|
|||||||
host_t *host;
|
host_t *host;
|
||||||
|
|
||||||
host = host_create_from_dns("localhost", family, 500);
|
host = host_create_from_dns("localhost", family, 500);
|
||||||
ck_assert(host);
|
if (family != AF_INET6)
|
||||||
if (family != AF_UNSPEC)
|
|
||||||
{
|
{
|
||||||
verify_address(host, addr, family, 500);
|
ck_assert(host != NULL);
|
||||||
|
}
|
||||||
|
if (host)
|
||||||
|
{
|
||||||
|
if (family != AF_UNSPEC)
|
||||||
|
{
|
||||||
|
verify_address(host, addr, family, 500);
|
||||||
|
}
|
||||||
|
host->destroy(host);
|
||||||
}
|
}
|
||||||
host->destroy(host);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST(test_create_from_dns_any)
|
START_TEST(test_create_from_dns_any)
|
||||||
|
|||||||
Reference in New Issue
Block a user