Add support for regress tests using testsudoers

This commit is contained in:
Todd C. Miller
2011-01-07 13:19:32 -05:00
parent 217d296111
commit b679e03195
3 changed files with 31 additions and 2 deletions

View File

@@ -353,10 +353,11 @@ uninstall:
rm -f $(DESTDIR)$(sudoersdir)/sudoers
check: check_iolog_path
./check_iolog_path $(srcdir)/regress/iolog_path/data
@./check_iolog_path $(srcdir)/regress/iolog_path/data
@for t in $(srcdir)/regress/testsudoers/test*.sh; do SRCDIR=$(srcdir) $(SHELL) $$t; done
clean:
-$(LIBTOOL) --mode=clean rm -f $(PROGS) *.lo *.o *.la *.a stamp-* core *.core core.*
-$(LIBTOOL) --mode=clean rm -f $(PROGS) *.lo *.o *.la *.a stamp-* core *.core core.* test*.out
mostlyclean: clean

View File

@@ -0,0 +1,8 @@
Parses OK.
Entries for user root:
ALL = ALL
host matched
Command unmatched

View File

@@ -0,0 +1,20 @@
#!/bin/sh
#
# Test for NULL dereference with "sudo -g group" when the sudoers rule
# has no runas user or group listed.
# This is RedHat bug Bug 667103.
#
WANT=${SRCDIR-.}/regress/testsudoers/test1.ok
GOT=test1.out
./testsudoers -g wheel root id > $GOT <<EOF
root ALL = ALL
EOF
# Check results
if cmp $WANT $GOT >/dev/null; then
echo "testsudoers 1: OK"
else
echo "testsudoers 1: FAILED"
diff $WANT $GOT
fi