summaryrefslogtreecommitdiff
path: root/tests/t0002-nfsconf.sh
blob: 511d248e9be995e1efdf35c6889b6ac13624460b (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
#!/bin/bash

TESTFILES=nfsconf
DUMPER=`realpath ../tools/nfsconf/nfsconftool`

BASEDIR=`dirname "$0"`
pushd $BASEDIR/$TESTFILES

rm -f *.out

TCOUNT=0
TPASS=0

for i in *.conf
do
TNAME=`basename "$i" .conf`

echo "Running test $TNAME"
TCOUNT=$((TCOUNT + 1))

if ! $DUMPER --file "$i" --dump - > "$TNAME.out" 2>&1
then
echo "Error running test $TNAME"
elif ! diff -u "$TNAME.exp" "$TNAME.out"
then
echo "FAIL differences detected in test $TNAME"
else
echo "PASS $TNAME"
TPASS=$((TPASS + 1))
fi

done

echo "nfsconf tests complete. $TPASS of $TCOUNT tests passed"

if [ $TPASS -lt $TCOUNT ]; then
exit 1
fi