Ack.

Thanks,
Ramesh.

On 3/27/2017 12:09 PM, Anders Widell wrote:
>   .hgignore                      |    1 +
>   Makefile.am                    |   15 ++-
>   README                         |    3 +-
>   src/base/Makefile.am           |    1 -
>   src/base/hash.cc               |  179 
> +++++++++++++++++++++++++++++++++++++++++
>   src/base/hash.h                |   37 ++------
>   src/base/tests/hash_test.cc    |    2 +
>   src/log/Makefile.am            |    8 +-
>   src/log/logd/lgs_main.cc       |    3 +
>   src/log/tests/lgs_dest_test.cc |   27 ++++-
>   10 files changed, 232 insertions(+), 44 deletions(-)
>
>
> Ticket [#2266] introduced a dependency towards the openssl library. This 
> causes
> two problems: the first one is that this library is not part of LSB. The 
> second
> (and related) one is that OpenSAF binaries built on one Linux distribution may
> fail to load on another Linux distribution, due to different names (versions) 
> of
> this library.
>
> The solution uses dlopen() to open the library. If the library cannot be 
> opened,
> a simple fallback behaviour is used (the hash function returns all zeroes).
>
> diff --git a/.hgignore b/.hgignore
> --- a/.hgignore
> +++ b/.hgignore
> @@ -67,6 +67,7 @@ syntax: regexp
>   ^src/osaf/config\.h$
>   ^src/osaf/config\.h\.in$
>   ^src/osaf/configmake\.h$
> +^src/osaf/ssl_libs\.cc$
>   ^src/osaf/stamp-h1$
>   ^src/plm/plmcd/plmcboot$
>   ^src/plm/plmcd/plmcboot\.service$
> diff --git a/Makefile.am b/Makefile.am
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -42,7 +42,8 @@ CLEANFILES = \
>       lib/$(PACKAGE_NAME)-$(host_cpu).conf \
>       osafdir.conf \
>       osafdir.conf-t \
> -     src/osaf/configmake.h
> +     src/osaf/configmake.h \
> +     src/osaf/ssl_libs.cc
>   
>   CORE_INCLUDES = \
>       -I$(top_builddir)/src -I$(top_srcdir)/src
> @@ -126,7 +127,7 @@ nodist_pkgsysconf_DATA += \
>   
>   pkgconfig_DATA += pkgconfig/opensaf.pc
>   
> -BUILT_SOURCES += src/osaf/configmake.h osafdir.conf
> +BUILT_SOURCES += src/osaf/configmake.h osafdir.conf src/osaf/ssl_libs.cc
>   
>   EXTRA_DIST += samples scripts/create_empty_library
>   
> @@ -247,6 +248,16 @@ osafdir.conf: src/osaf/configmake.h
>       @sed -i 1i"#!/bin/sh" $@-t
>       sed -e 's/\(.*\)/\L\1/' $@-t > $@
>   
> +src/osaf/ssl_libs.cc: Makefile
> +     @rm -f $@-t $@
> +     @{ echo "  \"$$(ldd $$(which openssl) | cut -d= -f1 | grep libcrypto.so 
> | tr -d '\t ')\","; \
> +     echo "  \"libcrypto.so\","; \
> +     echo "  \"libcrypto.so.1.1.0\","; \
> +     echo "  \"libcrypto.so.1.0.0\","; \
> +     echo "  \"libcrypto.so.0.9.8\","; \
> +     } | sort -r | uniq > $@-t
> +     mv $@-t $@
> +
>   if ENABLE_RPM_TARGET
>   
>   RPMTOPDIR = `pwd`/rpms
> diff --git a/README b/README
> --- a/README
> +++ b/README
> @@ -425,7 +425,6 @@ The following software is required to bu
>   
>       * libc6-dev (2.11 or later)
>       * libxml2-dev (2.7 or later)
> -    * libssl-dev (0.9.8 or later)
>       * automake (1.11.1 or later)
>       * m4
>       * autoconf (2.64 or later)
> @@ -952,7 +951,7 @@ minimum version requirements of the foll
>   - GNU C Library (Glibc), version 2.11 or later
>   - GNU Compiler Collection (GCC), version 4.8.1 or later
>   - Libxml2, version 2.7 or later
> -- Libopenssl, version 0.9.8 or later
> +- Libopenssl, version 0.9.8 or later (optional)
>   - Libsqlite3, version 3.6 or later (only needed when configuring with
>     --enable-imm-pbe)
>   - OpenHPI, version 2.17.0 or later (only needed when configuring with
> diff --git a/src/base/Makefile.am b/src/base/Makefile.am
> --- a/src/base/Makefile.am
> +++ b/src/base/Makefile.am
> @@ -182,7 +182,6 @@ bin_libbase_test_CPPFLAGS = \
>   
>   bin_libbase_test_LDFLAGS = \
>       $(AM_LDFLAGS) \
> -     -lcrypto \
>       src/base/lib_libopensaf_core_la-file_descriptor.lo \
>       src/base/lib_libopensaf_core_la-file_notify.lo \
>       src/base/lib_libopensaf_core_la-getenv.lo \
> diff --git a/src/base/hash.cc b/src/base/hash.cc
> --- a/src/base/hash.cc
> +++ b/src/base/hash.cc
> @@ -14,6 +14,154 @@
>    */
>   
>   #include "base/hash.h"
> +#include <dlfcn.h>
> +#include <pthread.h>
> +#include <cassert>
> +#include <cstddef>
> +#include <cstdint>
> +#include <cstdio>
> +#include <cstring>
> +#include "base/logtrace.h"
> +#include "base/osaf_utility.h"
> +
> +namespace {
> +
> +class HashLibrary {
> + public:
> +  struct Context {
> +    uint64_t data[26];
> +    unsigned data2[2];
> +  };
> +
> +  static void Initialize();
> +
> +  static HashLibrary* instance() {
> +    return instance_;
> +  }
> +  int Init(Context* context) const {
> +    return init_function_(context);
> +  }
> +  int Update(Context* context, const void* data, size_t size) const {
> +    return update_function_(context, data, size);
> +  }
> +  int Final(unsigned char* result, Context* context) const {
> +    return final_function_(result, context);
> +  }
> +
> + private:
> +  using InitFunction = int (Context*);
> +  using UpdateFunction = int (Context*, const void*, size_t);
> +  using FinalFunction = int (unsigned char*, Context*);
> +
> +  HashLibrary();
> +  ~HashLibrary();
> +  static void* OpenLibrary();
> +  static void* GetSymbol(void* handle, int bits, const char* function,
> +                         void* fallback);
> +  static int FallbackInitFunction(Context* context);
> +  static int FallbackUpdateFunction(Context* context, const void* data,
> +                                    size_t size);
> +  static int FallbackFinalFunction(unsigned char* result, Context* context);
> +  static void PthreadOnceInitRoutine();
> +  void* handle_;
> +  InitFunction* init_function_;
> +  UpdateFunction* update_function_;
> +  FinalFunction* final_function_;
> +  static pthread_once_t once_control_;
> +  static HashLibrary* instance_;
> +};
> +
> +pthread_once_t HashLibrary::once_control_ = PTHREAD_ONCE_INIT;
> +HashLibrary* HashLibrary::instance_ = nullptr;
> +
> +const char *const kSslLibs[] = {
> +#include "osaf/ssl_libs.cc"
> +};
> +
> +HashLibrary::HashLibrary() :
> +    handle_{OpenLibrary()},
> +    init_function_{
> +      reinterpret_cast<InitFunction*>(
> +          GetSymbol(handle_, 512, "Init",
> +                    reinterpret_cast<void*>(FallbackInitFunction)))},
> +    update_function_{
> +      reinterpret_cast<UpdateFunction*>(
> +          GetSymbol(handle_, 512, "Update",
> +                    reinterpret_cast<void*>(FallbackUpdateFunction)))},
> +    final_function_{
> +      reinterpret_cast<FinalFunction*>(
> +          GetSymbol(handle_, 512, "Final",
> +                    reinterpret_cast<void*>(FallbackFinalFunction)))} {
> +}
> +
> +HashLibrary::~HashLibrary() {
> +  if (handle_ != nullptr) {
> +    dlclose(handle_);
> +    handle_ = nullptr;
> +  }
> +  init_function_ = nullptr;
> +  update_function_ = nullptr;
> +  final_function_ = nullptr;
> +  instance_ = nullptr;
> +}
> +
> +
> +void* HashLibrary::OpenLibrary() {
> +  void* handle = nullptr;
> +  for (int i = 0;
> +       handle == nullptr && i != sizeof(kSslLibs) / sizeof(kSslLibs[0]);
> +       ++i) {
> +    handle = dlopen(kSslLibs[i], RTLD_LAZY);
> +  }
> +  if (handle == nullptr) LOG_ER("Could not open ssl library");
> +  return handle;
> +}
> +
> +void* HashLibrary::GetSymbol(void* handle, int bits, const char* function,
> +                             void* fallback) {
> +  void* symbol = nullptr;
> +  if (handle != nullptr) {
> +    char buf[32];
> +    int result = snprintf(buf, sizeof(buf), "SHA%d_%s", bits, function);
> +    if (result >= 0 && static_cast<size_t>(result) < sizeof(buf)) {
> +      symbol = dlsym(handle, buf);
> +      if (symbol == nullptr) {
> +        const char* error = dlerror();
> +        if (error == nullptr) error = "";
> +        LOG_ER("Could not find symbol %s: %s", buf, error);
> +      }
> +    } else {
> +      LOG_ER("Symbol name too large");
> +    }
> +  }
> +  return symbol != nullptr ? symbol : fallback;
> +}
> +
> +int HashLibrary::FallbackInitFunction(Context*) {
> +  return 1;
> +}
> +
> +int HashLibrary::FallbackUpdateFunction(Context*, const void*, size_t) {
> +  return 1;
> +}
> +
> +int HashLibrary::FallbackFinalFunction(unsigned char* result, Context*) {
> +  memset(result, 0, 64);
> +  return 1;
> +}
> +
> +void HashLibrary::Initialize() {
> +  int result = pthread_once(&once_control_, PthreadOnceInitRoutine);
> +  if (result != 0) osaf_abort(result);
> +}
> +
> +void HashLibrary::PthreadOnceInitRoutine() {
> +  assert(instance_ == nullptr);
> +  instance_ = new HashLibrary();
> +  if (instance_ == nullptr) osaf_abort(0);
> +}
> +
> +}
>   
>   namespace base {
>   
> @@ -25,4 +173,35 @@ const char kHashFunctionAlphabet[64] = {
>     '8', '9', '-', '_'
>   };
>   
> +void InitializeHashFunction() {
> +  HashLibrary::Initialize();
> +}
> +
> +std::string Hash(const std::string& message) {
> +  HashLibrary::Context context;
> +  HashLibrary* lib = HashLibrary::instance();
> +  lib->Init(&context);
> +  context.data[0] += UINT64_C(0x96f78fac128be92b);
> +  context.data[1] += UINT64_C(0x202b002c69f03634);
> +  context.data[2] += UINT64_C(0x473aef07a340f237);
> +  context.data[3] += UINT64_C(0x4746024456ec7df0);
> +  context.data[4] += UINT64_C(0x209b3f0619762c29);
> +  context.data[5] += UINT64_C(0x6569267c8fb4c21d);
> +  context.data[6] += UINT64_C(0x4aa747ffd7996d81);
> +  context.data[7] += UINT64_C(0xc8b19fc2c59a8106);
> +  lib->Update(&context, message.data(), message.size());
> +  unsigned char result[64];
> +  lib->Final(result, &context);
> +  std::string encoded;
> +  encoded.reserve(32);
> +  for (int i = 0; i != 24; i += 3) {
> +    uint64_t a = (result[i] << 16) | (result[i + 1] << 8) | result[i + 2];
> +    encoded.push_back(kHashFunctionAlphabet[a >> 18]);
> +    encoded.push_back(kHashFunctionAlphabet[(a >> 12) & 63]);
> +    encoded.push_back(kHashFunctionAlphabet[(a >> 6) & 63]);
> +    encoded.push_back(kHashFunctionAlphabet[a & 63]);
> +  }
> +  return encoded;
> +}
> +
>   }  // namespace base
> diff --git a/src/base/hash.h b/src/base/hash.h
> --- a/src/base/hash.h
> +++ b/src/base/hash.h
> @@ -16,14 +16,18 @@
>   #ifndef BASE_HASH_H_
>   #define BASE_HASH_H_
>   
> -#include <openssl/sha.h>
> -#include <cstdint>
>   #include <string>
>   
>   namespace base {
>   
>   extern const char kHashFunctionAlphabet[64];
>   
> +// Initialize the hash function. This must be done at least once before 
> calling
> +// the function Hash() below. It is safe to call this function multiple 
> times,
> +// since this function does nothing if the hash function has already been
> +// initialized.
> +void InitializeHashFunction();
> +
>   // This function takes an arbitrary string as input parameter and returns
>   // another string which is a hash of the input string generated using a
>   // collision-resistant hash function. The probability that two different 
> inputs
> @@ -35,32 +39,9 @@ extern const char kHashFunctionAlphabet[
>   // the returned string is guaranteed to not contain any character that 
> would be
>   // illegal for use in a file name.
>   //
> -// Note: if you use this function you need to link your program with -lcrypto
> -inline std::string Hash(const std::string& message) {
> -  SHA512_CTX context;
> -  SHA512_Init(&context);
> -  context.h[0] = UINT64_C(0x010176140648b233);
> -  context.h[1] = UINT64_C(0xdb92aeb1eebadd6f);
> -  context.h[2] = UINT64_C(0x83a9e27aa1d5ea62);
> -  context.h[3] = UINT64_C(0xec95f77eb609b4e1);
> -  context.h[4] = UINT64_C(0x71a99185c75caefa);
> -  context.h[5] = UINT64_C(0x006e8f08baf32e3c);
> -  context.h[6] = UINT64_C(0x6a2b21abd2db2aec);
> -  context.h[7] = UINT64_C(0x24926cdbd918a27f);
> -  SHA512_Update(&context, message.data(), message.size());
> -  unsigned char result[SHA512_DIGEST_LENGTH];
> -  SHA512_Final(result, &context);
> -  std::string encoded;
> -  encoded.reserve(32);
> -  for (int i = 0; i != 24; i += 3) {
> -    uint64_t a = (result[i] << 16) | (result[i + 1] << 8) | result[i + 2];
> -    encoded.push_back(kHashFunctionAlphabet[a >> 18]);
> -    encoded.push_back(kHashFunctionAlphabet[(a >> 12) & 63]);
> -    encoded.push_back(kHashFunctionAlphabet[(a >> 6) & 63]);
> -    encoded.push_back(kHashFunctionAlphabet[a & 63]);
> -  }
> -  return encoded;
> -}
> +// NOTE: You must have called InitializeHashFunction() at least once before
> +//       calling this function.
> +std::string Hash(const std::string& message);
>   
>   }  // namespace base
>   
> diff --git a/src/base/tests/hash_test.cc b/src/base/tests/hash_test.cc
> --- a/src/base/tests/hash_test.cc
> +++ b/src/base/tests/hash_test.cc
> @@ -82,6 +82,7 @@ static const TestVector test_vectors[] =
>   };
>   
>   TEST(BaseHash, TestVectors) {
> +  base::InitializeHashFunction();
>     for (size_t i = 0; i < sizeof(test_vectors) / sizeof(test_vectors[0]); 
> ++i) {
>       std::string key = std::string(test_vectors[i].key_data,
>                                     test_vectors[i].key_size);
> @@ -92,6 +93,7 @@ TEST(BaseHash, TestVectors) {
>   }
>   
>   TEST(BaseHash, LongRandomString) {
> +  base::InitializeHashFunction();
>     std::string key;
>     key.reserve(8000);
>     std::mt19937_64 generator(4711);
> diff --git a/src/log/Makefile.am b/src/log/Makefile.am
> --- a/src/log/Makefile.am
> +++ b/src/log/Makefile.am
> @@ -141,7 +141,6 @@ bin_osaflogd_SOURCES = \
>       src/log/logd/lgs_unixsock_dest.cc
>   
>   bin_osaflogd_LDADD = \
> -     -lcrypto \
>       lib/libosaf_common.la \
>       lib/libSaAmf.la \
>       lib/libSaImmOm.la \
> @@ -232,6 +231,8 @@ bin_logtestfr_LDADD = \
>       lib/libSaImmOm.la \
>       lib/libopensaf_core.la
>   
> +endif
> +
>   bin_testlogd_CXXFLAGS =$(AM_CXXFLAGS)
>   
>   bin_testlogd_CPPFLAGS = \
> @@ -240,8 +241,7 @@ bin_testlogd_CPPFLAGS = \
>       -I$(GTEST_DIR)/include
>   
>   bin_testlogd_LDFLAGS = \
> -     $(AM_LDFLAGS) \
> -     -lcrypto
> +     $(AM_LDFLAGS)
>   
>   
>   bin_testlogd_SOURCES = \
> @@ -255,5 +255,3 @@ bin_testlogd_LDADD = \
>       src/log/logd/bin_osaflogd-lgs_unixsock_dest.o \
>       src/log/logd/bin_osaflogd-lgs_dest.o \
>       src/log/logd/bin_osaflogd-lgs_nildest.o
> -
> -endif
> diff --git a/src/log/logd/lgs_main.cc b/src/log/logd/lgs_main.cc
> --- a/src/log/logd/lgs_main.cc
> +++ b/src/log/logd/lgs_main.cc
> @@ -37,6 +37,7 @@
>   #include "log/logd/lgs.h"
>   #include "log/logd/lgs_file.h"
>   #include "base/osaf_utility.h"
> +#include "base/hash.h"
>   #include "lgs_recov.h"
>   #include "osaf/immutil/immutil.h"
>   #include "lgs_clm.h"
> @@ -275,6 +276,8 @@ static uint32_t log_initialize(void) {
>   
>     TRACE_ENTER();
>   
> +  base::InitializeHashFunction();
> +
>     /**
>      * Setup immutils profile once and for all.
>      * This profile says immutil_ API will be blocked
> diff --git a/src/log/tests/lgs_dest_test.cc b/src/log/tests/lgs_dest_test.cc
> --- a/src/log/tests/lgs_dest_test.cc
> +++ b/src/log/tests/lgs_dest_test.cc
> @@ -15,15 +15,13 @@
>    *
>    */
>   
> -#define protected public
> -#define private public
> -
>   #include "log/logd/lgs_dest.h"
>   #include "log/logd/lgs_unixsock_dest.h"
>   #include "log/logd/lgs_config.h"
>   #include <string>
>   #include <vector>
>   #include "base/unix_server_socket.h"
> +#include "base/hash.h"
>   #include "gtest/gtest.h"
>   
>   
> //==============================================================================
> @@ -76,12 +74,14 @@ bool isValidName(const std::string& name
>   
> //==============================================================================
>   // Verify it is OK to add one valid destination configuration
>   TEST(CfgDestination, AddOneDestination) {
> +  base::InitializeHashFunction();
>     const std::vector<std::string> vdest {"test;UNIX_SOCKET;/tmp/sock.sock"};
>     ASSERT_EQ(CfgDestination(vdest, ModifyType::kAdd), true);
>   }
>   
>   // Verify it is Ok to add multiple destination configurations
>   TEST(CfgDestination, AddMultipleDestination) {
> +  base::InitializeHashFunction();
>     const std::vector<std::string> vdest {
>       "test;UNIX_SOCKET;/tmp/sock.sock",
>       "test1;UNIX_SOCKET;/tmp/sock1.sock",
> @@ -92,6 +92,7 @@ TEST(CfgDestination, AddMultipleDestinat
>   
>   // Verify it is Ok to add NIL destination
>   TEST(CfgDestination, AddEmptyDestination) {
> +  base::InitializeHashFunction();
>     const std::vector<std::string> vdest {
>       "test;UNIX_SOCKET;/tmp/sock.sock",
>       "test1;UNIX_SOCKET;/tmp/sock1.sock",
> @@ -102,6 +103,7 @@ TEST(CfgDestination, AddEmptyDestination
>   
>   // Verify it is OK to delete one destination configuration
>   TEST(CfgDestination, DelOneDestination) {
> +  base::InitializeHashFunction();
>     const std::vector<std::string> vdest {
>       "test;UNIX_SOCKET;/tmp/sock.sock",
>       "test1;UNIX_SOCKET;/tmp/sock1.sock",
> @@ -115,6 +117,7 @@ TEST(CfgDestination, DelOneDestination)
>   
>   // Verify it is OK to delete all destinations
>   TEST(CfgDestination, DelAllDestinations) {
> +  base::InitializeHashFunction();
>     const std::vector<std::string> vdest {
>       "test;UNIX_SOCKET;/tmp/sock.sock",
>       "test1;UNIX_SOCKET;/tmp/sock1.sock",
> @@ -129,6 +132,7 @@ TEST(CfgDestination, DelAllDestinations)
>   // Verify the request is drop if the delete request
>   // come before adding a destination configuation.
>   TEST(CfgDestination, DelDestButNoCfgSentYet) {
> +  base::InitializeHashFunction();
>     // Delete all destination configurations
>     const std::vector<std::string> vdest {};
>     CfgDestination(vdest, ModifyType::kDelete);
> @@ -140,6 +144,7 @@ TEST(CfgDestination, DelDestButNoCfgSent
>   
>   // Verify the request is drop if deleting non-exist destination 
> configuration.
>   TEST(CfgDestination, DelNonExistDestination) {
> +  base::InitializeHashFunction();
>     const std::vector<std::string> vdest {
>       "test;UNIX_SOCKET;/tmp/sock.sock",
>       "test1;UNIX_SOCKET;/tmp/sock1.sock",
> @@ -176,6 +181,7 @@ void initData(RecordData* data) {
>   // No destination name & no destination configuration exist
>   // Verify the sending log record request is drop.
>   TEST(WriteToDestination, NoDestNameAndNonExistDest) {
> +  base::InitializeHashFunction();
>     RecordData data;
>     // No destination configured at all.
>     const std::vector<std::string> vdeldest5 {};
> @@ -190,6 +196,7 @@ TEST(WriteToDestination, NoDestNameAndNo
>   // Have destination name set, but no destination configuration exist.
>   // Verify the sending record request is drop.
>   TEST(WriteToDestination, HaveDestNameButNonExistDest) {
> +  base::InitializeHashFunction();
>     RecordData data;
>     // No destination configured at all
>     const std::vector<std::string> vdeldest6 {};
> @@ -204,6 +211,7 @@ TEST(WriteToDestination, HaveDestNameBut
>   // Verify the sending record to destination is drop
>   // if having NIL destination with such destination name.
>   TEST(WriteToDestination, HaveDestNameButNilDest) {
> +  base::InitializeHashFunction();
>     RecordData data;
>     // Have nil destination
>     const std::vector<std::string> nildest {"test;UNIX_SOCKET;"};
> @@ -230,6 +238,7 @@ void FormRfc5424Test(const DestinationHa
>   // Send a record @rec, then verify if receiving data
>   // and sent data is matched.
>   TEST(WriteToDestination, HaveDestNameAndDestCfg) {
> +  base::InitializeHashFunction();
>     char buf[1024] = {0};
>     RecordData data;
>     DestinationHandler::RecordInfo info{};
> @@ -239,7 +248,7 @@ TEST(WriteToDestination, HaveDestNameAnd
>   
>     // Create the server listen to the local socket
>     static base::UnixServerSocket server{"/tmp/test.sock"};
> -  server.Open();
> +  server.fd();
>   
>     const std::vector<std::string> dest {"test;UNIX_SOCKET;/tmp/test.sock"};
>     CfgDestination(dest, ModifyType::kReplace);
> @@ -281,6 +290,7 @@ TEST(WriteToDestination, HaveDestNameAnd
>   
>   // Verify the destination connection status is reflected correctly.
>   TEST(GetDestinationStatus, AddOneDestination) {
> +  base::InitializeHashFunction();
>     const VectorString vstatus {"test,FAILED"};
>     const std::vector<std::string> vdest {"test;UNIX_SOCKET;/tmp/sock.sock"};
>     CfgDestination(vdest, ModifyType::kReplace);
> @@ -290,6 +300,7 @@ TEST(GetDestinationStatus, AddOneDestina
>   // Verify the destination connection status is reflected correctly
>   // in case of adding multiple destinations
>   TEST(GetDestinationStatus, AddMultipleDestination) {
> +  base::InitializeHashFunction();
>     const VectorString vstatus {
>       "test,FAILED",
>       "test1,FAILED",
> @@ -308,6 +319,7 @@ TEST(GetDestinationStatus, AddMultipleDe
>   // Verify the destination connection status is reflected correctly
>   // in case of adding multiple destinations including NILDEST type.
>   TEST(GetDestinationStatus, AddMultipleDestinationWithNilDest) {
> +  base::InitializeHashFunction();
>     // Expected destination status
>     const VectorString vstatus {
>       "test,FAILED",
> @@ -323,6 +335,7 @@ TEST(GetDestinationStatus, AddMultipleDe
>   }
>   
>   TEST(GetDestinationStatus, AddMultipleDestinationWithNilDest02) {
> +  base::InitializeHashFunction();
>     // Expected destination status
>     const VectorString vstatus {
>       "test,FAILED",
> @@ -343,6 +356,7 @@ TEST(GetDestinationStatus, AddMultipleDe
>   // in case of adding multiple destinations including NILDEST type.
>   // and have destination receiver.
>   TEST(GetDestinationStatus, AddMultipleDestinationWithDestReceiver) {
> +  base::InitializeHashFunction();
>     // Expected destination status
>     const VectorString vstatus {
>       "test,CONNECTED",
> @@ -357,7 +371,7 @@ TEST(GetDestinationStatus, AddMultipleDe
>   
>     // Create the server listen to the local socket
>     static base::UnixServerSocket server{"/tmp/test.sock"};
> -  server.Open();
> +  server.fd();
>     CfgDestination(vdest, ModifyType::kReplace);
>   
>     ASSERT_EQ(GetDestinationStatus(), vstatus);
> @@ -368,6 +382,7 @@ TEST(GetDestinationStatus, AddMultipleDe
>   // multiple destinations including NILDEST type.
>   // and have destination receiver.
>   TEST(GetDestinationStatus, 
> RemoveDestFromMultipleDestinationWithDestReceiver) {
> +  base::InitializeHashFunction();
>     // Expected destination status
>     const VectorString vstatus {
>       "test,CONNECTED",
> @@ -381,7 +396,7 @@ TEST(GetDestinationStatus, RemoveDestFro
>   
>     // Create the server listen to the local socket
>     static base::UnixServerSocket server{"/tmp/test.sock"};
> -  server.Open();
> +  server.fd();
>   
>     // Add destination configurations, then delete one.
>     CfgDestination(vdest, ModifyType::kReplace);


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to