python-avocado.spec 17.7 KB
Newer Older
1
%global srcname avocado
2 3 4

# Conditional for release vs. snapshot builds. Set to 1 for release build.
%if ! 0%{?rel_build:1}
5
    %global rel_build 1
6 7 8 9
%endif

# Settings used for build from snapshots.
%if 0%{?rel_build}
10
    %global gittar		%{srcname}-%{version}.tar.gz
11
%else
12
    %if ! 0%{?commit:1}
C
Cleber Rosa 已提交
13
        %global commit		ef2b6f3b14716ef76912bd71feb582f0226fa217
14 15
    %endif
    %if ! 0%{?commit_date:1}
C
Cleber Rosa 已提交
16
        %global commit_date	20180227
17
    %endif
A
Amador Pahim 已提交
18
    %global shortcommit	%(c=%{commit};echo ${c:0:8})
19 20
    %global gitrel		.%{commit_date}git%{shortcommit}
    %global gittar		%{srcname}-%{shortcommit}.tar.gz
21 22
%endif

23 24 25
# Selftests are provided but may need to be skipped because many of
# the functional tests are time and resource sensitive and can
# cause race conditions and random build failures. They are
26 27 28
# enabled by default.
%global with_tests 1

29
Summary: Framework with tools and libraries for Automated Testing
30
Name: python-%{srcname}
C
Cleber Rosa 已提交
31
Version: 59.0
32
Release: 2%{?gitrel}%{?dist}
33 34
License: GPLv2
Group: Development/Tools
35
URL: http://avocado-framework.github.io/
36 37 38 39 40
%if 0%{?rel_build}
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{version}.tar.gz#/%{gittar}
%else
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{commit}.tar.gz#/%{gittar}
%endif
41
BuildArch: noarch
42 43
BuildRequires: fabric
BuildRequires: procps-ng
C
Cleber Rosa 已提交
44
BuildRequires: kmod
45
%if 0%{?rhel} == 7
46 47 48 49
BuildRequires: pystache
BuildRequires: python-lxml
BuildRequires: python-setuptools
BuildRequires: python-stevedore
50
BuildRequires: python2-aexpect
51
BuildRequires: python2-devel
52 53 54 55 56 57 58
BuildRequires: python2-docutils
BuildRequires: python2-mock
BuildRequires: python2-psutil
BuildRequires: python2-requests
BuildRequires: python2-resultsdb_api
BuildRequires: python2-six
BuildRequires: python2-sphinx
59
BuildRequires: yum
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
%else
BuildRequires: pystache
BuildRequires: python2-aexpect
BuildRequires: python2-devel
BuildRequires: python2-docutils
BuildRequires: python2-lxml
BuildRequires: python2-mock
BuildRequires: python2-psutil
BuildRequires: python2-requests
BuildRequires: python2-resultsdb_api
BuildRequires: python2-setuptools
BuildRequires: python2-six
BuildRequires: python2-sphinx
BuildRequires: python2-stevedore
%endif
75 76 77 78

%if %{with_tests}
BuildRequires: libvirt-python
BuildRequires: perl-Test-Harness
79
%if 0%{?rhel}
80
BuildRequires: PyYAML
81 82 83
%else
BuildRequires: python2-yaml
%endif
84 85
%endif

86 87 88 89
Requires: gdb
Requires: gdb-gdbserver
Requires: procps-ng
Requires: pyliblzma
90
%if 0%{?rhel} == 7
91 92 93
Requires: python
Requires: python-setuptools
Requires: python-stevedore
94 95 96 97 98 99 100
Requires: python2-requests
%else
Requires: python2
Requires: python2-requests
Requires: python2-setuptools
Requires: python2-stevedore
%endif
101 102

%description
103 104
Avocado is a set of tools and libraries (what people call
these days a framework) to perform automated testing.
105 106

%prep
107 108 109
%if 0%{?rel_build}
%setup -q -n %{srcname}-%{version}
%else
110
%setup -q -n %{srcname}-%{commit}
111
%endif
112 113 114 115
# package plugins-runner-vm requires libvirt-python, but the RPM
# version of libvirt-python does not publish the egg info and this
# causes that dep to be attempted to be installed by pip
sed -e "s/'libvirt-python'//" -i optional_plugins/runner_vm/setup.py
116 117

