dhcpd-pools/tests/statuses
Sami Kerola 447241e6c3
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>
2017-11-26 15:14:49 +00:00

22 lines
668 B
Bash
Executable file

#!/bin/sh
#
# Test json status field values.
IAM=$(basename $0)
if [ ! -d tests/outputs ]; then
mkdir tests/outputs
fi
dhcpd-pools -c $top_srcdir/tests/confs/$IAM --format=json -L33 \
-l $top_srcdir/tests/leases/$IAM -o tests/outputs/$IAM \
--warning=20 --critical=41 --all-as-shared --snet-alarms --all-as-shared
echo '== minsize' >> tests/outputs/$IAM
dhcpd-pools -c $top_srcdir/tests/confs/$IAM --format=json --limit 33 \
-l $top_srcdir/tests/leases/$IAM --minsize=20 \
--warning=20 --critical=41 --all-as-shared --snet-alarms --all-as-shared \
>> tests/outputs/$IAM
diff -u $top_srcdir/tests/expected/$IAM tests/outputs/$IAM
exit $?