Omit downloader resolve test when it won't fail

Fixes: #3108
This commit is contained in:
Mike Ellery
2019-10-14 20:20:05 -07:00
committed by Manoj doshi
parent 113167acf4
commit b2317f8b41

View File

@@ -169,6 +169,15 @@ class SSLHTTPDownloader_test : public beast::unit_test::suite
}
{
// bad hostname
boost::system::error_code ec;
boost::asio::ip::tcp::resolver resolver {env.app().getIOService()};
auto const results = resolver.resolve("badhostname", "443", ec);
// we require an error in resolving this name in order
// for this test to pass. Some networks might have DNS hijacking
// that prevent NXDOMAIN, in which case the failure is not
// possible, so we skip the test.
if (ec)
{
Downloader dl {env};
ripple::test::detail::FileDirGuard const datafile {
*this, "downloads", "data", "", false, false};
@@ -186,6 +195,7 @@ class SSLHTTPDownloader_test : public beast::unit_test::suite
!= std::string::npos,
dl.sink_.messages().str());
}
}
{
// can't connect
Downloader dl {env};