]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
allow tests to be run against a PAM-less build
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Wed, 14 Apr 2021 06:35:40 +0000 (08:35 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 16 Apr 2021 10:27:41 +0000 (10:27 +0000)
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 <module>
        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 <philipp.gesang@intra2net.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Apr 16 10:27:41 UTC 2021 on sn-devel-184

selftest/tests.py

index 9685a744d0d0db25d19b183fb53c8fe8e0dc3fe2..69a833dc1ff9088261e0d284604fccbd999a1426 100644 (file)
@@ -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: