]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/admin_socket: check error message according to OS
authorYan, Zheng <zyan@redhat.com>
Fri, 31 Jul 2015 09:18:58 +0000 (17:18 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 31 Aug 2015 08:00:27 +0000 (16:00 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/test/admin_socket.cc

index b26acb8908d5352ab3160b4aaaf0785c0da61691..cee215d2e96f6da8550df5b63119830aff4e4830 100644 (file)
@@ -217,7 +217,12 @@ TEST(AdminSocketClient, Ping) {
   {
     bool ok;
     std::string result = client.ping(&ok);
-    EXPECT_NE(std::string::npos, result.find("Connection refused"));
+#if defined(__APPLE__) || defined(__FreeBSD__)
+    const char* errmsg = "Socket operation on non-socket";
+#else
+    const char* errmsg = "Connection refused";
+#endif
+    EXPECT_NE(std::string::npos, result.find(errmsg));
     ASSERT_FALSE(ok);
   }
   // a daemon is connected to the socket