tests: Look for softhsm2 in more places

Fedora and RHEL/CentOS put libsofthsm2.so in a different location
than Debian/Ubuntu, so look there too. This causes test_tls_pkcs11
to pass instead of being skipped (if softhsm2 and the other
prerequisites are installed.)
This commit is contained in:
John Thacker 2021-02-18 12:53:12 -05:00 committed by AndersBroman
parent 1f595c435c
commit ddd8f0ab61
1 changed files with 4 additions and 4 deletions

View File

@ -1162,12 +1162,12 @@ def softhsm_paths(features):
else:
name = 'softhsm2.dll'
else:
# Debian/Ubuntu-specific paths
# Look in a variety of paths, Debian/Ubuntu, Fedora, RHEL/CentOS
madir = sysconfig.get_config_var('multiarchsubdir')
libdir64_sub = os.path.join(libdir + '64', 'softhsm')
libdir_sub = os.path.join(libdir, 'softhsm')
libdir_archs = (libdir, libdir + '64')
libdir_subs = ('softhsm', 'pkcs11', '')
libdirs = [os.path.join(libdir + madir, 'softhsm')] if madir else []
libdirs += [libdir_sub, libdir64_sub]
libdirs += [os.path.join(arch, sub) for sub in libdir_subs for arch in libdir_archs]
name = 'libsofthsm2.so'
for libdir in libdirs:
provider = os.path.join(libdir, name)