/
openstack-tempest.spec
300 lines (253 loc) · 9.41 KB
/
openstack-tempest.spec
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# Macros for py2/py3 compatibility
%if 0%{?fedora} || 0%{?rhel} > 7
%global pyver %{python3_pkgversion}
%else
%global pyver 2
%endif
%global pyver_bin python%{pyver}
%global pyver_sitelib %python%{pyver}_sitelib
%global pyver_install %py%{pyver}_install
%global pyver_build %py%{pyver}_build
# End of macros for py2/py3 compatibility
%global project tempest
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global with_doc 1
# guard for Red Hat OpenStack Platform supported tempest
%global rhosp 0
%global common_desc \
This is a set of integration tests to be run against a live OpenStack cluster.\
Tempest has batteries of tests for OpenStack API validation, Scenarios, and \
other specific tests useful in validating an OpenStack deployment.
Name: openstack-%{project}
Epoch: 1
Version: XXX
Release: XXX
Summary: OpenStack Integration Test Suite (Tempest)
License: ASL 2.0
Url: https://launchpad.net/tempest
Source0: http://tarballs.openstack.org/tempest/tempest-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: git
BuildRequires: python%{pyver}-oslo-config
BuildRequires: python%{pyver}-pbr
BuildRequires: python%{pyver}-setuptools
BuildRequires: python%{pyver}-devel
BuildRequires: openstack-macros
Requires: python%{pyver}-tempest = %{epoch}:%{version}-%{release}
%if 0%{?repo_bootstrap} == 0
%if 0%{?fedora} || 0%{?rhel} > 7
Recommends: python%{pyver}-tempestconf
%else
Requires: python%{pyver}-tempestconf
%endif
%endif
%description
%{common_desc}
%package -n python%{pyver}-%{project}
Summary: Tempest Python library
%{?python_provide:%python_provide python2-%{project}}
# Obsoletes python-tempest-lib to avoid breakage
# during upgrade from Newton onwards to till this
# release
Obsoletes: python-tempest-lib
Requires: python%{pyver}-cliff
Requires: python%{pyver}-debtcollector
Requires: python%{pyver}-fixtures
Requires: python%{pyver}-jsonschema
Requires: python%{pyver}-netaddr
Requires: python%{pyver}-oslo-concurrency >= 3.26.0
Requires: python%{pyver}-oslo-config >= 2:5.2.0
Requires: python%{pyver}-oslo-log >= 3.36.0
Requires: python%{pyver}-oslo-serialization >= 2.18.0
Requires: python%{pyver}-oslo-utils >= 3.33.0
Requires: python%{pyver}-os-testr >= 0.8.0
Requires: python%{pyver}-paramiko
Requires: python%{pyver}-pbr
Requires: python%{pyver}-prettytable
Requires: python%{pyver}-six
Requires: python%{pyver}-stevedore
Requires: python%{pyver}-stestr
Requires: python%{pyver}-testtools
Requires: python%{pyver}-urllib3
Requires: python%{pyver}-subunit
# Handle python2 exception
%if %{pyver} == 2
Requires: python-unittest2
Requires: PyYAML
%else
Requires: python%{pyver}-unittest2
Requires: python%{pyver}-PyYAML
%endif
%description -n python%{pyver}-%{project}
%{common_desc}
This package contains the tempest python library.
%package -n python%{pyver}-%{project}-tests
Summary: Python Tempest tests
Requires: python%{pyver}-tempest = %{epoch}:%{version}-%{release}
%{?python_provide:%python_provide python2-%{project}-tests}
BuildRequires: python%{pyver}-mock
BuildRequires: python%{pyver}-oslotest
BuildRequires: python%{pyver}-subunit
BuildRequires: python%{pyver}-oslo-log
BuildRequires: python%{pyver}-jsonschema
BuildRequires: python%{pyver}-urllib3
BuildRequires: python%{pyver}-oslo-concurrency
BuildRequires: python%{pyver}-paramiko
BuildRequires: python%{pyver}-cliff
BuildRequires: python%{pyver}-pycodestyle
BuildRequires: python%{pyver}-os-testr
BuildRequires: python%{pyver}-stestr
# Handle python2 exception
%if %{pyver} == 2
BuildRequires: PyYAML
%else
BuildRequires: python%{pyver}-PyYAML
%endif
Requires: python%{pyver}-mock
Requires: python%{pyver}-oslotest
%description -n python%{pyver}-%{project}-tests
%{common_desc}
This package contains tests for the tempest python library.
%if 0%{?repo_bootstrap} == 0
%package -n %{name}-all
Summary: All OpenStack Tempest Plugins
Requires: %{name} = %{epoch}:%{version}-%{release}
%if 0%{?fedora} || 0%{?rhel} > 7
Recommends: python%{pyver}-cinder-tests-tempest
Recommends: python%{pyver}-designate-tests-tempest
Recommends: python%{pyver}-heat-tests-tempest
Recommends: python%{pyver}-horizon-tests-tempest
Recommends: python%{pyver}-ironic-tests-tempest
Recommends: python%{pyver}-keystone-tests-tempest
Recommends: python%{pyver}-mistral-tests-tempest
Recommends: python%{pyver}-neutron-tests-tempest
Recommends: python%{pyver}-zaqar-tests-tempest
Recommends: python%{pyver}-manila-tests-tempest
Recommends: python%{pyver}-telemetry-tests-tempest
Recommends: python%{pyver}-octavia-tests-tempest
Recommends: python%{pyver}-networking-l2gw-tests-tempest
Recommends: python%{pyver}-patrole-tests-tempest
Recommends: python%{pyver}-novajoin-tests-tempest
Recommends: python%{pyver}-kuryr-tests-tempest
Recommends: python%{pyver}-barbican-tests-tempest
%if 0%{?rhosp} == 0
Recommends: python%{pyver}-congress-tests-tempest
Recommends: python%{pyver}-magnum-tests-tempest
Recommends: python%{pyver}-murano-tests-tempest
Recommends: python%{pyver}-sahara-tests-tempest
Recommends: python%{pyver}-trove-tests-tempest
Recommends: python%{pyver}-vitrage-tests-tempest
Recommends: python%{pyver}-watcher-tests-tempest
%endif
%else
Requires: python%{pyver}-cinder-tests-tempest
Requires: python%{pyver}-designate-tests-tempest
Requires: python%{pyver}-heat-tests-tempest
Requires: python%{pyver}-horizon-tests-tempest
Requires: python%{pyver}-ironic-tests-tempest
Requires: python%{pyver}-keystone-tests-tempest
Requires: python%{pyver}-mistral-tests-tempest
Requires: python%{pyver}-neutron-tests-tempest
Requires: python%{pyver}-zaqar-tests-tempest
Requires: python%{pyver}-manila-tests-tempest
Requires: python%{pyver}-telemetry-tests-tempest
Requires: python%{pyver}-octavia-tests-tempest
Requires: python%{pyver}-networking-l2gw-tests-tempest
Requires: python%{pyver}-patrole-tests-tempest
Requires: python%{pyver}-novajoin-tests-tempest
Requires: python%{pyver}-kuryr-tests-tempest
Requires: python%{pyver}-barbican-tests-tempest
%if 0%{?rhosp} == 0
Requires: python%{pyver}-congress-tests-tempest
Requires: python%{pyver}-magnum-tests-tempest
Requires: python%{pyver}-murano-tests-tempest
Requires: python%{pyver}-sahara-tests-tempest
Requires: python%{pyver}-trove-tests-tempest
Requires: python%{pyver}-vitrage-tests-tempest
Requires: python%{pyver}-watcher-tests-tempest
%endif
%endif
%description -n %{name}-all
%{common_desc}
This package contains all the tempest plugins.
%endif
%if 0%{?with_doc}
%package -n %{name}-doc
Summary: %{name} documentation
BuildRequires: python%{pyver}-sphinx
BuildRequires: python%{pyver}-openstackdocstheme
BuildRequires: python%{pyver}-sphinxcontrib-rsvgconverter
%description -n %{name}-doc
%{common_desc}
It contains the documentation for Tempest.
%endif
%prep
%autosetup -n tempest-%{upstream_version} -S git
# have dependencies being handled by rpms, rather than requirement files
%py_req_cleanup
# Adjust use of 'stestr' binary in tests
sed -i "s/'stestr'/'stestr-%{pyver}'/" tempest/tests/cmd/test_run.py tempest/tests/test_list_tests.py
# remove shebangs and fix permissions
RPMLINT_OFFENDERS="tempest/cmd/list_plugins.py \
tempest/cmd/cleanup.py \
tempest/cmd/cleanup_service.py \
tempest/cmd/verify_tempest_config.py \
tempest/cmd/account_generator.py \
tempest/lib/cmd/skip_tracker.py \
tempest/lib/cmd/check_uuid.py"
sed -i '1{/^#!/d}' $RPMLINT_OFFENDERS
chmod u=rw,go=r $RPMLINT_OFFENDERS
%build
%{pyver_build}
%if 0%{?with_doc}
# Disable Build the plugin registry step as it uses git to clone
# projects and then generate tempest plugin projects list.
# It is also time taking.
export PYTHONPATH=.
export GENERATE_TEMPEST_PLUGIN_LIST='False'
sphinx-build-%{pyver} -b html doc/source doc/build/html
# remove the sphinx-build-%{pyver} leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
%endif
%install
%{pyver_install}
# Generate tempest config
mkdir -p %{buildroot}%{_sysconfdir}/%{project}/
oslo-config-generator-%{pyver} --config-file tempest/cmd/config-generator.tempest.conf \
--output-file %{buildroot}%{_sysconfdir}/%{project}/tempest.conf
mkdir -p %{buildroot}/etc/tempest
mv %{buildroot}/usr/etc/tempest/* %{buildroot}/etc/tempest
%check
export OS_TEST_PATH='./tempest/tests'
export PATH=$PATH:$RPM_BUILD_ROOT/usr/bin
export PYTHONPATH=$PWD
PYTHON=%{pyver_bin} stestr-%{pyver} --test-path $OS_TEST_PATH run
%files
%license LICENSE
%doc README.rst
%{_bindir}/tempest
%{_bindir}/check-uuid
%{_bindir}/skip-tracker
%{_bindir}/subunit-describe-calls
%{_bindir}/tempest-account-generator
%{_sysconfdir}/%{project}/*sample
%{_sysconfdir}/%{project}/*yaml
%config(noreplace) %{_sysconfdir}/%{project}/*.conf
%files -n python%{pyver}-%{project}
%license LICENSE
%{pyver_sitelib}/%{project}
%{pyver_sitelib}/%{project}*.egg-info
%exclude %{pyver_sitelib}/tempest/tests
%files -n python%{pyver}-%{project}-tests
%license LICENSE
%{pyver_sitelib}/tempest/tests
%if 0%{?repo_bootstrap} == 0
%files -n %{name}-all
%license LICENSE
%endif
%if 0%{?with_doc}
%files -n %{name}-doc
%doc doc/build/html
%license LICENSE
%endif
%changelog