Whamcloud - gitweb
Actually use the COUNT value.
[fs/lustre-release.git] / lustre / tests / runtests
1 #!/bin/sh
2 #
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.
6
7 SRCDIR="`dirname $0`"
8
9 export PATH=/sbin:/usr/sbin:$SRCDIR:$PATH
10
11 . $SRCDIR/common.sh
12
13 ERROR=
14 SRC=/etc
15 COUNT=1000
16
17 setup_opts $@
18
19 [ "`mount | grep $OSCMT`" ] || echo | sh llsetup.sh $@ || exit 1
20
21 # let's start slowly here...
22 echo "touching $OSCMT"
23 touch $OSCMT || fail "can't touch $OSCMT" 2
24 echo "copying /etc/hosts to $OSCMT/hosts"
25 cp /etc/hosts $OSCMT || fail "can't cp /etc/hosts to $OSCMT/hosts" 3
26 echo "comparing /etc/hosts and $OSCMT/hosts"
27 diff -u /etc/hosts $OSCMT/hosts || fail "$OSCMT/hosts different" 4
28
29 # ok, that hopefully worked, so let's do a little more
30 FILES=`find $SRC -type f | head -$COUNT`
31 echo "copying files from $SRC to $OSCMT$SRC"
32 tar cf - $FILES | tar xvf - -C $OSCMT || fail "copying $SRC" 10
33
34 echo "comparing newly copied files"
35 for f in $FILES; do
36         diff -q $f $OSCMT/$f || ERROR=11
37 done
38
39 [ "$ERROR" ] && fail "old and new files are different" 11
40
41 sh llcleanup.sh $@
42
43 echo | sh llrsetup.sh $@ || exit 20
44 echo "comparing previously copied files"
45 diff -u /etc/hosts $OSCMT/hosts || fail "$OSCMT/hosts is now different" 21
46
47 for f in $FILES; do
48         diff -q $f $OSCMT/$f || ERROR=22
49 done
50
51 [ "$ERROR" ] && fail "old and new files are different on second diff" 23
52
53 sh llcleanup.sh $@
54 echo | sh llrsetup.sh $@ || exit 24
55
56 echo "truncating $OSCMT/hosts"
57 > $OSCMT/hosts || fail "can't truncate $OSTMT/hosts" 25
58 echo "removing $OSCMT/hosts"
59 rm $OSCMT/hosts || fail "can't remove $OSCMT/hosts" 26
60
61 echo "removing $OSCMT$SRC"
62 rm -r $OSCMT$SRC || fail "can't remove $OSCMT$SRC" 27
63
64 sh llcleanup.sh $@