diff options
Diffstat (limited to 'debian/tests/test-linkage')
-rw-r--r-- | debian/tests/test-linkage | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/debian/tests/test-linkage b/debian/tests/test-linkage new file mode 100644 index 00000000..f47da748 --- /dev/null +++ b/debian/tests/test-linkage @@ -0,0 +1,46 @@ +#!/bin/bash +set -eux +binary="testlinkage" + +basedir=$(dirname "$0") +. "${basedir}"/check-dpdk-supported-arch.sh + +cat > testlinkage.c << EOF +#include <stdio.h> +#include <rte_common.h> + +int main(void) +{ + printf("Hello rte_exit %p\n", rte_exit); + return 0; +} +EOF + +# -ldpdk actually refers to a linker script now, not a real .so +# with broken linkage this will fail with undefined symbols +printf "\n\nChecking compile with link against DPDK\n" +gcc testlinkage.c $(pkg-config --libs --cflags libdpdk) -o testlinkage +echo "OK" + +printf "\n\nLinkage info\n" +lddtree ${binary} + +printf "\n\nChecking for expected internal libraries\n" +# a few of the sublibs that it should use +lddtree ${binary} | grep '^ librte_eal.so' +echo "OK" + +printf "\n\nChecking for expected feature dependent library dependencies\n" +# features only used by the lib that we enabled +ldd /usr/lib/*/librte_pmd_pcap.so | grep libpcap +echo "OK" + +printf "\n\nChecking test execution\n" +# It doesn't do much, but it should work - so calling it is a minor extra test. +# It is known to fail without SSE3 in e.g. some adt environments, in that +# case check at least that we get the correct error message (this will trigger +# a test fail if it neither finds the success nor the expected error message) +(./${binary} 2>&1 || /bin/true ) | \ +grep -E 'ERROR: This system does not support "SSSE3".|Hello rte_exit 0x' + +echo "OK" |