mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
DNSSEC added (hardcoded key)
DNSSEC is now implemented with the hardcoded key from unbound. This will need to be not hardcoded in the future, but is okay for now. Unit tests updated for DNSSEC (as well as for the fact that, contrary to previous assumption, example.com does not have a static IP address).
This commit is contained in:
parent
d7286395c9
commit
dbf46a721a
2 changed files with 100 additions and 2 deletions
|
@ -43,13 +43,13 @@ TEST(DNSResolver, IPv4Success)
|
|||
|
||||
ASSERT_EQ(1, ips.size());
|
||||
|
||||
ASSERT_STREQ("93.184.216.119", ips[0].c_str());
|
||||
//ASSERT_STREQ("93.184.216.119", ips[0].c_str());
|
||||
|
||||
ips = tools::DNSResolver::instance().get_ipv4("example.com", avail, valid);
|
||||
|
||||
ASSERT_EQ(1, ips.size());
|
||||
|
||||
ASSERT_STREQ("93.184.216.119", ips[0].c_str());
|
||||
//ASSERT_STREQ("93.184.216.119", ips[0].c_str());
|
||||
}
|
||||
|
||||
TEST(DNSResolver, IPv4Failure)
|
||||
|
@ -68,6 +68,38 @@ TEST(DNSResolver, IPv4Failure)
|
|||
ASSERT_EQ(0, ips.size());
|
||||
}
|
||||
|
||||
TEST(DNSResolver, DNSSECSuccess)
|
||||
{
|
||||
tools::DNSResolver resolver;
|
||||
|
||||
bool avail, valid;
|
||||
|
||||
auto ips = resolver.get_ipv4("example.com", avail, valid);
|
||||
|
||||
ASSERT_EQ(1, ips.size());
|
||||
|
||||
//ASSERT_STREQ("93.184.216.119", ips[0].c_str());
|
||||
|
||||
ASSERT_TRUE(avail);
|
||||
ASSERT_TRUE(valid);
|
||||
}
|
||||
|
||||
TEST(DNSResolver, DNSSECFailure)
|
||||
{
|
||||
tools::DNSResolver resolver;
|
||||
|
||||
bool avail, valid;
|
||||
|
||||
auto ips = resolver.get_ipv4("dnssec-failed.org", avail, valid);
|
||||
|
||||
ASSERT_EQ(1, ips.size());
|
||||
|
||||
//ASSERT_STREQ("93.184.216.119", ips[0].c_str());
|
||||
|
||||
ASSERT_TRUE(avail);
|
||||
ASSERT_FALSE(valid);
|
||||
}
|
||||
|
||||
// It would be great to include an IPv6 test and assume it'll pass, but not every ISP / resolver plays nicely with IPv6;)
|
||||
/*TEST(DNSResolver, IPv6Success)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue