Whamcloud - gitweb
Print when we are done the mount and start copying.
[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
15 [ "`mount | grep /mnt/lustre`" ] || echo | sh llsetup.sh $@ || exit 1
16
17 # let's start slowly here...
18 touch /mnt/lustre || fail "can't touch /mnt/lustre" 2
19 echo "copying /etc/hosts to /mnt/lustre/hosts"
20 cp /etc/hosts /mnt/lustre || fail "can't cp /etc/hosts" 3
21 echo "comparing /etc/hosts and /mnt/lustre/hosts"
22 diff -u /etc/hosts /mnt/lustre/hosts || fail "/etc/hosts copy different" 4
23
24 # ok, that hopefully worked, so let's do a little more
25 FILES=`find /etc -type f`
26 echo "copying files from /etc to /mnt/lustre"
27 tar cf - $FILES | tar xf - -C /mnt/lustre || fail "copying /etc" 10
28
29 echo "comparing newly copied files"
30 for f in $FILES; do
31         diff -q $f /mnt/lustre/$f || ERROR=11
32 done
33
34 [ "$ERROR" ] && fail "old and new files are different" 11
35
36 sh llcleanup.sh $@
37
38 echo | sh llrsetup.sh $@ || exit 20
39 echo "comparing previously copied files"
40 diff -u /etc/hosts /mnt/lustre/hosts || fail "/etc/hosts is now different" 21
41
42 for f in $FILES; do
43         diff -q $f /mnt/lustre/$f || ERROR=22
44 done
45
46 [ "$ERROR" ] && fail "old and new files are different on second diff" 23
47
48 sh llcleanup.sh $@
49 echo | sh llrsetup.sh $@ || exit 24
50
51 echo "removing files from /mnt/lustre/etc"
52 rm /mnt/lustre/hosts || fail "can't remove /mnt/lustre/hosts" 25
53
54 rm -r /mnt/lustre/etc || fail "can't remove /mnt/lustre/etc" 26
55
56 sh llcleanup.sh $@