c5d8c8
From 3eaf937e69fe4219738c93d39af1cc909b1ee3f8 Mon Sep 17 00:00:00 2001
c5d8c8
From: Rinku Kothiya <rkothiya@redhat.com>
c5d8c8
Date: Fri, 23 Apr 2021 09:30:35 +0000
c5d8c8
Subject: [PATCH 544/584] tests: avoid empty paths in environment variables
c5d8c8
c5d8c8
Many variables containing paths in env.rc.in are defined in a way
c5d8c8
that leave a trailing ':' in the variable when the previous value
c5d8c8
was empty or undefined.
c5d8c8
c5d8c8
In the particular case of 'LD_PRELOAD_PATH' variable, this causes
c5d8c8
that the system looks for dynamic libraries in the current working
c5d8c8
directory. When this directory is inside a Gluster mount point, a
c5d8c8
significant delay is caused each time a program is run (and testing
c5d8c8
framework can run lots of programs for each test).
c5d8c8
c5d8c8
This patch prevents that variables containing paths could end with
c5d8c8
a trailing ':'.
c5d8c8
c5d8c8
Backport of :
c5d8c8
>Upstream-patch-link: https://github.com/gluster/glusterfs/pull/2349
c5d8c8
>Fixes: #2348
c5d8c8
>Change-Id: I669f5a78e14f176c0a58824ba577330989d84769
c5d8c8
>Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
c5d8c8
>Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
c5d8c8
c5d8c8
Change-Id: Ie903ca443aa4789553ac4687818a7f69c113af41
c5d8c8
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
c5d8c8
---
c5d8c8
 tests/env.rc.in | 17 +++++++----------
c5d8c8
 1 file changed, 7 insertions(+), 10 deletions(-)
c5d8c8
c5d8c8
diff --git a/tests/env.rc.in b/tests/env.rc.in
c5d8c8
index 1f0ca88..2d8ff0e 100644
c5d8c8
--- a/tests/env.rc.in
c5d8c8
+++ b/tests/env.rc.in
c5d8c8
@@ -2,34 +2,31 @@ prefix=@prefix@
c5d8c8
 exec_prefix=@exec_prefix@
c5d8c8
 libdir=@libdir@
c5d8c8
 
c5d8c8
-PATH=@sbindir@:$PATH
c5d8c8
+PATH=@bindir@:@sbindir@${PATH:+:${PATH}}
c5d8c8
 export PATH
c5d8c8
 
c5d8c8
 GLUSTERD_PIDFILEDIR=@localstatedir@/run/gluster
c5d8c8
 export GLUSTERD_PIDFILEDIR
c5d8c8
 
c5d8c8
-LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH
c5d8c8
+LD_LIBRARY_PATH=@libdir@${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
c5d8c8
 export LD_LIBRARY_PATH
c5d8c8
 
c5d8c8
-LIBRARY_PATH=@libdir@:$LIBRARY_PATH
c5d8c8
+LIBRARY_PATH=@libdir@${LIBRARY_PATH:+:${LIBRARY_PATH}}
c5d8c8
 export LIBRARY_PATH
c5d8c8
 
c5d8c8
-CPATH=@includedir@:$CPATH
c5d8c8
+CPATH=@includedir@${CPATH:+:${CPATH}}
c5d8c8
 export CPATH
c5d8c8
 
c5d8c8
 GLUSTERD_WORKDIR=@GLUSTERD_WORKDIR@
c5d8c8
 export GLUSTERD_WORKDIR
c5d8c8
 
c5d8c8
-PKG_CONFIG_PATH=@pkgconfigdir@:$PKG_CONFIG_PATH
c5d8c8
+PKG_CONFIG_PATH=@pkgconfigdir@${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
c5d8c8
 export PKG_CONFIG_PATH
c5d8c8
 
c5d8c8
-PYTHONPATH=@BUILD_PYTHON_SITE_PACKAGES@:$PYTHON_PATH
c5d8c8
-export PYTHONPATH
c5d8c8
-
c5d8c8
 PYTHON=@PYTHON@
c5d8c8
 export PYTHON
c5d8c8
 
c5d8c8
-PYTHONPATH=@BUILD_PYTHON_SITE_PACKAGES@:$PYTHON_PATH
c5d8c8
+PYTHONPATH=@BUILD_PYTHON_SITE_PACKAGES@${PYTHONPATH:+:${PYTHONPATH}}
c5d8c8
 export PYTHONPATH
c5d8c8
 
c5d8c8
 GLUSTER_CMD_DIR=@sbindir@
c5d8c8
@@ -42,4 +39,4 @@ RUN_NFS_TESTS=@BUILD_GNFS@
c5d8c8
 export RUN_NFS_TESTS
c5d8c8
 
c5d8c8
 GLUSTER_XLATOR_DIR=@libdir@/glusterfs/@PACKAGE_VERSION@/xlator
c5d8c8
-export GLUSTER_XLATOR_DIR
c5d8c8
\ No newline at end of file
c5d8c8
+export GLUSTER_XLATOR_DIR
c5d8c8
-- 
c5d8c8
1.8.3.1
c5d8c8