File tree Expand file tree Collapse file tree 7 files changed +76
-176
lines changed Expand file tree Collapse file tree 7 files changed +76
-176
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
source ./regression_helpers
4
- source ./init
5
4
6
- GLUSTERD_DIR=$( dirname $GLUSTERD ) ;
5
+ VOLNAME=" vol" ;
6
+ $GLUSTERFSDIR /gluster volume create $VOLNAME $( hostname) :$EXPORT_DIR /$global_bug_id /export1 2> /dev/null 1> /dev/null;
7
7
8
- mkdir $EXPORT_DIR / $global_bug_id / ;
8
+ $GLUSTERFSDIR /gluster --mode=script volume stop $VOLNAME | grep " started state " 2> /dev/null 1> /dev/null ;
9
9
10
- $GLUSTERD_DIR /gluster volume create vol $( hostname ) : $EXPORT_DIR / $global_bug_id /export1 2> /dev/null 1> /dev/null ;
10
+ exit $? ;
11
11
12
- $GLUSTERD_DIR /gluster --mode=script volume stop vol | grep " started state" 2> /dev/null 1> /dev/null;
13
12
14
- if [ $? -ne 0 ]; then
15
- echo -n " $global_bug_id : "
16
- not_ok;
17
- else
18
- echo -n " $global_bug_id : "
19
- ok;
20
- fi
21
-
22
- test_kill;
23
-
24
- test_cleanup;
25
13
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- source ./init
4
3
source ./regression_helpers
5
4
6
- GLUSTERD_DIR=$( dirname $GLUSTERD ) ;
7
- mkdir $EXPORT_DIR /$global_bug_id /;
5
+ VOLNAME=" abcdefg" ;
6
+ $GLUSTERFSDIR /gluster volume delete $VOLNAME --mode=script | grep -i " exist" 2> /dev/null 1> /dev/null
7
+ exit $? ;
8
8
9
- $GLUSTERD_DIR /gluster volume delete abcdsdrgf --mode=script | grep -i " exist" 2> /dev/null 1> /dev/null
10
- if [ $? -ne 0 ]; then
11
- echo -n " $global_bug_id : "
12
- not_ok;
13
- else
14
- echo -n " $global_bug_id : "
15
- ok;
16
- fi
17
9
18
- test_kill;
19
-
20
- test_cleanup;
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
-
4
- source ./init
5
3
source ./regression_helpers
6
4
7
- GLUSTERD_DIR=$( dirname $GLUSTERD ) ;
8
- mkdir $EXPORT_DIR /$global_bug_id /;
9
-
10
- $GLUSTERD_DIR /gluster volume create vol transport tcp,rdma $( hostname) :$EXPORT_DIR /$global_bug_id /export1 2> /dev/null 1> /dev/null
11
-
12
- if [ $? -ne 0 ]; then
13
- echo -n " $global_bug_id : "
14
- not_ok;
15
- else
16
- echo -n " $global_bug_id : "
17
- ok;
18
- fi
5
+ VOLNAME=" vol" ;
6
+ $GLUSTERFSDIR /gluster volume create $VOLNAME transport tcp,rdma $( hostname) :$EXPORT_DIR /$global_bug_id /export1 2> /dev/null 1> /dev/null
7
+ exit $? ;
19
8
20
- test_kill;
21
9
22
- test_cleanup;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 20
20
test_kill ()
21
21
{
22
22
killall -9 glusterfs glusterfsd 2> /dev/null 1> /dev/null;
23
+ umount -l $FUSE_MOUNT 2> /dev/null 1> /dev/null;
24
+ umount -l $NFS_MOUNT 2> /dev/null 1> /dev/null;
23
25
rm -rf /etc/glusterd/vols/* ;
24
26
rm -rf /etc/glusterd/peers/* ;
25
27
}
@@ -74,6 +76,20 @@ start_glusterd ()
74
76
$gluster_path ;
75
77
}
76
78
79
+ mount_glusterfs ()
80
+ {
81
+ local volname=$1 ;
82
+
83
+ $GLUSTERFSDIR /glusterfs --volfile-server=$( hostname) --volfile-id=$volname $FUSE_MOUNT ;
84
+ }
85
+
86
+ mount_nfs ()
87
+ {
88
+ local volname=$1 ;
89
+
90
+ mount $( hostname) :$volname $NFS_MOUNT ;
91
+ }
92
+
77
93
run_testcase ()
78
94
{
79
95
local id=;
@@ -85,17 +101,42 @@ run_testcase ()
85
101
86
102
if [ $id ]; then
87
103
global_bug_id=$id ;
104
+ export FUSE_MOUNT=$EXPORT_DIR /$global_bug_id /fuse;
105
+ export NFS_MOUNT=$EXPORT_DIR /$global_bug_id /nfs;
106
+
88
107
if [ -f ./dvm/$id /testcase ]; then
108
+ create_directory $FUSE_MOUNT ;
109
+ create_directory $NFS_MOUNT ;
110
+
89
111
./dvm/$id /testcase $GLUSTERD ;
112
+ if [ $? -ne 0 ]; then
113
+ echo -n " $global_bug_id : "
114
+ not_ok;
115
+ else
116
+ echo -n " $global_bug_id : "
117
+ ok;
118
+ fi
119
+
120
+ test_kill;
121
+ test_cleanup;
90
122
fi
91
123
return 0;
92
124
fi
93
125
94
126
for i in $( ls dvm/ | grep " ^[0-9]*$" | sort -n)
95
127
do
96
128
if [ -f ./dvm/$i /testcase ]; then
97
- global_bug_id=$i ;
98
129
run_testcase $i ;
99
130
fi
100
131
done
101
132
}
133
+
134
+ function ok ()
135
+ {
136
+ echo " ok"
137
+ }
138
+
139
+ function not_ok ()
140
+ {
141
+ echo " not ok"
142
+ }
Original file line number Diff line number Diff line change 19
19
# <http://www.gnu.org/licenses/>.
20
20
21
21
22
- source ./init
23
22
source ./regression_helpers
24
23
25
- GLUSTERD_DIR=$( dirname $GLUSTERD ) ;
26
-
27
- mkdir $EXPORT_DIR /$global_bug_id ;
28
-
29
24
# testcase starts here
30
25
31
26
# Export directories should be from $EXPORT_DIR/$global_bug_id directory.
32
27
33
- # Mount point also should be from $EXPORT_DIR/$global_bug_id directory.
28
+ # For fuse mounts use mount_glusterfs $FUSE_MOUNT fumction.
29
+ # For nfs mounts use mount_nfs $NFS_MOUNT function
34
30
35
31
# Starting the volume, mounting it and checking for the appropriate
36
32
# functionality comprises the testcase.
37
33
34
+ # the glusterfs binaries for the provided version can be obtained from the
35
+ # $GLUSTERFSDIR variable which points to the directory containing the
36
+ # gluster binaries such as glusterfs, glusterfsd, gluster
37
+
38
38
# This is my testcase
39
39
40
40
# testcase ends here
41
41
42
- test_kill;
43
-
44
- test_cleanup;
45
42
46
43
Original file line number Diff line number Diff line change @@ -24,14 +24,31 @@ _init ()
24
24
exit ;
25
25
}
26
26
27
- source ./init
27
+ [ $1 == " show" ] && {
28
+ ls $PWD /dvm | sort -n;
29
+ exit ;
30
+ }
31
+
28
32
source ./regression_helpers
29
33
export GLUSTERD=$1
30
34
bug_id=;
31
35
if [ $# -eq 2 ]; then
32
36
bug_id=$2 ;
33
37
fi
34
38
export EXPORT_DIR=" /regression/export" ;
39
+ export glusterd_conf=" /etc/glusterd" ;
40
+
41
+ export GLUSTERFSDIR=$( dirname $GLUSTERD ) ;
42
+ export VERSION_STR=$( $GLUSTERD --version) 2>&1 1> /dev/null
43
+ export VERSION=$( echo $VERSION_STR | cut -d " " -f 2)
44
+
45
+ if [ " $VERSION " == " " ]
46
+ then
47
+ echo " Unable to determine version of $GLUSTERD "
48
+ exit
49
+ fi
50
+
51
+ LOGDIR=$( dirname $GLUSTERFSDIR ) /var/log/glusterfs;
35
52
}
36
53
37
54
main ()
You can’t perform that action at this time.
0 commit comments