From 8e3b369c0550383499af4b4ebb09513ef0e0635c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 14 Apr 2021 08:35:40 +0200 Subject: [PATCH] allow tests to be run against a PAM-less build Indexing the config hash table fails for PAM related values: Traceback (most recent call last): File "/src/samba/samba/selftest/tests.py", line 49, in pam_set_items_so_path = config_hash["PAM_SET_ITEMS_SO_PATH"] KeyError: 'PAM_SET_ITEMS_SO_PATH' Error creating recipe from python3 /src/samba/samba/selftest/tests.py| at /src/samba/samba/selftest/selftest.pl line 645. which prevents the test suite from running when built --without-pam. Access those values using the get() method instead. Signed-off-by: Philipp Gesang Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Fri Apr 16 10:27:41 UTC 2021 on sn-devel-184 --- selftest/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selftest/tests.py b/selftest/tests.py index 9685a744d0d..69a833dc1ff 100644 --- a/selftest/tests.py +++ b/selftest/tests.py @@ -45,8 +45,8 @@ finally: have_man_pages_support = ("XSLTPROC_MANPAGES" in config_hash) with_pam = ("WITH_PAM" in config_hash) with_elasticsearch_backend = ("HAVE_SPOTLIGHT_BACKEND_ES" in config_hash) -pam_wrapper_so_path = config_hash["LIBPAM_WRAPPER_SO_PATH"] -pam_set_items_so_path = config_hash["PAM_SET_ITEMS_SO_PATH"] +pam_wrapper_so_path = config_hash.get("LIBPAM_WRAPPER_SO_PATH") +pam_set_items_so_path = config_hash.get("PAM_SET_ITEMS_SO_PATH") planpythontestsuite("none", "samba.tests.source") if have_man_pages_support: -- 2.47.3