From c7916097c207494618c56a6526cf63ff22ba64c3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 1 Sep 2018 15:56:05 -0500 Subject: [PATCH] unittest_config: $host expands to ceph_get_short_hostname(), not hostname -s Signed-off-by: Sage Weil --- src/test/common/test_config.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/common/test_config.cc b/src/test/common/test_config.cc index abc7133a131..19dab10a81b 100644 --- a/src/test/common/test_config.cc +++ b/src/test/common/test_config.cc @@ -22,6 +22,7 @@ #include "common/config_proxy.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 @@ -60,7 +61,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()); } -- 2.39.5