Skip to content

Commit

Permalink
Qfs test: set DYLD_LIBRARY_PATH on MacOS to make java test work.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeov committed Dec 12, 2023
1 parent c9f73d7 commit 77bc28b
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/test-scripts/qfstest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ else
fusedir=''
fi

qfsshareddirs=''
for dir in \
'src/cc/devtools' \
'src/cc/chunk' \
Expand Down Expand Up @@ -454,23 +455,24 @@ for dir in \
exit 1
fi
PATH="${dir}:${PATH}"
LD_LIBRARY_PATH="${dir}:${LD_LIBRARY_PATH}"
qfsshareddirs="$dir:$qfsshareddirs"
done

for dir in \
'jerasure/lib' \
'gf-complete/lib/' \
'gf-complete/lib' \
; do
if [ -d "${dir}" ]; then
dir=`cd "${dir}" >/dev/null 2>&1 && pwd`
fi
if [ -d "${dir}" ]; then
LD_LIBRARY_PATH="${dir}:${LD_LIBRARY_PATH}"
if [ -d "${dir}" ]; then
qfsshareddirs="$dir:$qfsshareddirs"
fi
fi
done

# fuser might be in sbin
PATH="${PATH}:/sbin:/usr/sbin"
LD_LIBRARY_PATH="${qfsshareddirs}:${LD_LIBRARY_PATH:$LD_LIBRARY_PATH}"
export PATH
export LD_LIBRARY_PATH

Expand All @@ -479,6 +481,13 @@ mkdir "$testdir" || exit
mkdir "$metasrvdir" || exit
mkdir "$chunksrvdir" || exit

if [ x"`uname`" = x'Darwin' ]; then
# Note: on macos DYLD_LIBRARY_PATH will disappear in sub shell due to
# integrity system protection.
DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}${DYLD_LIBRARY_PATH+:$DYLD_LIBRARY_PATH}"
export DYLD_LIBRARY_PATH
fi

cabundlefileos='/etc/pki/tls/certs/ca-bundle.crt'
cabundlefile="$chunksrvdir/ca-bundle.crt"
objectstoredir="$chunksrvdir/object_store"
Expand Down Expand Up @@ -1230,6 +1239,7 @@ if [ x"$kfsgosrcdir" != x ] && go version >/dev/null 2>&1; then
mkdir -p "$include_path" &&
cp "$kfsgosrcdir/../cc/qfsc/qfs.h" "$include_path" &&
[ x"`uname`" != x'Darwin' ] || {
# Re-create DYLD_LIBRARY_PATH as it disappears in subshell due SIP.
DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}${DYLD_LIBRARY_PATH+:$DYLD_LIBRARY_PATH}" &&
export DYLD_LIBRARY_PATH
} &&
Expand Down

0 comments on commit 77bc28b

Please sign in to comment.