From efbfe4e0e2a80e501ee906aa11b47b986b872cf1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= <marcin.slusarz@intel.com>
Date: Wed, 13 Mar 2019 19:55:32 +0100
Subject: [PATCH] test: introduce PMDK_LIB_PATH

---
 src/test/ex_pmreorder/TEST0      |  4 ++--
 src/test/ex_pmreorder/TEST1      |  4 ++--
 src/test/pmempool_create/TEST7   |  4 ++--
 src/test/scope/TEST0             |  6 +++---
 src/test/scope/TEST1             |  6 +++---
 src/test/scope/TEST2             |  6 +++---
 src/test/scope/TEST3             |  6 +++---
 src/test/scope/TEST4             |  6 +++---
 src/test/scope/TEST5             |  4 ++--
 src/test/scope/TEST6             |  6 +++---
 src/test/unittest/unittest.sh    | 19 +++++++++++--------
 src/test/vmmalloc_init/TEST16    |  8 ++++----
 src/test/vmmalloc_init/TEST6     |  8 ++++----
 src/test/vmmalloc_valgrind/TEST0 |  4 ++--
 src/test/vmmalloc_valgrind/TEST1 |  4 ++--
 src/test/vmmalloc_valgrind/TEST2 |  4 ++--
 16 files changed, 51 insertions(+), 48 deletions(-)

diff --git a/src/test/ex_pmreorder/TEST0 b/src/test/ex_pmreorder/TEST0
index 32650c7f2..0e983a8cf 100755
--- a/src/test/ex_pmreorder/TEST0
+++ b/src/test/ex_pmreorder/TEST0
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2018, Intel Corporation
+# Copyright 2018-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -37,7 +37,7 @@
 
 . ../unittest/unittest.sh
 
-LIBPMEM_SO=${TEST_LD_LIBRARY_PATH}/libpmem.so.1
+LIBPMEM_SO=${PMDK_LIB_PATH}/libpmem.so.1
 
 require_test_type medium
 require_build_type debug nondebug
diff --git a/src/test/ex_pmreorder/TEST1 b/src/test/ex_pmreorder/TEST1
index 8c6051689..9406352ec 100755
--- a/src/test/ex_pmreorder/TEST1
+++ b/src/test/ex_pmreorder/TEST1
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2018, Intel Corporation
+# Copyright 2018-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -37,7 +37,7 @@
 
 . ../unittest/unittest.sh
 
-LIBPMEM_SO=${TEST_LD_LIBRARY_PATH}/libpmem.so.1
+LIBPMEM_SO=${PMDK_LIB_PATH}/libpmem.so.1
 
 require_test_type medium
 require_build_type debug nondebug
diff --git a/src/test/pmempool_create/TEST7 b/src/test/pmempool_create/TEST7
index d0a5e624b..ec00cd33b 100755
--- a/src/test/pmempool_create/TEST7
+++ b/src/test/pmempool_create/TEST7
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -41,7 +41,7 @@ require_test_type medium
 require_fs_type pmem non-pmem
 require_build_type nondebug debug
 
-configure_valgrind memcheck force-enable $TEST_LD_LIBRARY_PATH/libpmemobj.so
+configure_valgrind memcheck force-enable $PMDK_LIB_PATH/libpmemobj.so
 export PMEMOBJ_VG_CHECK_UNDEF=1
 
 setup
diff --git a/src/test/scope/TEST0 b/src/test/scope/TEST0
index 5173a5f05..e357fbed8 100755
--- a/src/test/scope/TEST0
+++ b/src/test/scope/TEST0
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -53,9 +53,9 @@ parse_lib() {
 }
 
 if [ "$BUILD" = "debug" -o "$BUILD" = "nondebug" ]; then
-	parse_lib -D $TEST_LD_LIBRARY_PATH/libvmem.so.1
+	parse_lib -D $PMDK_LIB_PATH/libvmem.so.1
 else
-	parse_lib -g $TEST_LD_LIBRARY_PATH/libvmem.a
+	parse_lib -g $PMDK_LIB_PATH/libvmem.a
 fi
 
 check
diff --git a/src/test/scope/TEST1 b/src/test/scope/TEST1
index c2f756f11..5137e1e32 100755
--- a/src/test/scope/TEST1
+++ b/src/test/scope/TEST1
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -54,9 +54,9 @@ parse_lib() {
 }
 
 if [ "$BUILD" = "debug" -o "$BUILD" = "nondebug" ]; then
-	parse_lib -D $TEST_LD_LIBRARY_PATH/libpmem.so.1
+	parse_lib -D $PMDK_LIB_PATH/libpmem.so.1
 else
-	parse_lib -g $TEST_LD_LIBRARY_PATH/libpmem.a
+	parse_lib -g $PMDK_LIB_PATH/libpmem.a
 fi
 
 check
diff --git a/src/test/scope/TEST2 b/src/test/scope/TEST2
index 4599d5567..ab428bd17 100755
--- a/src/test/scope/TEST2
+++ b/src/test/scope/TEST2
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -54,9 +54,9 @@ parse_lib() {
 }
 
 if [ "$BUILD" = "debug" -o "$BUILD" = "nondebug" ]; then
