From: Frantisek Sumsal Date: Tue, 6 Sep 2022 12:04:37 +0000 (+0200) Subject: test: don't fail if we don't need any external nss libs X-Git-Tag: v252-rc1~244 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90782fde463ce2af95cc6fff3dcb631e67b2da81;p=thirdparty%2Fsystemd.git test: don't fail if we don't need any external nss libs On certain systems the `install_libnss()` function might end up with an empty list of libraries to install, which triggers an assertion in `image_install()`: ``` I: Install libnss ..//test-functions: line 2721: 1: parameter null or not set make: *** [Makefile:4: setup] Error 1 ``` E.g.: ``` # LD_DEBUG=files getent passwd 2>&1 >/dev/null | sed -n '/calling init: .*libnss_/ {s!^.* /!/!; p}' /lib64/libnss_sss.so.2 /lib64/libnss_systemd.so.2 # dnf -y remove sssd-client systemd-libs # LD_DEBUG=files getent passwd 2>&1 >/dev/null | sed -n '/calling init: .*libnss_/ {s!^.* /!/!; p}' ``` Let's handle this case gracefully. --- diff --git a/test/test-functions b/test/test-functions index 6215ec1cc64..b292f0e41bb 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1823,7 +1823,9 @@ install_libnss() { # install libnss_files for login local NSS_LIBS mapfile -t NSS_LIBS < <(LD_DEBUG=files getent passwd 2>&1 >/dev/null | sed -n '/calling init: .*libnss_/ {s!^.* /!/!; p}') - image_install "${NSS_LIBS[@]}" + if [[ ${#NSS_LIBS[@]} -gt 0 ]]; then + image_install "${NSS_LIBS[@]}" + fi } install_dbus() {