mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 08:16:59 +00:00
tests: improve coverage
Add error condition checks. Add lease file binding states. Check all output formats. Check leases file that is in mad order, cse all sorting methods when checking this. Use json output to check status classfications. Add cidr range checks. Add conf include and comment parsing input checks. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
2849dde21b
commit
447241e6c3
33 changed files with 1059 additions and 51 deletions
30
tests/parser
Executable file
30
tests/parser
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Minimal regression test suite.
|
||||
|
||||
IAM=$(basename $0)
|
||||
|
||||
if [ ! -d tests/outputs ]; then
|
||||
mkdir tests/outputs
|
||||
fi
|
||||
cat <<EOF >"./${IAM}-conf"
|
||||
#shared-network "example3 " {
|
||||
# subnet 10.0.6.0 netmask 255.255.255.0 {
|
||||
# pool {
|
||||
# range 10.0.6.1 10.0.6.20;
|
||||
# }
|
||||
# }
|
||||
# subnet 10.1.7.0 netmask 255.255.255.0 {
|
||||
# pool {
|
||||
# range 10.1.7.1 10.1.7.20;
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
|
||||
include "tests/confs/complete";
|
||||
EOF
|
||||
dhcpd-pools -c "./${IAM}-conf" --color=never \
|
||||
-l $top_srcdir/tests/leases/$IAM -o tests/outputs/$IAM
|
||||
diff -u $top_srcdir/tests/expected/$IAM tests/outputs/$IAM
|
||||
rm -f "./${IAM}-conf"
|
||||
exit $?
|
||||
Loading…
Add table
Add a link
Reference in a new issue