add xml format check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2015-05-02 18:51:39 +01:00
parent 0d6c61d437
commit c4e5ef6198
3 changed files with 35 additions and 0 deletions

View file

@ -13,6 +13,7 @@ TESTS = \
tests/complete \
tests/empty \
tests/full-json \
tests/full-xml \
tests/leading0 \
tests/one-ip \
tests/one-line \

View file

@ -0,0 +1,21 @@
<dhcpstatus>
<active_lease>
<ip>10.0.0.5</ip>
<macaddress>00:00:00:00:00:00</macaddress>
</active_lease>
<subnet>
<location>All networks</location>
<range>10.0.0.1 - 10.0.0.10</range>
<defined>10</defined>
<used>1</used>
<touched>0</touched>
<free>9</free>
</subnet>
<summary>
<location>All networks</location>
<defined>10</defined>
<used>1</used>
<touched>0</touched>
<free>9</free>
</summary>
</dhcpstatus>

13
tests/full-xml Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
#
# Minimal regression test suite.
if [ ! -d tests/outputs ]; then
mkdir tests/outputs
fi
dhcpd-pools -f X -c $top_srcdir/tests/confs/same-twice \
-l $top_srcdir/tests/leases/same-twice \
-o tests/outputs/same-twice-xml
diff -u $top_srcdir/tests/expected/same-twice-xml tests/outputs/same-twice-xml
exit $?