Commit 8fb860b7 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

test/dd: check spdk_dd direct link to liburing



If SPDK is compiled with uring support for bdev or sock
modules, this does NOT have to mean that spdk_dd was too.

check_liburing() was using ld, that will list indirect
dependencies, rather than only verifying those directly used.
Despite spdk_dd not actually compiling with liburing,
this function didn't catch that.

This could be resolved by passing empty LD_LIBRARY_PATH,
which would make ld unable to resolve those dependencies.

Instead of that workaround, objdump is used to verify only
directly linked libraries.
Removed the check if liburing actually exists, since objdump
does not point to their actual locations. If it is missing,
that will be caught when running the test anyway.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I13edc36d9667732c170eecccdcb3b5f334b87b61
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21835


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
parent 89648519
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -136,10 +136,10 @@ get_native_nvme_bs() {

check_liburing() {
	# Simply check if spdk_dd links to liburing. If yes, log that information.
	local lib so
	local lib
	local -g liburing_in_use=0

	while read -r lib _ so _; do
	while read -r _ lib _; do
		if [[ $lib == liburing.so.* ]]; then
			printf '* spdk_dd linked to liburing\n'
			# For sanity, check build config to see if liburing was requested.
@@ -149,14 +149,10 @@ check_liburing() {
			if [[ $CONFIG_URING != y ]]; then
				printf '* spdk_dd built with liburing, but no liburing support requested?\n'
			fi
			if [[ ! -e $so ]]; then
				printf '* %s is missing, aborting\n' "$lib"
				return 1
			fi
			export liburing_in_use=1
			return 0
		fi
	done < <(LD_TRACE_LOADED_OBJECTS=1 "${DD_APP[@]}") >&2
	done < <(objdump -p "${DD_APP[@]}" | grep "NEEDED") >&2
}

init_zram() {