]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
unittest_config: $host expands to ceph_get_short_hostname(), not hostname -s 23916/head
authorSage Weil <sage@redhat.com>
Sat, 1 Sep 2018 20:56:05 +0000 (15:56 -0500)
committerSage Weil <sage@redhat.com>
Tue, 4 Sep 2018 16:29:23 +0000 (11:29 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit c7916097c207494618c56a6526cf63ff22ba64c3)

src/test/common/test_config.cc

index 6e7bd7ccd3ede9d6ee28087447a541233e3a8489..773507c96812b3da8cf2ccb66f6813775c740a1c 100644 (file)
@@ -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());
     }