%build
118 119 120
%if 0%{?rhel} == 7
sed -e "s/'six>=1.10.0'/'six>=1.9.0'/" -i setup.py
%endif
121
%{__python} setup.py build
122
pushd optional_plugins/html
123
%{__python} setup.py build
124 125
popd
pushd optional_plugins/runner_remote
126
%{__python} setup.py build
127 128
popd
pushd optional_plugins/runner_vm
129
%{__python} setup.py build
130 131
popd
pushd optional_plugins/runner_docker
132
%{__python} setup.py build
133
popd
134 135 136
pushd optional_plugins/resultsdb
%{__python} setup.py build
popd
137 138 139
pushd optional_plugins/varianter_yaml_to_mux
%{__python} setup.py build
popd
140 141 142
pushd optional_plugins/loader_yaml
%{__python} setup.py build
popd
C
Cleber Rosa 已提交
143 144 145
pushd optional_plugins/golang
%{__python} setup.py build
popd
146 147 148
pushd optional_plugins/varianter_pict
%{__python} setup.py build
popd
149 150 151
pushd optional_plugins/result_upload
%{__python} setup.py build
popd
C
Cleber Rosa 已提交
152 153 154
pushd optional_plugins/glib
%{__python} setup.py build
popd
155
%{__make} man
156 157 158

%install
%{__python} setup.py install --root %{buildroot} --skip-build
159
%{__mv} %{buildroot}%{python_sitelib}/avocado/etc %{buildroot}
160
pushd optional_plugins/html
161
%{__python} setup.py install --root %{buildroot} --skip-build
162 163
popd
pushd optional_plugins/runner_remote
164
%{__python} setup.py install --root %{buildroot} --skip-build
165 166
popd
pushd optional_plugins/runner_vm
167
%{__python} setup.py install --root %{buildroot} --skip-build
168 169
popd
pushd optional_plugins/runner_docker
170
%{__python} setup.py install --root %{buildroot} --skip-build
171
popd
172 173 174
pushd optional_plugins/resultsdb
%{__python} setup.py install --root %{buildroot} --skip-build
popd
175 176 177
pushd optional_plugins/varianter_yaml_to_mux
%{__python} setup.py install --root %{buildroot} --skip-build
popd
178 179 180
pushd optional_plugins/loader_yaml
%{__python} setup.py install --root %{buildroot} --skip-build
popd
C
Cleber Rosa 已提交
181 182 183
pushd optional_plugins/golang
%{__python} setup.py install --root %{buildroot} --skip-build
popd
184 185 186
pushd optional_plugins/varianter_pict
%{__python} setup.py install --root %{buildroot} --skip-build
popd
187 188 189
pushd optional_plugins/result_upload
%{__python} setup.py install --root %{buildroot} --skip-build
popd
C
Cleber Rosa 已提交
190 191 192
pushd optional_plugins/glib
%{__python} setup.py install --root %{buildroot} --skip-build
popd
C
Cleber Rosa 已提交
193 194
%{__mkdir} -p %{buildroot}%{_mandir}/man1
%{__install} -m 0644 man/avocado.1 %{buildroot}%{_mandir}/man1/avocado.1
195
%{__install} -m 0644 man/avocado-rest-client.1 %{buildroot}%{_mandir}/man1/avocado-rest-client.1
196
%{__install} -d -m 0755 %{buildroot}%{_sharedstatedir}/avocado/data
197 198 199 200 201 202 203 204
%{__install} -d -m 0755 %{buildroot}%{_datadir}/avocado
%{__cp} -r examples/gdb-prerun-scripts %{buildroot}%{_datadir}/avocado
%{__cp} -r examples/plugins %{buildroot}%{_datadir}/avocado
%{__cp} -r examples/tests %{buildroot}%{_datadir}/avocado
%{__cp} -r examples/wrappers %{buildroot}%{_datadir}/avocado
%{__cp} -r examples/yaml_to_mux %{buildroot}%{_datadir}/avocado
%{__cp} -r examples/yaml_to_mux_loader %{buildroot}%{_datadir}/avocado
%{__cp} -r examples/varianter_pict %{buildroot}%{_datadir}/avocado
205 206
%{__mkdir} -p %{buildroot}%{_libexecdir}/
ln -s %{python_sitelib}/avocado/libexec/ %{buildroot}%{_libexecdir}/avocado
207

