Skip to content

Commit

Permalink
Merge pull request #139 from morisja/buf_resize_test
Browse files Browse the repository at this point in the history
Add a specific test to exercise buffer resize
  • Loading branch information
leifwalsh authored Oct 12, 2024
2 parents cd1692f + 9de73d8 commit c3878f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions ci/test_nsncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ for i in $(seq 1 100); do
getent services 65000/udp || rc=1
getent services foo1/tcp || rc=1
getent services foo1/udp || rc=1
getent services bufresize/tcp > /dev/null|| rc=1
netgroup trusted-machines || rc=1
getent netgroup trusted-machines || rc=1
innetgr -h machine1 trusted-machines || rc=1
Expand Down
16 changes: 13 additions & 3 deletions ci/test_nspawn.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

sudo debootstrap stable /stable-chroot http://deb.debian.org/debian/
sudo debootstrap stable /stable-chroot http://deb.debian.org/debian/ &> /dev/null
sudo dpkg -i nsncd*.deb

sdns="sudo systemd-nspawn --quiet --no-pager --bind-ro /var/run/nscd/socket:/var/run/nscd/socket -D /stable-chroot"
Expand All @@ -19,8 +19,18 @@ sudo sed '$ a netgroup: files' -i /etc/nsswitch.conf
rc=0

sudo useradd nsncdtest
echo -e "foo1\t65000/tcp" | sudo tee -a /etc/services
echo -e "foo1\t65000/udp" | sudo tee -a /etc/services
cp /etc/services ./services

# simple service lookups
echo -e "foo1\t65000/tcp" >> services
echo -e "foo1\t65000/udp" >> services
# huge service lookup to exercise buffer resize
echo -en "bufresize\t65001/tcp " >> services
for i in $(seq 1000); do echo -n "alias${i} "; done >> services
echo "" >> services
sudo mv services /etc/services

tail -5 /etc/services
echo -e "trusted-machines (machine1,user1,domain1), (machine2,user2,domain2), (machine3,user3,domain3)\n" | sudo tee -a /etc/netgroup

# copy in and execute tests inside the chroot
Expand Down

0 comments on commit c3878f8

Please sign in to comment.