]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
unittest_config: $host expands to ceph_get_short_hostname(), not hostname -s
authorSage Weil <sage@redhat.com>
Sat, 1 Sep 2018 20:56:05 +0000 (15:56 -0500)
committerSage Weil <sage@redhat.com>
Sat, 1 Sep 2018 20:57:27 +0000 (15:57 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/common/test_config.cc

index abc7133a131f0b674dc59a5aed2ff2c3a0d27f21..19dab10a81bc2a46aebeba7dda52d2d5473e922e 100644 (file)
@@ -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());
     }