208
%check
209
%if %{with_tests}
210
%{__python} setup.py develop --user
211
pushd optional_plugins/html
212
%{__python} setup.py develop --user
213 214
popd
pushd optional_plugins/runner_remote
215
%{__python} setup.py develop --user
216 217
popd
pushd optional_plugins/runner_vm
218
%{__python} setup.py develop --user
219 220
popd
pushd optional_plugins/runner_docker
221
%{__python} setup.py develop --user
222
popd
223 224 225
pushd optional_plugins/resultsdb
%{__python} setup.py develop --user
popd
226 227 228
pushd optional_plugins/varianter_yaml_to_mux
%{__python} setup.py develop --user
popd
229 230 231
pushd optional_plugins/loader_yaml
%{__python} setup.py develop --user
popd
C
Cleber Rosa 已提交
232 233 234
pushd optional_plugins/golang
%{__python} setup.py develop --user
popd
235 236 237
pushd optional_plugins/varianter_pict
%{__python} setup.py develop --user
popd
238 239 240
pushd optional_plugins/result_upload
%{__python} setup.py develop --user
popd
C
Cleber Rosa 已提交
241 242 243
pushd optional_plugins/glib
%{__python} setup.py develop --user
popd
244 245 246 247
# Package build environments have the least amount of resources
# we have observed so far.  Let's avoid tests that require too
# much resources or are time sensitive
AVOCADO_CHECK_LEVEL=0 selftests/run
248
%endif
249

250 251 252
%files
%defattr(-,root,root,-)
%doc README.rst LICENSE
253 254 255 256 257
%dir %{_sysconfdir}/avocado
%dir %{_sysconfdir}/avocado/conf.d
%dir %{_sysconfdir}/avocado/sysinfo
%dir %{_sysconfdir}/avocado/scripts/job/pre.d
%dir %{_sysconfdir}/avocado/scripts/job/post.d
258
%dir %{_sharedstatedir}/avocado
259 260 261
%config(noreplace)%{_sysconfdir}/avocado/avocado.conf
%config(noreplace)%{_sysconfdir}/avocado/conf.d/README
%config(noreplace)%{_sysconfdir}/avocado/conf.d/gdb.conf
262
%config(noreplace)%{_sysconfdir}/avocado/conf.d/jobscripts.conf
263 264 265 266 267
%config(noreplace)%{_sysconfdir}/avocado/sysinfo/commands
%config(noreplace)%{_sysconfdir}/avocado/sysinfo/files
%config(noreplace)%{_sysconfdir}/avocado/sysinfo/profilers
%config(noreplace)%{_sysconfdir}/avocado/scripts/job/pre.d/README
%config(noreplace)%{_sysconfdir}/avocado/scripts/job/post.d/README
268
%{python_sitelib}/avocado*
269
%{_bindir}/avocado
270
%{_bindir}/avocado-rest-client
C
Cleber Rosa 已提交
271
%{_mandir}/man1/avocado.1.gz
272
%{_mandir}/man1/avocado-rest-client.1.gz
273 274 275 276
%exclude %{python_sitelib}/avocado_result_html*
%exclude %{python_sitelib}/avocado_runner_remote*
%exclude %{python_sitelib}/avocado_runner_vm*
%exclude %{python_sitelib}/avocado_runner_docker*
277
%exclude %{python_sitelib}/avocado_resultsdb*
278
%exclude %{python_sitelib}/avocado_loader_yaml*
C
Cleber Rosa 已提交
279
%exclude %{python_sitelib}/avocado_golang*
280
%exclude %{python_sitelib}/avocado_varianter_yaml_to_mux*
281
%exclude %{python_sitelib}/avocado_varianter_pict*
282
%exclude %{python_sitelib}/avocado_result_upload*
C
Cleber Rosa 已提交
283
%exclude %{python_sitelib}/avocado_glib*
284 285 286 287
%exclude %{python_sitelib}/avocado_framework_plugin_result_html*
%exclude %{python_sitelib}/avocado_framework_plugin_runner_remote*
%exclude %{python_sitelib}/avocado_framework_plugin_runner_vm*
%exclude %{python_sitelib}/avocado_framework_plugin_runner_docker*
288
%exclude %{python_sitelib}/avocado_framework_plugin_resultsdb*
289
%exclude %{python_sitelib}/avocado_framework_plugin_varianter_yaml_to_mux*
290
%exclude %{python_sitelib}/avocado_framework_plugin_varianter_pict*
291
%exclude %{python_sitelib}/avocado_framework_plugin_loader_yaml*
C
Cleber Rosa 已提交
292
%exclude %{python_sitelib}/avocado_framework_plugin_golang*
293
%exclude %{python_sitelib}/avocado_framework_plugin_result_upload*
C
Cleber Rosa 已提交
294
%exclude %{python_sitelib}/avocado_framework_plugin_glib*
295
%exclude %{python_sitelib}/avocado/libexec*
296

