1997-04-29 20:17:09 +04:00
|
|
|
#
|
|
|
|
# Default script for testing the relocation library routines
|
|
|
|
# (irel -- inode relocation and brel -- block relocation)
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ -f $test_dir/setup ]; then
|
|
|
|
. $test_dir/setup
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$class"x = x ]; then
|
1997-04-29 21:48:10 +04:00
|
|
|
class=`echo $test_name | sed -e 's/e_\([^_]*\)_\(.*\)/\1/'`
|
|
|
|
instance=`echo $test_name | sed -e 's/e_\([^_]*\)_\(.*\)/\2/'`
|
1997-04-29 20:17:09 +04:00
|
|
|
fi
|
|
|
|
if [ "$OUT"x = x ]; then
|
|
|
|
OUT=$test_name.log
|
|
|
|
fi
|
|
|
|
if [ "$EXPECT"x = x ]; then
|
1997-04-29 21:48:10 +04:00
|
|
|
EXPECT=$SRCDIR/progs/test_data/expect.$class
|
1997-04-29 20:17:09 +04:00
|
|
|
fi
|
|
|
|
|
1997-04-29 21:48:10 +04:00
|
|
|
if [ "$class" = irel ]; then
|
|
|
|
TEST_PROG=$TEST_REL
|
|
|
|
elif [ "$class" = brel ]; then
|
|
|
|
TEST_PROG=$TEST_REL
|
|
|
|
elif [ "$class" = icount ]; then
|
|
|
|
TEST_PROG=$TEST_ICOUNT
|
|
|
|
else
|
|
|
|
TEST_PROG=/bin/cat
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat $SRCDIR/progs/test_data/$instance.setup $SRCDIR/progs/test_data/test.$class \
|
2003-03-06 19:09:18 +03:00
|
|
|
| $TEST_PROG -f - 2>&1 | tr -d \\015 > $OUT
|
1997-04-29 20:17:09 +04:00
|
|
|
|
|
|
|
cmp -s $EXPECT $OUT
|
|
|
|
status=$?
|
|
|
|
|
|
|
|
rm -f $test_name.failed $test_name.ok
|
|
|
|
|
|
|
|
if [ "$status" = 0 ] ; then
|
2012-05-29 02:58:24 +04:00
|
|
|
echo "$test_name: $test_description: ok"
|
1997-04-29 20:17:09 +04:00
|
|
|
touch $test_name.ok
|
|
|
|
else
|
2012-05-29 02:58:24 +04:00
|
|
|
echo "$test_name: $test_description: failed"
|
2005-06-16 23:08:00 +04:00
|
|
|
diff $DIFF_OPTS $EXPECT $OUT > $test_name.failed
|
1997-04-29 20:17:09 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
unset EXPECT OUT class instance
|