From: Otto Moerbeek Date: Fri, 31 Jul 2020 08:14:50 +0000 (+0200) Subject: Aadpt test to always truncate at '.' which happens <= 4.3.x X-Git-Tag: rec-4.3.4~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9367%2Fhead;p=thirdparty%2Fpdns.git Aadpt test to always truncate at '.' which happens <= 4.3.x --- diff --git a/pdns/test-misc_hh.cc b/pdns/test-misc_hh.cc index 01c4c3fb4e..36692be901 100644 --- a/pdns/test-misc_hh.cc +++ b/pdns/test-misc_hh.cc @@ -208,6 +208,10 @@ BOOST_AUTO_TEST_CASE(test_getCarbonHostName) BOOST_CHECK_EQUAL(gethostname(buffer, sizeof buffer), 0); std::string my_hostname(buffer); + auto pos = my_hostname.find("."); + if (pos != std::string::npos) { + my_hostname.resize(pos); + } boost::replace_all(my_hostname, ".", "_"); std::string hostname = getCarbonHostName();