297 298
%package plugins-output-html
Summary: Avocado HTML report plugin
299
Requires: %{name} == %{version}, pystache
300 301 302 303 304 305 306

%description plugins-output-html
Adds to avocado the ability to generate an HTML report at every job results
directory. It also gives the user the ability to write a report on an
arbitrary filesystem location.

%files plugins-output-html
307
%{python_sitelib}/avocado_result_html*
308
%{python_sitelib}/avocado_framework_plugin_result_html*
309

310 311
%package plugins-runner-remote
Summary: Avocado Runner for Remote Execution
312 313
Requires: %{name} == %{version}
Requires: fabric
314 315 316 317 318 319

%description plugins-runner-remote
Allows Avocado to run jobs on a remote machine, by means of an SSH
connection.  Avocado must be previously installed on the remote machine.

%files plugins-runner-remote
320
%{python_sitelib}/avocado_runner_remote*
321
%{python_sitelib}/avocado_framework_plugin_runner_remote*
322 323 324

%package plugins-runner-vm
Summary: Avocado Runner for libvirt VM Execution
325 326
Requires: %{name} == %{version}
Requires: %{name}-plugins-runner-remote == %{version}
327 328 329 330 331 332 333 334
Requires: libvirt-python

%description plugins-runner-vm
Allows Avocado to run jobs on a libvirt based VM, by means of
interaction with a libvirt daemon and an SSH connection to the VM
itself.  Avocado must be previously installed on the VM.

%files plugins-runner-vm
335
%{python_sitelib}/avocado_runner_vm*
336
%{python_sitelib}/avocado_framework_plugin_runner_vm*
337 338 339

%package plugins-runner-docker
Summary: Avocado Runner for Execution on Docker Containers
340 341
Requires: %{name} == %{version}
Requires: %{name}-plugins-runner-remote == %{version}
342 343 344 345 346 347 348 349
Requires: python-aexpect

%description plugins-runner-docker
Allows Avocado to run jobs on a Docker container by interacting with a
Docker daemon and attaching to the container itself.  Avocado must
be previously installed on the container.

%files plugins-runner-docker
C
Cleber Rosa 已提交
350
%{python_sitelib}/avocado_runner_docker*
351
%{python_sitelib}/avocado_framework_plugin_runner_docker*
352

353 354 355 356 357 358 359 360 361 362 363 364
%package plugins-resultsdb
Summary: Avocado plugin to propagate job results to ResultsDB
Requires: %{name} == %{version}
Requires: python-resultsdb_api

%description plugins-resultsdb
Allows Avocado to send job results directly to a ResultsDB
server.

%files plugins-resultsdb
%{python_sitelib}/avocado_resultsdb*
%{python_sitelib}/avocado_framework_plugin_resultsdb*
365
%config(noreplace)%{_sysconfdir}/avocado/conf.d/resultsdb.conf
366

367 368 369
%package plugins-varianter-yaml-to-mux
Summary: Avocado plugin to generate variants out of yaml files
Requires: %{name} == %{version}
370
%if 0%{?rhel}
371
Requires: PyYAML
372 373 374
%else
Requires: python2-yaml
%endif
375 376 377 378 379 380 381 382

%description plugins-varianter-yaml-to-mux
Can be used to produce multiple test variants with test parameters
defined in a yaml file(s).

