diff --git a/ci/test.sh b/ci/test.sh index fc17079..5a1c9b0 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -18,8 +18,25 @@ set -ex debian/rules vendor dpkg-buildpackage --no-sign +sudo mkdir -p /run/systemd/system/nsncd.d +sudo tee /run/systemd/system/nsncd.d/crash.conf >/dev/null << EOF +[service] +Restart=never +EOF gcc -fPIC -shared -o ci/libnss_whatami.so.2 ci/libnss_whatami.c sudo cp ci/libnss_whatami.so.2 /lib sudo sed -i 's/passwd:/& whatami/' /etc/nsswitch.conf sudo dpkg -i ../nsncd*.deb +nsncd_pid="$(systemctl show --property=MainPID --value nsncd)" + getent passwd whatami | grep nsncd + +for i in `seq 1 20`; do + echo "nsncd-ci:x:$((100000 + i)):$USER" >> /etc/group +done +getent initgroups "$USER" | grep 100020 +sed -i '/^nsncd-ci:/d' /etc/group + +systemctl status nsncd +# make sure it didn't die +kill -0 "$nsncd_pid"