-	parse_lib -D $TEST_LD_LIBRARY_PATH/libpmemlog.so.1
+	parse_lib -D $PMDK_LIB_PATH/libpmemlog.so.1
 else
-	parse_lib -g $TEST_LD_LIBRARY_PATH/libpmemlog.a
+	parse_lib -g $PMDK_LIB_PATH/libpmemlog.a
 fi
 
 check
diff --git a/src/test/scope/TEST3 b/src/test/scope/TEST3
index 24cdfa17e..9cdbab29a 100755
--- a/src/test/scope/TEST3
+++ b/src/test/scope/TEST3
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -53,9 +53,9 @@ parse_lib() {
 }
 
 if [ "$BUILD" = "debug" -o "$BUILD" = "nondebug" ]; then
-	parse_lib -D $TEST_LD_LIBRARY_PATH/libpmemblk.so.1
+	parse_lib -D $PMDK_LIB_PATH/libpmemblk.so.1
 else
-	parse_lib -g $TEST_LD_LIBRARY_PATH/libpmemblk.a
+	parse_lib -g $PMDK_LIB_PATH/libpmemblk.a
 fi
 
 check
diff --git a/src/test/scope/TEST4 b/src/test/scope/TEST4
index 34ed34640..ec22bb218 100755
--- a/src/test/scope/TEST4
+++ b/src/test/scope/TEST4
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -54,9 +54,9 @@ parse_lib() {
 }
 
 if [ "$BUILD" = "debug" -o "$BUILD" = "nondebug" ]; then
-	parse_lib -D $TEST_LD_LIBRARY_PATH/libpmemobj.so.1
+	parse_lib -D $PMDK_LIB_PATH/libpmemobj.so.1
 else
-	parse_lib -g $TEST_LD_LIBRARY_PATH/libpmemobj.a
+	parse_lib -g $PMDK_LIB_PATH/libpmemobj.a
 fi
 
 check
diff --git a/src/test/scope/TEST5 b/src/test/scope/TEST5
index 6096aff9a..cde680de7 100755
--- a/src/test/scope/TEST5
+++ b/src/test/scope/TEST5
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -54,7 +54,7 @@ parse_lib() {
 
 }
 
-parse_lib -D $TEST_LD_LIBRARY_PATH/$VMMALLOC
+parse_lib -D $PMDK_LIB_PATH/$VMMALLOC
 
 check
 
diff --git a/src/test/scope/TEST6 b/src/test/scope/TEST6
index 5039967c2..d9c100dc5 100755
--- a/src/test/scope/TEST6
+++ b/src/test/scope/TEST6
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -54,9 +54,9 @@ parse_lib() {
 }
 
 if [ "$BUILD" = "debug" -o "$BUILD" = "nondebug" ]; then
-	parse_lib -D $TEST_LD_LIBRARY_PATH/libpmempool.so.1
+	parse_lib -D $PMDK_LIB_PATH/libpmempool.so.1
 else
-	parse_lib -g $TEST_LD_LIBRARY_PATH/libpmempool.a
+	parse_lib -g $PMDK_LIB_PATH/libpmempool.a
 fi
 
 check
diff --git a/src/test/unittest/unittest.sh b/src/test/unittest/unittest.sh
index ae4c9ea15..fa591c664 100644
--- a/src/test/unittest/unittest.sh
+++ b/src/test/unittest/unittest.sh
@@ -170,23 +170,26 @@ NODE_PID_FILES[0]=""
 	in
 	debug|static-debug)
 		if [ -z "$PMDK_LIB_PATH_DEBUG" ]; then
-			TEST_LD_LIBRARY_PATH=../../debug
-			REMOTE_LD_LIBRARY_PATH=../debug
+			PMDK_LIB_PATH=../../debug
+			REMOTE_PMDK_LIB_PATH=../debug
 		else
-			TEST_LD_LIBRARY_PATH=$PMDK_LIB_PATH_DEBUG
-			REMOTE_LD_LIBRARY_PATH=$PMDK_LIB_PATH_DEBUG
+			PMDK_LIB_PATH=$PMDK_LIB_PATH_DEBUG
+			REMOTE_PMDK_LIB_PATH=$PMDK_LIB_PATH_DEBUG
 		fi
 		;;
 	nondebug|static-nondebug)
 		if [ -z "$PMDK_LIB_PATH_NONDEBUG" ]; then
-			TEST_LD_LIBRARY_PATH=../../nondebug
-			REMOTE_LD_LIBRARY_PATH=../nondebug
+			PMDK_LIB_PATH=../../nondebug
+			REMOTE_PMDK_LIB_PATH=../nondebug
 		else
