Whamcloud - gitweb
Clean and restart up before running the removal test.
[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 RUNDIR=`dirname $0`
8
9 PATH=$PATH:$RUNDIR
10
11 ERROR=
12
13 [ "`mount | grep /mnt/lustre`" ] || echo | sh llmount.sh || exit 1
14
15 # let's start slowly here...
16 touch /mnt/lustre || exit 2
17 cp /etc/hosts /mnt/lustre || exit 3
18 diff -u /etc/hosts /mnt/lustre/hosts || exit 4
19
20 # ok, that hopefully worked, so let's do a little more
21 FILES=`find /etc -type f`
22 echo "copying files from /etc to /mnt/lustre"
23 tar cf - $FILES | tar xf - -C /mnt/lustre || exit 10
24
25 echo "comparing newly copied files"
26 for f in $FILES; do
27         diff -q $f /mnt/lustre/$f || ERROR=11
28 done
29
30 [ "$ERROR" ] && exit $ERROR
31
32 sh llmountcleanup.sh
33
34 echo | sh llrmount.sh || exit 20
35 echo "comparing previously copied files"
36 diff -u /etc/hosts /mnt/lustre/hosts || exit 21
37
38 for f in $FILES; do
39         diff -q $f /mnt/lustre/$f || ERROR=22
40 done
41
42 [ "$ERROR" ] && exit $ERROR
43
44 sh llmountcleanup.sh
45 echo | sh llrmount.sh || exit 24
46
47 echo "removing files from /mnt/lustre/etc"
48 rm /mnt/lustre/hosts || exit 25
49
50 rm -r /mnt/lustre/etc || exit 26
51
52 sh llmountcleanup.sh