]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Aadpt test to always truncate at '.' which happens <= 4.3.x 9367/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 31 Jul 2020 08:14:50 +0000 (10:14 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 31 Jul 2020 08:14:50 +0000 (10:14 +0200)
pdns/test-misc_hh.cc

index 01c4c3fb4e38f6aeaba49390ab4c2359a303d15f..36692be901662152a22a519c78e5a09b58876985 100644 (file)
@@ -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();