From 28d2b25ef2cdb444c261b989511f04458300401c Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 31 Jul 2020 10:14:50 +0200 Subject: [PATCH] Aadpt test to always truncate at '.' which happens <= 4.3.x --- pdns/test-misc_hh.cc | 4 ++++ 1 file changed, 4 insertions(+) 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(); -- 2.47.2