| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
#set -x |
| 4 |
|
| 5 |
if [ $# -ne 1 ]; then |
| 6 |
echo "usage: $0 config-name" >&2 |
| 7 |
exit 1 |
| 8 |
fi |
| 9 |
|
| 10 |
file=$1 |
| 11 |
|
| 12 |
cd "$(dirname "$0")" |
| 13 |
|
| 14 |
trail=$(expr $file : ".*6$") |
| 15 |
options="" |
| 16 |
if [ $trail -eq 0 ]; then |
| 17 |
options="-4" |
| 18 |
else |
| 19 |
options="-6" |
| 20 |
fi |
| 21 |
|
| 22 |
out=/tmp/$file.out$$ |
| 23 |
|
| 24 |
../../keama $options -N -i $file.conf -o $out >&2 |
| 25 |
status=$? |
| 26 |
if [ $status -eq 255 ]; then |
| 27 |
echo "$file config raised an error" >&2 |
| 28 |
exit 1 |
| 29 |
fi |
| 30 |
|
| 31 |
expected=$file.json |
| 32 |
|
| 33 |
diff --brief $out $expected |
| 34 |
if [ $? -ne 0 ]; then |
| 35 |
echo "$file config doesn't provide expected output" >&2 |
| 36 |
exit 1 |
| 37 |
fi |
| 38 |
|
| 39 |
exit $status |