1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

autobuild: Rewrite the symbol checking

This should be less error prone.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Feb 21 19:36:45 UTC 2022 on sn-devel-184
This commit is contained in:
Andreas Schneider 2022-02-14 14:59:13 +01:00 committed by Andreas Schneider
parent 7009fb1a10
commit 521e119564

View File

@ -120,11 +120,10 @@ else:
CLEAN_SOURCE_TREE_CMD = "cd ${TEST_SOURCE_DIR} && script/clean-source-tree.sh"
def nm_grep_symbols(sofile, expected_symbols=""):
return "nm " + sofile + " | " + \
"egrep -v ' (__bss_start|_edata|_init|_fini|_end|__gcov_)' | " + \
"egrep -v '" + expected_symbols + "' |" + \
"egrep ' [BDGTRVWS] ' && exit 1; exit 0;"
def check_symbols(sofile, expected_symbols=""):
return "objdump --dynamic-syms " + sofile + " | " + \
"awk \'$0 !~ /" + expected_symbols + "/ {if ($2 == \"g\" && $3 ~ /D(F|O)/ && $4 ~ /(.bss|.text)/) exit 1}\'"
if args:
# If we are only running specific test,
@ -849,17 +848,17 @@ tasks = {
("nondevel-no-samba-libwbclient", "ldd ./bin/shared/libwbclient.so.0 | grep 'samba' && exit 1; exit 0"),
("nondevel-no-samba-pam_winbind", "ldd ./bin/plugins/pam_winbind.so | grep -v 'libtalloc.so.2' | grep 'samba' && exit 1; exit 0"),
("nondevel-no-public-nss_winbind",
nm_grep_symbols("./bin/plugins/libnss_winbind.so.2", " T _nss_winbind_")),
check_symbols("./bin/plugins/libnss_winbind.so.2", "_nss_winbind_")),
("nondevel-no-public-nss_wins",
nm_grep_symbols("./bin/plugins/libnss_wins.so.2", " T _nss_wins_")),
check_symbols("./bin/plugins/libnss_wins.so.2", "_nss_wins_")),
("nondevel-no-public-libwbclient",
nm_grep_symbols("./bin/shared/libwbclient.so.0", " T wbc")),
check_symbols("./bin/shared/libwbclient.so.0", "wbc")),
("nondevel-no-public-pam_winbind",
nm_grep_symbols("./bin/plugins/pam_winbind.so", "T pam_sm_")),
check_symbols("./bin/plugins/pam_winbind.so", "pam_sm_")),
("nondevel-no-public-winbind_krb5_locator",
nm_grep_symbols("./bin/plugins/winbind_krb5_locator.so", " D resolve\>")),
check_symbols("./bin/plugins/winbind_krb5_locator.so", "service_locator")),
("nondevel-no-public-async_dns_krb5_locator",
nm_grep_symbols("./bin/plugins/async_dns_krb5_locator.so", " D resolve\>")),
check_symbols("./bin/plugins/async_dns_krb5_locator.so", "service_locator")),
("nondevel-install", "make -j install"),
("nondevel-dist", "make dist"),
@ -872,17 +871,19 @@ tasks = {
("prefix-no-samba-libwbclient", "ldd ${PREFIX_DIR}/lib/libwbclient.so.0 | grep 'samba' && exit 1; exit 0"),
("prefix-no-samba-pam_winbind", "ldd ${PREFIX_DIR}/lib/security/pam_winbind.so | grep -v 'libtalloc.so.2' | grep 'samba' && exit 1; exit 0"),
("prefix-no-public-nss_winbind",
nm_grep_symbols("${PREFIX_DIR}/lib/libnss_winbind.so.2", " T _nss_winbind_")),
check_symbols("${PREFIX_DIR}/lib/libnss_winbind.so.2", "_nss_winbind_")),
("prefix-no-public-nss_wins",
nm_grep_symbols("${PREFIX_DIR}/lib/libnss_wins.so.2", " T _nss_wins_")),
check_symbols("${PREFIX_DIR}/lib/libnss_wins.so.2", "_nss_wins_")),
("prefix-no-public-libwbclient",
nm_grep_symbols("${PREFIX_DIR}/lib/libwbclient.so.0", " T wbc")),
check_symbols("${PREFIX_DIR}/lib/libwbclient.so.0", "wbc")),
("prefix-no-public-pam_winbind",
nm_grep_symbols("${PREFIX_DIR}/lib/security/pam_winbind.so", "T pam_sm_")),
check_symbols("${PREFIX_DIR}/lib/security/pam_winbind.so", "pam_sm_")),
("prefix-no-public-winbind_krb5_locator",
nm_grep_symbols("${PREFIX_DIR}/lib/krb5/winbind_krb5_locator.so", " D resolve\>")),
check_symbols("${PREFIX_DIR}/lib/krb5/winbind_krb5_locator.so",
"service_locator")),
("prefix-no-public-async_dns_krb5_locator",
nm_grep_symbols("${PREFIX_DIR}/lib/krb5/async_dns_krb5_locator.so", " D resolve\>")),
check_symbols("${PREFIX_DIR}/lib/krb5/async_dns_krb5_locator.so",
"service_locator")),
# retry with all modules shared
("allshared-distclean", "make distclean"),
@ -897,17 +898,17 @@ tasks = {
("allshared-no-samba-libwbclient", "ldd ./bin/shared/libwbclient.so.0 | grep 'samba' && exit 1; exit 0"),
("allshared-no-samba-pam_winbind", "ldd ./bin/plugins/pam_winbind.so | grep -v 'libtalloc.so.2' | grep 'samba' && exit 1; exit 0"),
("allshared-no-public-nss_winbind",
nm_grep_symbols("./bin/plugins/libnss_winbind.so.2", " T _nss_winbind_")),
check_symbols("./bin/plugins/libnss_winbind.so.2", "_nss_winbind_")),
("allshared-no-public-nss_wins",
nm_grep_symbols("./bin/plugins/libnss_wins.so.2", " T _nss_wins_")),
check_symbols("./bin/plugins/libnss_wins.so.2", "_nss_wins_")),
("allshared-no-public-libwbclient",
nm_grep_symbols("./bin/shared/libwbclient.so.0", " T wbc")),
check_symbols("./bin/shared/libwbclient.so.0", "wbc")),
("allshared-no-public-pam_winbind",
nm_grep_symbols("./bin/plugins/pam_winbind.so", "T pam_sm_")),
check_symbols("./bin/plugins/pam_winbind.so", "pam_sm_")),
("allshared-no-public-winbind_krb5_locator",
nm_grep_symbols("./bin/plugins/winbind_krb5_locator.so", " D resolve\>")),
check_symbols("./bin/plugins/winbind_krb5_locator.so", "service_locator")),
("allshared-no-public-async_dns_krb5_locator",
nm_grep_symbols("./bin/plugins/async_dns_krb5_locator.so", " D resolve\>")),
check_symbols("./bin/plugins/async_dns_krb5_locator.so", "service_locator")),
],
},