testing: freebsd on cirrus
authorMichael Wallner <mike@php.net>
Mon, 12 Oct 2020 17:24:25 +0000 (19:24 +0200)
committerMichael Wallner <mike@php.net>
Mon, 12 Oct 2020 17:26:46 +0000 (19:26 +0200)
20 files changed:
.cirrus.yml [new file with mode: 0644]
.github/workflows/cmake-build-ci.gen
.github/workflows/cmake-build-ci.yml
CMake/EnableDtrace.cmake [new file with mode: 0644]
CMake/_Include.cmake
src/bin/common/CMakeLists.txt
src/libmemcached/CMakeLists.txt
src/libmemcached/assert.hpp
src/libmemcached/backtrace.cc
src/libmemcachedutil/CMakeLists.txt
src/mem_config.h.in
test/lib/Server.cpp
test/lib/random.hpp
test/tests/bin/memcp.cpp
test/tests/bin/memdump.cpp
test/tests/bin/memflush.cpp
test/tests/bin/memping.cpp
test/tests/bin/memrm.cpp
test/tests/bin/memstat.cpp
test/tests/memcached/util.cpp

diff --git a/.cirrus.yml b/.cirrus.yml
new file mode 100644 (file)
index 0000000..c7fe30b
--- /dev/null
@@ -0,0 +1,51 @@
+env:
+  CMAKE_BUILD_TYPE:   Debug
+  BUILD_TESTING:      "ON"
+  ENABLE_SASL:        "ON"
+  ENABLE_HASH_HSIEH:  "ON"
+  ENABLE_DTRACE:      "ON"
+  VERBOSE:            "ON"
+  MEMCACHED_BINARY:   "/usr/local/bin/memcached"
+
+task:
+  name: Freebsd
+  env:
+    ports: RELEASE_12_1_0
+  freebsd_instance:
+    image_family: freebsd-12-1
+  dependencies_script: |
+    pkg update
+    pkg upgrade -y
+    pkg install -y \
+      autotools \
+      bison \
+      cmake \
+      cyrus-sasl \
+      flex \
+      libevent \
+      pkgconf \
+      subversion \
+      sudo
+  memcached_script: |
+    svn co https://svn.freebsd.org/ports/tags/${ports}/databases/memcached memcached
+    svn co https://svn.freebsd.org/ports/tags/${ports}/Mk /usr/ports/Mk
+    svn co https://svn.freebsd.org/ports/tags/${ports}/Templates /usr/ports/Templates
+    cd memcached
+    echo bin/memcached > pkg-plist
+    make all install SASLPWDB_CONFIGURE_ENABLE=sasl-pwdb OPTIONS_SET="SASL SASLPWDB" OPTIONS_DEFINE="SASL SASLPWDB"
+    cd ..
+  prepare_script: |
+    mkdir build
+    chown nobody build
+    chsh -s /bin/sh nobody
+  configure_script: |
+    sudo -E -u nobody cmake -S . -B build
+  build_script: |
+    sudo -E -u nobody make -C build -j2 all
+  test_script: |
+    sudo -E -u nobody make -C build -j2 test/fast
+  install_script: |
+    sudo -E -u nobody make -C build install DESTDIR=/tmp
+  on_failure:
+    failed_script: |
+      cat build/Testing/Temporary/LastTest.log || true
index 0d1e1be072a948d29efd468d93e20bf360f8c9a4..c6bd81fb3b90af74847c4660719b91900dcfa2f7 100755 (executable)
@@ -191,6 +191,7 @@ on:
     paths-ignore:
       - "docs/**"
       - ".travis.yml"
+      - ".cirrus.yml"
     branches-ignore:
       - gh-pages
       - catch
index 492c4d532bd44355776e5d0e85e22356854de053..3209d0ad9d81d37d558ec9eae0a28cdda341438a 100644 (file)
@@ -5,6 +5,7 @@ on:
     paths-ignore:
       - "docs/**"
       - ".travis.yml"
+      - ".cirrus.yml"
     branches-ignore:
       - gh-pages
       - catch
