Skip to content

Commit

Permalink
Add failing test for nix-rust/nix#1541
Browse files Browse the repository at this point in the history
  • Loading branch information
geofft committed Oct 7, 2021
1 parent f39f02a commit a88b9a6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit a88b9a6

Please sign in to comment.