Add support for regress tests using testsudoers
This commit is contained in:
@@ -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
|
||||
|
||||
|
8
plugins/sudoers/regress/testsudoers/test1.ok
Normal file
8
plugins/sudoers/regress/testsudoers/test1.ok
Normal file
@@ -0,0 +1,8 @@
|
||||
Parses OK.
|
||||
|
||||
Entries for user root:
|
||||
|
||||
ALL = ALL
|
||||
host matched
|
||||
|
||||
Command unmatched
|
20
plugins/sudoers/regress/testsudoers/test1.sh
Executable file
20
plugins/sudoers/regress/testsudoers/test1.sh
Executable 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
|
Reference in New Issue
Block a user