3 # Script which does some basic tests to ensure we haven't regressed.
4 # Probably a good idea to run this before doing any checkins.
5 # In the future this can become more fancy, but it's OK for now.
9 export PATH=/sbin:/usr/sbin:$SRCDIR:$PATH
15 [ "$COUNT" ] || COUNT=1000
19 [ "`mount | grep $OSCMT`" ] || echo | sh llsetup.sh $@ || exit 1
21 # let's start slowly here...
22 echo "touching $OSCMT"
23 touch $OSCMT || fail "can't touch $OSCMT" 2
25 echo "copying /etc/hosts to $HOSTS"
26 cp /etc/hosts $HOSTS || fail "can't cp /etc/hosts to $HOSTS" 3
27 echo "comparing /etc/hosts and $HOSTS"
28 diff -u /etc/hosts $HOSTS || fail "$HOSTS different" 4
29 #echo "renaming $HOSTS to $HOSTS.ren"
30 #mv $HOSTS $HOSTS.ren || fail "can't rename $HOSTS to $HOSTS.ren" 5
31 #echo "copying /etc/hosts to $HOSTS again"
32 #cp /etc/hosts $HOSTS || fail "can't cp /etc/hosts to $HOSTS again" 6
33 #echo "truncating $HOSTS"
34 #> $HOSTS || fail "can't truncate $HOSTS" 8
35 #echo "removing $HOSTS"
36 #rm $HOSTS || fail "can't remove $HOSTS" 9
39 # let's start slowly here...
41 mkdir $DST || fail "can't mkdir $DST" 10
43 # ok, that hopefully worked, so let's do a little more
44 FILES=`find $SRC -type f | head -$COUNT`
45 echo "copying files from $SRC to $DST$SRC"
46 tar cf - $FILES | tar xvf - -C $DST || fail "copying $SRC" 11
48 echo "comparing newly copied files"
50 diff -q $f $DST/$f || ERROR=11
53 [ "$ERROR" ] && fail "old and new files are different" $ERROR
57 echo | sh llrsetup.sh $@ || exit 20
58 echo "comparing previously copied files"
60 diff -q $f $DST/$f || ERROR=22
63 [ "$ERROR" ] && fail "old and new files are different on second diff" $ERROR
66 echo | sh llrsetup.sh $@ || exit 31
68 #echo "renaming $HOSTS.ren to $HOSTS"
69 #mv $HOSTS.ren $HOSTS || fail "can't rename $HOSTS.ren to $HOSTS" 32
70 echo "truncating $HOSTS"
71 > $HOSTS || fail "can't truncate $HOSTS" 34
72 echo "removing $HOSTS"
73 rm $HOSTS || fail "can't remove $HOSTS again" 36
75 rm -r $DST || fail "can't remove $DST" 37