Whamcloud - gitweb
Lproc-snmp code drop
[fs/lustre-release.git] / lustre / tests / intent-test2.sh
1 #!/bin/bash
2
3 SRCDIR="`dirname $0`"
4 . $SRCDIR/common.sh
5
6 setup_opts "$@"
7
8 set -vx
9
10 MTPT1=/mnt/lustre1
11 MTPT2=/mnt/lustre2
12
13 remount() {
14     umount $MTPT1 || exit -1
15     umount $MTPT2 || exit -1
16     debugctl clear
17     setup_mount || fail "cannot remount /mnt/lustre"
18 }
19
20 fail() {
21     echo "unexpected failure"
22     exit -1
23 }
24
25 [ "`mount | grep $MTPT1`" ] || . llsetup.sh "$@" || exit -1
26
27 mkdir $MTPT1/dir1 || fail
28 echo "Next mkdir should fail"
29 mkdir $MTPT2/dir1 && fail
30 mkdir $MTPT2/dir2 || fail
31 echo "Next mkdirs should fail"
32 mkdir $MTPT1/dir2 && fail
33
34 remount
35
36 echo "Next 2 mkdir should fail"
37 mkdir $MTPT2/dir1 && fail
38 mkdir $MTPT1/dir2 && fail
39
40 ./mcreate $MTPT2/file1
41 echo "Next mcreate should fail"
42 ./mcreate $MTPT2/file1 && fail
43 ./mcreate $MTPT2/file2 || fail
44 echo "Next mcreate should fail"
45 ./mcreate $MTPT1/file2 && fail
46
47 remount
48
49 echo "Next 2 mcreates should fail"
50 ./mcreate $MTPT2/file1 && fail
51 ./mcreate $MTPT1/file2 && fail
52
53 rmdir $MTPT1/dir2 || fail
54 echo "Next rmdir should fail"
55 rmdir $MTPT2/dir2 && fail
56 rmdir $MTPT2/dir1 || fail
57
58 remount
59
60 echo "Next rpmdir should fail"
61
62 echo "File I/O: you should see increasing sequences of contiguous numbers"
63 echo 1 >> $MTPT1/file1
64 cat $MTPT2/file1
65 echo 2 >> $MTPT2/file1
66 cat $MTPT1/file1
67 echo 3 >> $MTPT2/file1
68 cat $MTPT1/file1
69 echo 4 >> $MTPT1/file1
70 cat $MTPT1/file1