summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-11-27 18:25:52 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-11-28 09:20:40 +0100
commit5bb4503d3af4fc3066d8abbe302034bf6cac41a7 (patch)
treee85e691148430ef4882da5a9c715bb3f90f96d65 /test
parent6da498c28f2598bea4d651756485f57d54e379f4 (diff)
downloadsystemd-5bb4503d3af4fc3066d8abbe302034bf6cac41a7.tar.gz
systemd-5bb4503d3af4fc3066d8abbe302034bf6cac41a7.tar.bz2
systemd-5bb4503d3af4fc3066d8abbe302034bf6cac41a7.zip
test-functions: make sure we use the right library path for binaries without RPATH
Meson appears to set the rpath only for some binaries it builds, but not all. (The rules are not clear to me, but that's besides the point of this commit). Let's make sure if our test script operates on a binary that has no rpath set we fall back preferably to the BUILD_DIR rather than directly to the host. This matters if a test uses a libsystemd symbol introduced in a version newer than the one on the host. In that case "ldd" will not work on the test binary if rpath is not set. With this fix that behaviour is corrected, and "ldd" works correctly even in this case. (Or in other words: before this fix on binaries lacking rpath we'd base dependency info on the libraries of the host, not the buidl tree, if they exist in both.)
Diffstat (limited to 'test')
-rw-r--r--test/test-functions8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test-functions b/test/test-functions
index 25a7b9b6f5..468a36d310 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -536,7 +536,13 @@ install_systemd() {
get_ldpath() {
local _bin="$1"
- objdump -p "$_bin" 2>/dev/null | awk "/R(UN)?PATH/ { print \"$initdir\" \$2 }" | paste -sd :
+ local rpath=$(objdump -p "$_bin" 2>/dev/null | awk "/R(UN)?PATH/ { print \"$initdir\" \$2 }" | paste -sd :)
+
+ if [ -z "$rpath" ] ; then
+ echo $BUILD_DIR
+ else
+ echo $rpath
+ fi
}
install_missing_libraries() {