Whamcloud - gitweb
- move the peter branch changes to the head
[fs/lustre-release.git] / lustre / tests / intent-test.sh
1 #!/bin/bash -x
2
3 MTPT=/mnt/lustre
4
5 remount() {
6     umount $MTPT || exit -1
7     debugctl clear
8     mount -t lustre_lite -o osc=OSCDEV-UUID,mdc=MDCDEV-UUID none $MTPT
9 }
10
11 # Test mkdir
12 mkdir $MTPT/dir
13 mkdir $MTPT/dir2
14
15 # Test mkdir on existing directory
16 mkdir $MTPT/dir
17
18 remount
19
20 # Test mkdir on existing directory with no locks already held
21 mkdir $MTPT/dir
22
23 remount
24
25 # Use mknod to create a file
26 ./mcreate $MTPT/file
27 # ...on an existing file.
28 ./mcreate $MTPT/file
29
30 remount
31
32 # Use mknod to create a file with no locks already held
33 ./mcreate $MTPT/file
34
35 remount
36
37 ls -l $MTPT/file
38
39 remount
40
41 cat $MTPT/file
42 ./mcreate $MTPT/file2
43 cat $MTPT/file2
44 ./mcreate $MTPT/file3
45
46 remount
47
48 ./tchmod 777 $MTPT/file3
49
50 remount
51
52 ./mcreate $MTPT/file4
53 ./tchmod 777 $MTPT/file4
54
55 remount
56
57 ls -l $MTPT/file4
58 ./tchmod 777 $MTPT/file4
59
60 remount
61
62 cat $MTPT/file4
63 ./tchmod 777 $MTPT/file4
64
65 remount
66
67 touch $MTPT/file5
68 touch $MTPT/file6
69 touch $MTPT/file5
70
71 remount
72
73 touch $MTPT/file5
74
75 remount
76
77 echo foo >> $MTPT/file
78 cat $MTPT/file
79
80 remount
81
82 cat $MTPT/file
83
84 echo foo >> $MTPT/iotest
85 echo bar >> $MTPT/iotest
86 cat $MTPT/iotest
87
88 remount
89
90 cat $MTPT/iotest
91 echo baz >> $MTPT/iotest
92
93 remount
94
95 ls $MTPT
96
97 remount
98
99 mkdir $MTPT/new
100 ls $MTPT
101
102 remount
103
104 ls $MTPT
105 mkdir $MTPT/newer
106 ls $MTPT
107
108 remount
109
110 cat $MTPT/iotest
111 echo "Testing truncation..."
112 echo foo > $MTPT/iotest
113 echo bar >> $MTPT/iotest
114 cat  $MTPT/iotest
115 echo "trucating to 4 bytes now..."
116 ./truncate $MTPT/iotest 4
117 cat  $MTPT/iotest
118
119 remount
120
121 ls $MTPT
122 rmdir $MTPT/foo