From: Sage Weil Date: Sat, 1 Sep 2018 20:56:05 +0000 (-0500) Subject: unittest_config: $host expands to ceph_get_short_hostname(), not hostname -s X-Git-Tag: v13.2.3~82^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=36bc1c8ae480e2435af9f292fda5beade3b328fb;p=ceph.git unittest_config: $host expands to ceph_get_short_hostname(), not hostname -s Signed-off-by: Sage Weil (cherry picked from commit c7916097c207494618c56a6526cf63ff22ba64c3) --- diff --git a/src/test/common/test_config.cc b/src/test/common/test_config.cc index 6e7bd7ccd3ed..773507c96812 100644 --- a/src/test/common/test_config.cc +++ b/src/test/common/test_config.cc @@ -22,6 +22,7 @@ #include "common/config.h" #include "common/errno.h" #include "gtest/gtest.h" +#include "common/hostname.h" extern std::string exec(const char* cmd); // defined in test_hostname.cc @@ -61,7 +62,7 @@ public: std::string after = " AFTER "; std::string val(before + "$host${host}" + after); early_expand_meta(val, &oss); - std::string hostname = exec("hostname -s"); + std::string hostname = ceph_get_short_hostname(); EXPECT_EQ(before + hostname + hostname + after, val); EXPECT_EQ("", oss.str()); }