From c25b49ddd3eb682a42fd75f1d62a69789ff1eb0b Mon Sep 17 00:00:00 2001 From: Geoffrey Thomas Date: Thu, 7 Oct 2021 17:14:21 -0400 Subject: [PATCH] Add failing test for nix-rust/nix#1541 --- ci/test.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ci/test.sh b/ci/test.sh index fc17079..a418678 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" | sudo tee /etc/group >/dev/null +done +getent initgroups "$USER" | grep 100020 +sudo sed -i '/^nsncd-ci:/d' /etc/group + +systemctl status nsncd +# make sure it didn't die +kill -0 "$nsncd_pid"