%files plugins-varianter-yaml-to-mux
%{python_sitelib}/avocado_varianter_yaml_to_mux*
%{python_sitelib}/avocado_framework_plugin_varianter_yaml_to_mux*
383

384 385 386 387 388 389 390 391 392 393 394 395
%package plugins-loader-yaml
Summary: Avocado Plugin that loads tests from YAML files
Requires: %{name}-plugins-varianter-yaml-to-mux == %{version}

%description plugins-loader-yaml
Can be used to produce a test suite from definitions in a YAML file,
similar to the one used in the yaml_to_mux varianter plugin.

%files plugins-loader-yaml
%{python_sitelib}/avocado_loader_yaml*
%{python_sitelib}/avocado_framework_plugin_loader_yaml*

C
Cleber Rosa 已提交
396 397
%package plugins-golang
Summary: Avocado Plugin for Execution of golang tests
398
Requires: %{name} == %{version}
C
Cleber Rosa 已提交
399 400 401 402 403 404 405 406 407 408
Requires: golang

%description plugins-golang
Allows Avocado to list golang tests, and if golang is installed,
also run them.

%files plugins-golang
%{python_sitelib}/avocado_golang*
%{python_sitelib}/avocado_framework_plugin_golang*

409 410 411 412 413 414 415 416 417 418 419 420
%package plugins-varianter-pict
Summary: Varianter with combinatorial capabilities by PICT
Requires: %{name} == %{version}

%description plugins-varianter-pict
This plugin uses a third-party tool to provide variants created by
Pair-Wise algorithms, also known as Combinatorial Independent Testing.

%files plugins-varianter-pict
%{python_sitelib}/avocado_varianter_pict*
%{python_sitelib}/avocado_framework_plugin_varianter_pict*

421 422 423 424 425 426 427 428 429 430 431
%package plugins-result-upload
Summary: Avocado Plugin to propagate Job results to a remote host
Requires: %{name} == %{version}

%description plugins-result-upload
This optional plugin is intended to upload the Avocado Job results to
a dedicated sever.

%files plugins-result-upload
%{python_sitelib}/avocado_result_upload*
%{python_sitelib}/avocado_framework_plugin_result_upload*
432
%config(noreplace)%{_sysconfdir}/avocado/conf.d/result_upload.conf
433

C
Cleber Rosa 已提交
434 435 436 437 438 439 440 441 442 443 444 445
%package plugins-glib
Summary: Avocado Plugin for Execution of GLib Test Framework tests
Requires: %{name} == %{version}

%description plugins-glib
This optional plugin is intended to list and run tests written in the
GLib Test Framework.

%files plugins-glib
%{python_sitelib}/avocado_glib*
%{python_sitelib}/avocado_framework_plugin_glib*

446
%package examples
447
Summary: Avocado Test Framework Example Tests
448
Requires: %{name} == %{version}
449

450 451 452 453
%description examples
The set of example tests present in the upstream tree of the Avocado framework.
Some of them are used as functional tests of the framework, others serve as
examples of how to write tests on your own.
454

455
%files examples
C
Cleber Rosa 已提交
456 457
%{_datadir}/avocado/gdb-prerun-scripts
%{_datadir}/avocado/plugins
458
%{_datadir}/avocado/tests
459
%{_datadir}/avocado/wrappers
C
Cleber Rosa 已提交
460 461
%{_datadir}/avocado/yaml_to_mux
%{_datadir}/avocado/yaml_to_mux_loader
462
%{_datadir}/avocado/varianter_pict
463

464 465 466 467 468 469 470 471 472
%package bash
Summary: Avocado Test Framework Bash Utilities
Requires: %{name} == %{version}

%description bash
A small set of utilities to interact with Avocado from the Bourne
Again Shell code (and possibly other similar shells).

%files bash
473 474
%{python_sitelib}/avocado/libexec*
%{_libexecdir}/avocado*
475

476
%changelog
477 478
* Mon Mar 19 2018 Cleber Rosa <cleber@redhat.com> - 59.0-2
- Removed backward compatibility with name avocado on plugins
479
- Removed extra dependencies on Fedora 24 for runner-remote
480
- Added python-avocado requirement for golang plugin
481

