summaryrefslogtreecommitdiff
path: root/keama/tests/samples/runone.sh
blob: 1d56e01550323da65528ba42514d76e19973f55f (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
31
32
33
34
35
36
37
38
39
#!/bin/sh

#set -x

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

file=$1

cd "$(dirname "$0")"

trail=$(expr $file : ".*6$")
options=""
if [ $trail -eq 0 ]; then
	options="-4"
else
	options="-6"
fi

out=/tmp/$file.out$$

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

expected=$file.json

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

exit $status