Whamcloud - gitweb
land b_md onto HEAD. almost entirely small cleanups and miscellaneous fixes,
[fs/lustre-release.git] / lustre / tests / sanityN.sh
1 #!/bin/bash
2
3 export NAME=$NAME
4 clean() {
5         echo -n "cleanup..."
6         sh llmount2-hackcleanup.sh > /dev/null
7 }
8
9 CLEAN=clean
10 start() {
11         echo -n "mounting..."
12         sh llmount2-hack.sh > /dev/null
13         echo -n "mounted"
14 }
15 START=start
16
17 error () { 
18     echo $1
19     exit 1
20 }
21
22 mkdir -p /mnt/lustre2
23 mount | grep /mnt/lustre2 || $START
24
25 echo -n "test 1: check create on 2 mtpt's..."
26 touch /mnt/lustre1/f1
27 [ -f /mnt/lustre2/f1 ] || error "test 1 failure" 
28 echo "pass"
29
30 echo -n "test 2: check attribute updates on 2 mtpt's..."
31 chmod a+x /mnt/lustre2/f1
32 [ -x /mnt/lustre1/f1 ] || error "test 2 failure"
33 echo "pass"
34
35 echo -n "test 3: check after remount attribute updates on 2 mtpt's..."
36 chmod a-x /mnt/lustre2/f1
37 $CLEAN
38 $START
39
40 [ ! -x /mnt/lustre1/f1 ] || error "test 3 failure"
41 echo "pass"
42
43 echo -n "test 4: symlink on one mtpt, readlink on another..."
44 ( cd /mnt/lustre1 ; ln -s this/is/good lnk )
45
46 [ "Xthis/is/good" = X`perl -e 'print readlink("/mnt/lustre2/lnk");'` ] || error  "test 4 fails"
47 echo "pass"
48
49 echo -n "test 5: fstat validation on multiple mount points..."
50 ./multifstat /mnt/lustre1/fstatfile /mnt/lustre2/fstatfile || error "test 5 fails"
51 echo "pass"
52
53 echo -n "test 9: remove of open file on other node..."
54 touch /mnt/lustre1/f9
55 tail -f /mnt/lustre1/f9 &
56 rm /mnt/lustre2/f9
57 kill %1
58 cat /mnt/lustre1/f9 && error "test 9 fails"
59 echo "pass"
60
61 $CLEAN
62
63 exit