summaryrefslogtreecommitdiffstats
path: root/doc/developer-guide/Using-Gluster-Test-Framework.md
blob: 96fa9247e84c4f58497b1e596e2bf1dd91298ae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
Description
-----------

The Gluster Test Framework, is a suite of scripts used for regression
testing of Gluster.

It runs well on RHEL and CentOS (possibly Fedora too, presently being
tested), and is automatically run against every patch submitted to
Gluster [for review](http://review.gluster.org).

The Gluster Test Framework is part of the main Gluster code base, living
under the "tests" subdirectory:

		http://git.gluster.org/?p=glusterfs.git;a=summary

WARNING
-------

Running the Gluster Test Framework deletes “/var/lib/glusterd/\*”.

**DO NOT run it on a server with any data.**

Preparation steps for Ubuntu 14.04 LTS
--------------------------------------

​1. \# apt-get install dbench git libacl1-dev mock nfs-common
nfs-kernel-server libtest-harness-perl libyajl-dev xfsprogs psmisc attr
acl lvm2 rpm

​2. \# apt-get install python-webob python-paste python-sphinx

​3. \# apt-get install autoconf automake bison dos2unix flex libfuse-dev
libaio-dev libibverbs-dev librdmacm-dev libtool libxml2-dev
libxml2-utils liblvm2-dev make libssl-dev pkg-config libpython-dev
python-eventlet python-netifaces python-simplejson python-pyxattr
libreadline-dev tar

​4) Install cmockery2 from github (https://github.com/lpabon/cmockery2)
and compile and make install as in Readme

5)

		sudo groupadd mock
		sudo useradd -g mock mock

​6) mkdir /var/run/gluster

**Note**: redhat-rpm-config package is not found in ubuntu

Preparation steps for CentOS 7 (only)
-------------------------------------

​1. Install EPEL:

		$ sudo yum install -y http://epel.mirror.net.in/epel/7/x86_64/e/epel-release-7-1.noarch.rpm

​2. Install the CentOS 7.x dependencies:

		$ sudo yum install -y --enablerepo=epel cmockery2-devel dbench git libacl-devel mock nfs-utils perl-Test-Harness yajl xfsprogs psmisc

		$ sudo yum install -y --enablerepo=epel python-webob1.0 python-paste-deploy1.5 python-sphinx10 redhat-rpm-config

==\> Despite below missing packages it worked for me

		No package python-webob1.0 available.
		No package python-paste-deploy1.5 available.
		No package python-sphinx10 available.

		$ sudo yum install -y --enablerepo=epel autoconf automake bison dos2unix flex fuse-devel libaio-devel libibverbs-devel \
		 librdmacm-devel libtool libxml2-devel lvm2-devel make openssl-devel pkgconfig \
		 python-devel python-eventlet python-netifaces python-paste-deploy \
		 python-simplejson python-sphinx python-webob pyxattr readline-devel rpm-build \
		 tar

​3. Create the mock user

		$ sudo useradd -g mock mock

Preparation steps for CentOS 6.3+ (only)
----------------------------------------

​1. Install EPEL:

		$ sudo yum install -y http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

​2. Install the CentOS 6.x dependencies:

		$ sudo yum install -y --enablerepo=epel cmockery2-devel dbench git libacl-devel mock nfs-utils perl-Test-Harness yajl xfsprogs
		$ sudo yum install -y --enablerepo=epel python-webob1.0 python-paste-deploy1.5 python-sphinx10 redhat-rpm-config
		$ sudo yum install -y --enablerepo=epel autoconf automake bison dos2unix flex fuse-devel libaio-devel libibverbs-devel \
		  librdmacm-devel libtool libxml2-devel lvm2-devel make openssl-devel pkgconfig \
		  python-devel python-eventlet python-netifaces python-paste-deploy \
		  python-simplejson python-sphinx python-webob pyxattr readline-devel rpm-build \
		  tar

​3. Create the mock user

		$ sudo useradd -g mock mock

Preparation steps for RHEL 6.3+ (only)
--------------------------------------

​1. Ensure you have the "Scalable Filesystem Support" group installed

This provides the xfsprogs package, which is required by the test
framework.

​2. Install EPEL:

		$ sudo yum install -y http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

​3. Install the CentOS 6.x dependencies:

		$ sudo yum install -y --enablerepo=epel cmockery2-devel dbench git libacl-devel mock nfs-utils yajl perl-Test-Harness
		$ sudo yum install -y --enablerepo=rhel-6-server-optional-rpms python-webob1.0 python-paste-deploy1.5 python-sphinx10 redhat-rpm-config
		$ sudo yum install -y --disablerepo=rhs* --enablerepo=*optional-rpms autoconf \
		  automake bison dos2unix flex fuse-devel libaio-devel libibverbs-devel \
		  librdmacm-devel libtool libxml2-devel lvm2-devel make openssl-devel pkgconfig \
		  python-devel python-eventlet python-netifaces python-paste-deploy \
		  python-simplejson python-sphinx python-webob pyxattr readline-devel rpm-build \
		  tar

​4. Create the mock user

		$ sudo useradd -g mock mock

Preparation steps for Fedora 16-19 (only)
-----------------------------------------

**Still in development**

​1. Install the Fedora dependencies:

		$ sudo yum install -y attr cmockery2-devel dbench git mock nfs-utils perl-Test-Harness psmisc xfsprogs
		$ sudo yum install -y python-webob1.0 python-paste-deploy1.5 python-sphinx10 redhat-rpm-config
		$ sudo yum install -y autoconf automake bison dos2unix flex fuse-devel libaio-devel libibverbs-devel \
		  librdmacm-devel libtool libxml2-devel lvm2-devel make openssl-devel pkgconfig \
		  python-devel python-eventlet python-netifaces python-paste-deploy \
		  python-simplejson python-sphinx python-webob pyxattr readline-devel rpm-build \
		  tar

​3. Create the mock user

		$ sudo useradd -g mock mock

Common steps
------------

​1. Ensure DNS for your server is working

The Gluster Test Framework fails miserably if the full domain name for
your server doesn't resolve back to itself.

If you don't have a working DNS infrastructure in place, adding an entry
for your server to its /etc/hosts file will work.

​2. Install the version of Gluster you are testing

Either install an existing set of rpms:

		$ sudo yum install [your gluster rpms here]

Or compile your own ones (fairly easy):

	http://www.gluster.org/community/documentation/index.php/CompilingRPMS

​3. Clone the GlusterFS git repository

		$ git clone git://git.gluster.org/glusterfs
		$ cd glusterfs

Ensure mock can access the directory
------------------------------------

Some tests run as the user "mock". If the mock user can't access the
tests subdirectory directory, these tests fail. (rpm.t is one such test)

This is a known gotcha when the git repo is cloned to your home
directory. Home directories generally don't have world readable
permissions. You can fix this by adjusting your home directory
permissions, or placing the git repo somewhere else (with access for the
mock user).

Running the tests
-----------------

The tests need to run as root, so they can mount volumes and manage
gluster processes as needed.

It's also best to run them directly as the root user, instead of through
sudo. Strange things sporadicly happen