]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: fix pam_modules installation on Debian (and Debian-like systems)
authorEvgeny Vereshchagin <evvers@ya.ru>
Sun, 15 Nov 2015 20:38:56 +0000 (20:38 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Sun, 15 Nov 2015 21:21:18 +0000 (21:21 +0000)
libpam_modules installs modules into /lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/security
on Debian

Fixes:
systemd-testsuite login[36]: PAM unable to dlopen(pam_group.so): /lib/security/pam_group.so: cannot open shared object file: No such file or directory
systemd-testsuite login[36]: PAM adding faulty module: pam_group.so
systemd-testsuite login[36]: PAM unable to dlopen(pam_limits.so): /lib/security/pam_limits.so: cannot open shared object file: No such file or directory
systemd-testsuite login[36]: PAM adding faulty module: pam_limits.so
...
etc

test/test-functions

index 49f143ec1edb5e602e718bbb30ebbb35f9d911b0..dcf50dd00c0b6d6d51a3014e79e5aec856bc8478 100644 (file)
@@ -4,6 +4,7 @@
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 export PATH
 
+LOOKS_LIKE_DEBIAN=$(source /etc/os-release && [[ "$ID" = "debian" || "$ID_LIKE" = "debian" ]] && echo yes)
 KERNEL_VER=${KERNEL_VER-$(uname -r)}
 KERNEL_MODS="/lib/modules/$KERNEL_VER/"
 
@@ -272,12 +273,14 @@ install_dbus() {
 }
 
 install_pam() {
+    (
+    [[ "$LOOKS_LIKE_DEBIAN" ]] && type -p dpkg-architecture &>/dev/null && find "/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/security" -xtype f
     find \
         /etc/pam.d \
         /etc/security \
         /lib64/security \
         /lib/security -xtype f \
-        | while read file; do
+    ) | while read file; do
         inst $file
     done
 }