482 483
* Thu Mar  8 2018 Cleber Rosa <cleber@redhat.com> - 59.0-1
- Remove backward compatibility with name avocado
484
- Remove hack to workaround fabric bugs on Fedora 24
485
- Use real package name for python YAML package on EL
486
- Use exact package names on requires
C
Cleber Rosa 已提交
487
- Remove unecessary conditional for kmod
488

C
Cleber Rosa 已提交
489 490 491 492
* Wed Feb 28 2018 Cleber Rosa <cleber@redhat.com> - 59.0-0
- New upstream release
- Added glib plugin subpackage

493 494 495
* Tue Jan 23 2018 Cleber Rosa <cleber@redhat.com> - 58.0-1
- Require a lower six version on EL7

C
Cleber Rosa 已提交
496 497 498
* Tue Jan 23 2018 Cleber Rosa <cleber@redhat.com> - 58.0-0
- New upstream release

499 500
* Sat Jan  6 2018 Cleber Rosa <cleber@redhat.com> - 57.0-3
- Move the avocado package config files to the system location
501
- Add missing configuration files for sub packages
502
- Adapt to change in example file installation
503
- Remove man pages source files from package
504
- Add bash subpackage
505

506 507 508
* Tue Dec 19 2017 Cleber Rosa <cleber@redhat.com> - 57.0-2
- Removed patch added on release 1, considering it's upstream

509 510 511
* Tue Dec 19 2017 Cleber Rosa <cleber@redhat.com> - 57.0-1
- Add patch to skip tests on EPEL 7 due to mock version

C
Cleber Rosa 已提交
512 513 514
* Tue Dec 19 2017 Cleber Rosa <cleber@redhat.com> - 57.0-0
- New upstream release

515 516 517
* Fri Dec 15 2017 Cleber Rosa <cleber@redhat.com> - 56.0-1
- Added result_upload plugin

C
Cleber Rosa 已提交
518 519 520
* Tue Nov 21 2017 Cleber Rosa <cleber@redhat.com> - 56.0-0
- New upstream release

521 522 523
* Thu Nov 16 2017 Cleber Rosa <cleber@redhat.com> - 55.0-1
- Introduced sub-package plugins-varianter-pict

C
Cleber Rosa 已提交
524 525 526
* Tue Oct 17 2017 Cleber Rosa <cleber@redhat.com> - 55.0-0
- New upstream release

527 528
* Mon Oct 16 2017 Cleber Rosa <cleber@redhat.com> - 54.1-3
- Excluded avocado_loader_yaml files from main package
C
Cleber Rosa 已提交
529
- Package recently introduced golang plugin
530 531 532 533

* Wed Oct  4 2017 Cleber Rosa <cleber@redhat.com> - 54.1-2
- Remove python-flexmock requirement

C
Cleber Rosa 已提交
534 535 536
* Wed Oct  4 2017 Cleber Rosa <cleber@redhat.com> - 54.1-1
- Add explicit BuildRequires for python-six

C
Cleber Rosa 已提交
537 538 539
* Wed Sep 20 2017 Cleber Rosa <cleber@redhat.com> - 54.1-0
- New minor upstream release

C
Cleber Rosa 已提交
540 541 542
* Wed Sep 20 2017 Cleber Rosa <cleber@redhat.com> - 54.0-0
- New upstream release

543 544
* Tue Aug 22 2017 Cleber Rosa <cleber@redhat.com> - 53.0-1
- Use variable name for configuration dir
545
- Clean up old changelog entries
C
Cleber Rosa 已提交
546
- Include other example files
547

C
Cleber Rosa 已提交
548 549 550
* Tue Aug 15 2017 Cleber Rosa <cleber@redhat.com> - 53.0-0
- New upstream release

551 552 553
* Mon Aug 14 2017 Cleber Rosa <cleber@redhat.com> - 52.0-2
- Add python[2]-yaml requirements

554 555 556
* Tue Jun 27 2017 Cleber Rosa <cleber@redhat.com> - 52.0-1
- Fix python-aexpect depedency on EL7

C
Cleber Rosa 已提交
557 558
* Mon Jun 26 2017 Cleber Rosa <cleber@redhat.com> - 52.0-0
- New upstream release