-			TEST_LD_LIBRARY_PATH=$PMDK_LIB_PATH_NONDEBUG
-			REMOTE_LD_LIBRARY_PATH=$PMDK_LIB_PATH_NONDEBUG
+			PMDK_LIB_PATH=$PMDK_LIB_PATH_NONDEBUG
+			REMOTE_PMDK_LIB_PATH=$PMDK_LIB_PATH_NONDEBUG
 		fi
 		;;
 	esac
+
+	TEST_LD_LIBRARY_PATH=$PMDK_LIB_PATH
+	REMOTE_LD_LIBRARY_PATH=$REMOTE_PMDK_LIB_PATH
 }
 
 #
diff --git a/src/test/vmmalloc_init/TEST16 b/src/test/vmmalloc_init/TEST16
index 4420f45f5..fffe30fb0 100755
--- a/src/test/vmmalloc_init/TEST16
+++ b/src/test/vmmalloc_init/TEST16
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2015-2018, Intel Corporation
+# Copyright 2015-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -48,9 +48,9 @@ require_no_freebsd
 
 # Valgrind does not call vmmalloc's malloc implementation from library
 # loaded with RTLD_DEEPBIND.
-configure_valgrind memcheck force-disable $TEST_LD_LIBRARY_PATH/$VMMALLOC
-configure_valgrind helgrind force-disable $TEST_LD_LIBRARY_PATH/$VMMALLOC
-configure_valgrind drd force-disable $TEST_LD_LIBRARY_PATH/$VMMALLOC
+configure_valgrind memcheck force-disable $PMDK_LIB_PATH/$VMMALLOC
+configure_valgrind helgrind force-disable $PMDK_LIB_PATH/$VMMALLOC
+configure_valgrind drd force-disable $PMDK_LIB_PATH/$VMMALLOC
 
 setup
 
diff --git a/src/test/vmmalloc_init/TEST6 b/src/test/vmmalloc_init/TEST6
index 0f612eef2..cff2a6d00 100755
--- a/src/test/vmmalloc_init/TEST6
+++ b/src/test/vmmalloc_init/TEST6
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -48,9 +48,9 @@ require_no_freebsd
 
 # Valgrind does not call vmmalloc's malloc implementation from library
 # loaded with RTLD_DEEPBIND.
-configure_valgrind memcheck force-disable $TEST_LD_LIBRARY_PATH/$VMMALLOC
-configure_valgrind helgrind force-disable $TEST_LD_LIBRARY_PATH/$VMMALLOC
-configure_valgrind drd force-disable $TEST_LD_LIBRARY_PATH/$VMMALLOC
+configure_valgrind memcheck force-disable $PMDK_LIB_PATH/$VMMALLOC
+configure_valgrind helgrind force-disable $PMDK_LIB_PATH/$VMMALLOC
+configure_valgrind drd force-disable $PMDK_LIB_PATH/$VMMALLOC
 
 setup
 
diff --git a/src/test/vmmalloc_valgrind/TEST0 b/src/test/vmmalloc_valgrind/TEST0
index 827d8e849..fed60702b 100755
--- a/src/test/vmmalloc_valgrind/TEST0
+++ b/src/test/vmmalloc_valgrind/TEST0
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -46,7 +46,7 @@ require_fs_type any
 require_build_type debug nondebug
 require_valgrind 3.7
 set_valgrind_exe_name
-configure_valgrind memcheck force-enable $TEST_LD_LIBRARY_PATH/$VMMALLOC
+configure_valgrind memcheck force-enable $PMDK_LIB_PATH/$VMMALLOC
 setup
 
 unset VMMALLOC_LOG_LEVEL
diff --git a/src/test/vmmalloc_valgrind/TEST1 b/src/test/vmmalloc_valgrind/TEST1
index 22f4b0dba..87ab5b65a 100755
--- a/src/test/vmmalloc_valgrind/TEST1
+++ b/src/test/vmmalloc_valgrind/TEST1
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -46,7 +46,7 @@ require_fs_type any
 require_build_type debug nondebug
 require_valgrind 3.7
 set_valgrind_exe_name
-configure_valgrind memcheck force-enable $TEST_LD_LIBRARY_PATH/$VMMALLOC
+configure_valgrind memcheck force-enable $PMDK_LIB_PATH/$VMMALLOC
 setup
 
 unset VMMALLOC_LOG_LEVEL
diff --git a/src/test/vmmalloc_valgrind/TEST2 b/src/test/vmmalloc_valgrind/TEST2
index 8d8605f4e..fa9299062 100755
--- a/src/test/vmmalloc_valgrind/TEST2
+++ b/src/test/vmmalloc_valgrind/TEST2
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright 2014-2018, Intel Corporation
+# Copyright 2014-2019, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -46,7 +46,7 @@ require_fs_type any
 require_build_type debug nondebug
 require_valgrind 3.8
 set_valgrind_exe_name
-configure_valgrind memcheck force-enable $TEST_LD_LIBRARY_PATH/$VMMALLOC
+configure_valgrind memcheck force-enable $PMDK_LIB_PATH/$VMMALLOC
 setup
 
 unset VMMALLOC_LOG_LEVEL
-- 
GitLab