diff --git a/CMake/EnableDtrace.cmake b/CMake/EnableDtrace.cmake
new file mode 100644 (file)
index 0000000..184a327
--- /dev/null
@@ -0,0 +1,55 @@
+function(enable_dtrace_for TARGET PROBES_D PROBES_H)
+    if(HAVE_DTRACE AND NOT CMAKE_CROSSCOMPILING)
+        target_sources(${TARGET} PRIVATE ${PROBES_H})
+        add_custom_command(
+                OUTPUT
+                    ${PROBES_H}
+                MAIN_DEPENDENCY
+                    ${PROBES_D}
+                COMMAND
+                    ${DTRACE_EXECUTABLE}
+                ARGS
+                    -x nolibs -h
+                    -s ${CMAKE_CURRENT_SOURCE_DIR}/${PROBES_D}
+                    -o ${PROBES_H}
+        )
+        if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+            add_custom_command(
+                    OUTPUT
+                        ${TARGET}_probes.o
+                    MAIN_DEPENDENCY
+                        ${PROBES_H}
+                    COMMAND
+                        ${DTRACE_EXECUTABLE}
+                    ARGS
+                        -x nolibs -G
+                        -s ${CMAKE_CURRENT_SOURCE_DIR}/${PROBES_D}
+                        -o ${TARGET}_probes.o
+            )
+            target_sources(${TARGET} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_probes.o)
+            set_source_files_properties(${TARGET}_probes.o PROPERTIES
+                    GENERATED true
+                    EXTERNAL_OBJECT true)
+        else() # not Linux
+            set(PROBES_C ${TARGET}_probes.cc)
+            file(GENERATE
+                    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PROBES_C}
+                    CONTENT "#include \"${PROBES_H}\""
+                    )
+            add_custom_command(
+                    TARGET ${TARGET}
+                        PRE_LINK
+                    DEPENDS
+                        ${PROBES_H}
+                    COMMAND
+                        rm -f ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TARGET}.dir/${PROBES_C}.o
+                    COMMAND
+                        ${DTRACE_EXECUTABLE} -x nolibs -G
+                        -s ${CMAKE_CURRENT_SOURCE_DIR}/${PROBES_D}
+                        -o ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TARGET}.dir/${PROBES_C}.o
+                           ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TARGET}.dir/*.o
+                )
+            target_sources(${TARGET} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${PROBES_C})
+        endif()
+    endif()
+endfunction()
index a6b5463c1a1b201be45a823df8a0f5d1884e0cef..67fe16bfd826c88728cd109ea86a0523899f8311 100644 (file)
@@ -6,6 +6,12 @@ endif()
 include(GNUInstallDirs)
 include(CMakePackageConfigHelpers)
 
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
+    find_program(PKGCONF pkgconf)
+    if(PKGCONF)
+        set(PKG_CONFIG_EXECUTABLE ${PKGCONF})
+    endif()
+endif()
 find_package(PkgConfig)
 set(THREADS_PREFER_PTHREAD_FLAG ON)
 find_package(Threads REQUIRED)
@@ -34,6 +40,7 @@ if(ENABLE_MEMASLAP)
 endif()
 
 ## dtrace
+include(EnableDtrace)
 if(ENABLE_DTRACE)
     find_package(DTrace)
     if(DTRACE_EXECUTABLE)
@@ -69,10 +76,10 @@ endif()
 
 # system checks
 
+check_header(alloca.h)
 check_header(arpa/inet.h)
 check_header(dlfcn.h)
 check_header(errno.h)
-check_header(execinfo.h)
 check_header(fcntl.h)
 check_header(io.h)
 check_header(limits.h)
@@ -103,8 +110,13 @@ check_decl(setenv stdlib.h)
 check_decl(strerror string.h)
 check_decl(strerror_r string.h)
 check_compiles(HAVE_STRERROR_R_CHAR_P "char x, y = *strerror_r(0,&x,1);" string.h)
+
 check_decl(abi::__cxa_demangle cxxabi.h)
-set(HAVE_GCC_ABI_DEMANGLE ${HAVE_ABI____CXA_DEMANGLE})
+
+find_package(Backtrace)
+if(Backtrace_FOUND)
+    set(HAVE_BACKTRACE 1)
+endif()
 
 check_type(in_port_t netinet/in.h)
 
index c452049a5ca3013d5d91ec98293a6a187b91ca58..d1fd699ea2f27c59d6efe9b38cd3abd8f882cb91 100644 (file)
@@ -1,6 +1,6 @@
 add_library(libclient_common STATIC utilities.cc generator.cc execute.cc)
 add_library(client_common ALIAS libclient_common)
-target_link_libraries(libclient_common PRIVATE libmemcachedinternal)
+target_link_libraries(libclient_common PUBLIC libmemcachedinternal)
 target_include_directories(libclient_common PUBLIC
         .
         ${CMAKE_SOURCE_DIR}/include
index a029ac58f235a9f3f12c0ce50456cf63313f5d11..819a98f7c225de3ad5d56cb973aec622329b4c4b 100644 (file)
@@ -2,7 +2,7 @@
 find_package(FLEX)
 find_package(BISON 2.3)
 
-if(${BISON_VERSION} VERSION_GREATER_EQUAL 3.0)
+if("${BISON_VERSION}" VERSION_GREATER_EQUAL 3.0)
         set(BISON_WARNINGS -Wno-deprecated)
 endif()
 
@@ -18,27 +18,10 @@ flex_target(CSL_SCANNER csl/scanner.l ${CMAKE_CURRENT_BINARY_DIR}/csl/scanner.cc
 set_source_files_properties(${FLEX_CSL_SCANNER_OUTPUTS} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
 add_flex_bison_dependency(CSL_SCANNER CSL_PARSER)
 
-if(HAVE_DTRACE)
-        add_custom_command(
-                OUTPUT dtrace_probes.h
-                COMMAND ${DTRACE_EXECUTABLE}
-                ARGS -h -o dtrace_probes.h -s ${CMAKE_CURRENT_SOURCE_DIR}/libmemcached_probes.d
-                MAIN_DEPENDENCY libmemcached_probes.d
-        )
-        add_custom_command(
-                OUTPUT libmemcached_probes.o
-                COMMAND ${DTRACE_EXECUTABLE}
-                ARGS -o libmemcached_probes.o -G -s ${CMAKE_CURRENT_SOURCE_DIR}/libmemcached_probes.d
-                MAIN_DEPENDENCY dtrace_probes.h
-        )
-        set(DTRACE_GENERATED_OUTPUT libmemcached_probes.o)
-endif()
-
 set(LIBMEMCACHED_SOURCES
         csl/context.cc
         ${BISON_CSL_PARSER_OUTPUTS}
         ${FLEX_CSL_SCANNER_OUTPUTS}
-        ${DTRACE_GENERATED_OUTPUT}
         allocators.cc
         analyze.cc
         array.c
@@ -97,17 +80,20 @@ set_target_properties(libmemcached PROPERTIES
         SOVERSION ${LIBMEMCACHED_SO_VERSION}
         VERSION v${LIBMEMCACHED_VERSION})
 target_compile_definitions(libmemcached PRIVATE -DBUILDING_LIBMEMCACHED)
-target_link_libraries(libmemcached PUBLIC libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS})
-target_include_directories(libmemcached PRIVATE ${LIBSASL_INCLUDEDIR})
+target_link_libraries(libmemcached PUBLIC libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS} ${Backtrace_LIBRARIES})
+target_include_directories(libmemcached PRIVATE ${Backtrace_INCLUDE_DIR})
 target_include_directories(libmemcached PRIVATE
         ${CMAKE_SOURCE_DIR}/src
         ${CMAKE_BINARY_DIR}/src
         ${CMAKE_BINARY_DIR})
+target_include_directories(libmemcached PUBLIC ${LIBSASL_INCLUDEDIR})
 target_include_directories(libmemcached PUBLIC
         $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
         $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
         $<INSTALL_INTERFACE:include>)
 
+enable_dtrace_for(libmemcached libmemcached_probes.d dtrace_probes.h)
+
 install(TARGETS libmemcached EXPORT libmemcached-targets
         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
 export(EXPORT libmemcached-targets NAMESPACE libmemcached::)
@@ -126,17 +112,20 @@ add_library(libmemcachedinternal STATIC
 add_library(memcachedinternal ALIAS libmemcachedinternal)
 set_target_properties(libmemcachedinternal PROPERTIES LIBRARY_OUTPUT_NAME memcachedinternal)
 target_compile_definitions(libmemcachedinternal PRIVATE -DBUILDING_LIBMEMCACHEDINTERNAL)
-target_link_libraries(libmemcachedinternal PUBLIC libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS})
-target_include_directories(libmemcachedinternal PRIVATE ${LIBSASL_INCLUDEDIR})
+target_link_libraries(libmemcachedinternal PUBLIC libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS} ${Backtrace_LIBRARIES})
+target_include_directories(libmemcachedinternal PRIVATE ${Backtrace_INCLUDE_DIR})
 target_include_directories(libmemcachedinternal PRIVATE
         ${CMAKE_SOURCE_DIR}/src
         ${CMAKE_BINARY_DIR}/src
         ${CMAKE_BINARY_DIR})
+target_include_directories(libmemcachedinternal PUBLIC ${LIBSASL_INCLUDEDIR})
 target_include_directories(libmemcachedinternal PUBLIC
         $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
         $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
         $<INSTALL_INTERFACE:include>)
 
+enable_dtrace_for(libmemcachedinternal libmemcached_probes.d dtrace_probes.h)
+
 # let libmemcached depend on libmemcachedinternal to ensure that they do not
 # compete for the same generated dependencies
 add_dependencies(libmemcached libmemcachedinternal)
index a1526babe857ae115ea4fd95ced3b28b4343b29c..de2283a717d39d894fd2e4b4528f1334bf4ec319 100644 (file)
@@ -1,5 +1,5 @@
 /*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
+ *
  *  libmcachedd client library.
  *
  *  Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/
@@ -50,7 +50,7 @@
 
 # ifdef _WIN32
 #  include <malloc.h>
-# else
+# elif HAVE_ALLOCA_H
 #  include <alloca.h>
 # endif
 
index e171fbeba360b30142083e4c4769944379e5ba79..8017f7a2f0437404ca37b0d39d94aca8fa2f9caa 100644 (file)
@@ -1,5 +1,5 @@
 /*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
+ *
  *  Libmemcached client library.
  *
  *  Copyright (C) 2012 Data Differential, http://datadifferential.com/
 #include <cstdlib>
 #include <cstring>
 
-#if defined(HAVE_SHARED_ENABLED) && HAVE_SHARED_ENABLED
+#if HAVE_BACKTRACE
 
-#ifdef HAVE_EXECINFO_H
-#include <execinfo.h>
-#endif
+#include BACKTRACE_HEADER
 
-#ifdef HAVE_GCC_ABI_DEMANGLE
+#if HAVE_ABI____CXA_DEMANGLE
 # include <cxxabi.h>
 # define USE_DEMANGLE 1
 #else
 
 #ifdef HAVE_DLFCN_H
 # include <dlfcn.h>
-#endif   
+#endif
 
 const int MAX_DEPTH= 50;
 
 void custom_backtrace(void)
 {
-#ifdef HAVE_EXECINFO_H
   void *backtrace_buffer[MAX_DEPTH +1];
 
   int stack_frames= backtrace(backtrace_buffer, MAX_DEPTH);
@@ -73,7 +70,7 @@ void custom_backtrace(void)
     char **symbollist= backtrace_symbols(backtrace_buffer, stack_frames);
     if (symbollist)
     {
-      for (int x= 0; x < stack_frames; x++) 
+      for (int x= 0; x < stack_frames; x++)
       {
         bool was_demangled= false;
 
@@ -119,13 +116,12 @@ void custom_backtrace(void)
       ::free(symbollist);
     }
   }
-#endif // HAVE_EXECINFO_H
 }
 
-#else // HAVE_SHARED_ENABLED
+#else // HAVE_BACKTRACE
 
 void custom_backtrace(void)
 {
   fprintf(stderr, "Backtrace null function called\n");
 }
-#endif // AX_ENABLE_BACKTRACE
+#endif // HAVE_BACKTRACE
index c1110b476ace4f31f0ae7001c877f4dc89b580e0..7e2a6e67513068e99f2ed7e03793bc2a92ce9c79 100644 (file)
@@ -25,6 +25,7 @@ target_include_directories(libmemcachedutil PRIVATE
         ${CMAKE_SOURCE_DIR}/src
         ${CMAKE_BINARY_DIR}/src
         ${CMAKE_BINARY_DIR})
+target_include_directories(libmemcachedutil PUBLIC ${LIBSASL_INCLUDEDIR})
 target_include_directories(libmemcachedutil PUBLIC
         $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
         $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
index 1d1d3d297d07b7a07c6b9972e9e0a062267369c2..9609ab40ebc21412e30753bf45138badc07a6158 100644 (file)
@@ -8,11 +8,13 @@
 #cmakedefine HAVE_C_STDATOMIC 1
 #cmakedefine HAVE_CXX_STDATOMIC 1
 
+#cmakedefine HAVE_ABI____CXA_DEMANGLE 1
+#cmakedefine HAVE_BACKTRACE 1
+#cmakedefine HAVE_ALLOCA_H 1
 #cmakedefine HAVE_ARPA_INET_H 1
 #cmakedefine HAVE_DLFCN_H 1
 #cmakedefine HAVE_DTRACE 1
 #cmakedefine HAVE_ERRNO_H 1
-#cmakedefine HAVE_EXECINFO_H 1
 #cmakedefine HAVE_FCNTL 1
 #cmakedefine HAVE_FCNTL_H 1
 #cmakedefine HAVE_FNV64_HASH 1
@@ -54,8 +56,6 @@
 #cmakedefine HAVE_WINSOCK2_H 1
 #cmakedefine HAVE_WS2TCPIP_H 1
 
-#cmakedefine HAVE_ABI____CXA_DEMANGLE 1
-#cmakedefine HAVE_GCC_ABI_DEMANGLE 1
 
 #cmakedefine HAVE_CINTTYPES 1
 #cmakedefine HAVE_CSTDINT 1
@@ -69,4 +69,8 @@
 #  include <inttypes.h>
 #endif
 
+#if HAVE_BACKTRACE
+# define BACKTRACE_HEADER <@Backtrace_HEADER@>
+#endif
+
 #define HAVE_LIBMEMCACHED 1
index af6e41ba63d5a1f010f3c9ca0de0aef13bd2d989..2744f3e1b9c1876b895cb056d6905518cfb534c4 100644 (file)
@@ -67,7 +67,8 @@ vector<char *> Server::createArgv()  {
   vector<char *> arr;
 
   pushArg(arr, binary);
-  //pushArg(arr, "-v");
+  pushArg(arr, "-u");
+  pushArg(arr, "nobody");
 
   for (auto it = args.cbegin(); it != args.cend(); ++it) {
     if (holds_alternative<arg_t>(*it)) {
index 18e518c34866073d9da897459e2112a8b7e145b7..1984e89c89d2686417f72af40c6a6b2364d992a9 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <cstddef>
 #include <chrono>
+#include <iostream>
 #include <random>
 #include <string>
 #include <type_traits>
@@ -17,9 +18,10 @@ enable_if_t<is_integral_v<T>, T> random_num(T min, T max) {
   using rnd = mt19937;
   using dst = uniform_int_distribution<T>;
 
-  auto time = duration_cast<nanoseconds>(system_clock::now().time_since_epoch());
-  auto seed = static_cast<rnd::result_type>(time.count() % numeric_limits<T>::max());
-  auto rgen = rnd{seed};
+  static auto time = duration_cast<nanoseconds>(system_clock::now().time_since_epoch());
+  static auto seed = static_cast<rnd::result_type>(time.count() % numeric_limits<T>::max());
+  static auto rgen = rnd{seed};
+
   return dst(min, max)(rgen);
 }
 
index ef234cbe65a4ba766597440a75824b2565b0241a..83fe974969b25d1debc975a36833415b7f513c9b 100644 (file)
@@ -63,7 +63,11 @@ TEST_CASE("bin/memcp") {
 
       string output;
       REQUIRE_FALSE(sh.run(comm + temp.getFn(), output));
-      REQUIRE_THAT(output, Contains("CONNECTION FAILURE"));
+      REQUIRE_THAT(output,
+              Contains("CONNECTION FAILURE")
+          ||  Contains("SERVER HAS FAILED")
+          ||  Contains("SYSTEM ERROR")
+          ||  Contains("TIMEOUT OCCURRED"));
     }
 
     SECTION("file not found") {
index b2caa3d17a589ac0f9c3fced33017a0d2169cde9..e16f5e3e39dc6cd3668ff015dea9b5b23664c5d4 100644 (file)
@@ -56,7 +56,11 @@ TEST_CASE("bin/memdump") {
 
       string output;
       REQUIRE_FALSE(sh.run(comm + "-v", output));
-      REQUIRE_THAT(output, Contains("CONNECTION FAILURE") || Contains("SERVER HAS FAILED"));
+      REQUIRE_THAT(output,
+              Contains("CONNECTION FAILURE")
+          ||  Contains("SERVER HAS FAILED")
+          ||  Contains("SYSTEM ERROR")
+          ||  Contains("TIMEOUT OCCURRED"));
     }
 
     SECTION("empty") {
index 45246fa0d5c7fcb397c9935fbf8eef0c3f340760..b512b8e2c9b2afb424c52763a4cb2f744e483275 100644 (file)
@@ -62,7 +62,11 @@ TEST_CASE("bin/memflush") {
 
       string output;
       REQUIRE_FALSE(sh.run(comm, output));
-      REQUIRE_THAT(output, Contains("CONNECTION FAILURE") || Contains("SERVER HAS FAILED"));
+      REQUIRE_THAT(output,
+              Contains("CONNECTION FAILURE")
+          ||  Contains("SERVER HAS FAILED")
+          ||  Contains("SYSTEM ERROR")
+          ||  Contains("TIMEOUT OCCURRED"));
     }
   }
 }
index ab56fa126abdddeb014f5fea4445e0b84a983f68..bd6b6ced50ec01d4c4bef7608254977defdca357 100644 (file)
@@ -49,7 +49,11 @@ TEST_CASE("bin/memping") {
 
       string output;
       REQUIRE_FALSE(sh.run(comm, output));
-      REQUIRE_THAT(output, Contains("CONNECTION FAILURE") || Contains("SERVER HAS FAILED"));
+      REQUIRE_THAT(output,
+              Contains("CONNECTION FAILURE")
+          ||  Contains("SERVER HAS FAILED")
+          ||  Contains("SYSTEM ERROR")
+          ||  Contains("TIMEOUT OCCURRED"));
     }
   }
 }
index b4a7fd0126c644352ed91e7725fd58ad7a2684a3..d6a9f7d43c24454b46b4bb79faedfa774ab5389f 100644 (file)
@@ -69,7 +69,11 @@ TEST_CASE("bin/memrm") {
 
       string output;
       REQUIRE_FALSE(sh.run(comm + " -v key2", output));
-      REQUIRE_THAT(output, Contains("CONNECTION FAILURE") || Contains("SERVER HAS FAILED"));
+      REQUIRE_THAT(output,
+              Contains("CONNECTION FAILURE")
+          ||  Contains("SERVER HAS FAILED")
+          ||  Contains("SYSTEM ERROR")
+          ||  Contains("TIMEOUT OCCURRED"));
     }
   }
 }
index 87db31d4a9bc4d7f1f155c149b65afd028d57a7d..431d1ce7552911113e5ca7ff0ad8f522f46c7638 100644 (file)
@@ -64,7 +64,11 @@ TEST_CASE("bin/memstat") {
 
       string output;
       REQUIRE_FALSE(sh.run(comm + "--analyze", output));
-      REQUIRE_THAT(output, Contains("CONNECTION FAILURE") || Contains("SERVER HAS FAILED"));
+      REQUIRE_THAT(output,
+              Contains("CONNECTION FAILURE")
+          ||  Contains("SERVER HAS FAILED")
+          ||  Contains("SYSTEM ERROR")
+          ||  Contains("TIMEOUT OCCURRED"));
     }
   }
 }
index ae91ffa42872b0af0cf91f9288a5885123056f40..35a76b7eadb6e5a666a7f65eba3def1e3283afdd 100644 (file)
@@ -53,7 +53,7 @@ TEST_CASE("memcached_util") {
     }
 
     REQUIRE(-1 == libmemcached_util_getpid("localhost", 1, &rc));
-    REQUIRE_RC(MEMCACHED_CONNECTION_FAILURE, rc);
+    REQUIRE(memcached_fatal(rc));
   }
 
   SECTION("ping") {