summaryrefslogtreecommitdiff
path: root/keama/dhcp3/run.sh
blob: 86a437d271b66ea57ef2a440bd0ad5931543f967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

#set -x

if [ $# -ne 0 ]; then
	echo "usage: $0" >&2
	exit 1
fi

cd "$(dirname "$0")"
cd ..

file=dhcp3/master.dhcpd.conf
expected=dhcp3/kea.json
out=/tmp/pavlovs.out$$

./keama -4 -i  $file -o $out >&2
status=$?
if [ $status -eq 255 ]; then
	echo "Pavlov's config raised an error" >&2
	exit 1
fi

diff --brief $out $expected
if [ $? -ne 0 ]; then
	echo "Pavlov's config doesn't provide expected output" >&2
	exit 1
fi

exit $status