python-avocado.spec 16.0 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}
13
        %global commit		cf93b03d1b5693f9853bcf123c218074e90ae3f9
14 15
    %endif
    %if ! 0%{?commit_date:1}
16
        %global commit_date	20171215
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: 57.0
32
Release: 3%{?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 44 45 46 47 48 49
BuildRequires: fabric
BuildRequires: procps-ng
BuildRequires: pystache
BuildRequires: python-docutils
BuildRequires: python-lxml
BuildRequires: python-mock
BuildRequires: python-psutil
BuildRequires: python-requests
50
BuildRequires: python-resultsdb_api
51 52
BuildRequires: python-setuptools
BuildRequires: python-sphinx
C
Cleber Rosa 已提交
53
BuildRequires: python-six
54 55 56
BuildRequires: python-stevedore
BuildRequires: python2-devel
BuildRequires: yum
57
BuildRequires: python-aexpect
58 59 60 61

%if %{with_tests}
BuildRequires: libvirt-python
BuildRequires: perl-Test-Harness
62 63 64 65 66
%if 0%{?rhel}
BuildRequires: python-yaml
%else
BuildRequires: python2-yaml
%endif
67 68
%endif

69 70 71 72 73 74 75 76
Requires: gdb
Requires: gdb-gdbserver
Requires: procps-ng
Requires: pyliblzma
Requires: python
Requires: python-requests
Requires: python-setuptools
Requires: python-stevedore
77

78 79 80 81 82 83 84 85 86
# For compatibility reasons, let's mark this package as one that
# provides the same functionality as the old package name and also
# one that obsoletes the old package name, so that the new name is
# favored.  These could (and should) be removed in the future.
# These changes are backed by the following guidelines:
# https://fedoraproject.org/wiki/Upgrade_paths_%E2%80%94_renaming_or_splitting_packages
Obsoletes: %{srcname} < 47.0-1
Provides: %{srcname} = %{version}-%{release}

87 88 89 90 91 92 93 94 95
# For some strange reason, fabric on Fedora 24 does not require the
# python-crypto package, but the fabric code always imports it.  Newer
# fabric versions, such from Fedora 25 do conditional imports (try:
# from Crypto import Random; except: Random = None) and thus do not
# need this requirement.
%if 0%{?fedora} == 24
BuildRequires: python-crypto
%endif

96 97 98 99 100 101 102
%if 0%{?fedora} >= 25
BuildRequires: kmod
%endif
%if 0%{?rhel} >= 7
BuildRequires: kmod
%endif

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

%prep
108 109 110
%if 0%{?rel_build}
%setup -q -n %{srcname}-%{version}
%else
111
%setup -q -n %{srcname}-%{commit}
112
%endif
113 114 115 116
# 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
117 118 119

%build
%{__python} setup.py build
120
pushd optional_plugins/html
121
%{__python} setup.py build
122 123
popd
pushd optional_plugins/runner_remote
124
%{__python} setup.py build
125 126
popd
pushd optional_plugins/runner_vm
127
%{__python} setup.py build
128 129
popd
pushd optional_plugins/runner_docker
130
%{__python} setup.py build
131
popd
132 133 134
pushd optional_plugins/resultsdb
%{__python} setup.py build
popd
135 136 137
pushd optional_plugins/varianter_yaml_to_mux
%{__python} setup.py build
popd
138 139 140
pushd optional_plugins/loader_yaml
%{__python} setup.py build
popd
C
Cleber Rosa 已提交
141 142 143
pushd optional_plugins/golang
%{__python} setup.py build
popd
144 145 146
pushd optional_plugins/varianter_pict
%{__python} setup.py build
popd
147 148 149
pushd optional_plugins/result_upload
%{__python} setup.py build
popd
150
%{__make} man
151 152 153

%install
%{__python} setup.py install --root %{buildroot} --skip-build
154
%{__mv} %{buildroot}%{python_sitelib}/avocado/etc %{buildroot}
155
pushd optional_plugins/html
156
%{__python} setup.py install --root %{buildroot} --skip-build
157 158
popd
pushd optional_plugins/runner_remote
159
%{__python} setup.py install --root %{buildroot} --skip-build
160 161
popd
pushd optional_plugins/runner_vm
162
%{__python} setup.py install --root %{buildroot} --skip-build
163 164
popd
pushd optional_plugins/runner_docker
165
%{__python} setup.py install --root %{buildroot} --skip-build
166
popd
167 168 169
pushd optional_plugins/resultsdb
%{__python} setup.py install --root %{buildroot} --skip-build
popd
170 171 172
pushd optional_plugins/varianter_yaml_to_mux
%{__python} setup.py install --root %{buildroot} --skip-build
popd
173 174 175
pushd optional_plugins/loader_yaml
%{__python} setup.py install --root %{buildroot} --skip-build
popd
C
Cleber Rosa 已提交
176 177 178
pushd optional_plugins/golang
%{__python} setup.py install --root %{buildroot} --skip-build
popd
179 180 181
pushd optional_plugins/varianter_pict
%{__python} setup.py install --root %{buildroot} --skip-build
popd
182 183 184
pushd optional_plugins/result_upload
%{__python} setup.py install --root %{buildroot} --skip-build
popd
C
Cleber Rosa 已提交
185 186
%{__mkdir} -p %{buildroot}%{_mandir}/man1
%{__install} -m 0644 man/avocado.1 %{buildroot}%{_mandir}/man1/avocado.1
187
%{__install} -m 0644 man/avocado-rest-client.1 %{buildroot}%{_mandir}/man1/avocado-rest-client.1
188
%{__install} -d -m 0755 %{buildroot}%{_sharedstatedir}/avocado/data
189

190
%check
191
%if %{with_tests}
192
%{__python} setup.py develop --user
193
pushd optional_plugins/html
194
%{__python} setup.py develop --user
195 196
popd
pushd optional_plugins/runner_remote
197
%{__python} setup.py develop --user
198 199
popd
pushd optional_plugins/runner_vm
200
%{__python} setup.py develop --user
201 202
popd
pushd optional_plugins/runner_docker
203
%{__python} setup.py develop --user
204
popd
205 206 207
pushd optional_plugins/resultsdb
%{__python} setup.py develop --user
popd
208 209 210
pushd optional_plugins/varianter_yaml_to_mux
%{__python} setup.py develop --user
popd
211 212 213
pushd optional_plugins/loader_yaml
%{__python} setup.py develop --user
popd
C
Cleber Rosa 已提交
214 215 216
pushd optional_plugins/golang
%{__python} setup.py develop --user
popd
217 218 219
pushd optional_plugins/varianter_pict
%{__python} setup.py develop --user
popd
220 221 222
pushd optional_plugins/result_upload
%{__python} setup.py develop --user
popd
223 224 225 226
# 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
227
%endif
228

229 230 231
%files
%defattr(-,root,root,-)
%doc README.rst LICENSE
232 233 234 235 236
%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
237
%dir %{_sharedstatedir}/avocado
238 239 240 241 242 243 244 245
%config(noreplace)%{_sysconfdir}/avocado/avocado.conf
%config(noreplace)%{_sysconfdir}/avocado/conf.d/README
%config(noreplace)%{_sysconfdir}/avocado/conf.d/gdb.conf
%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
246
%{python_sitelib}/avocado*
247
%{_bindir}/avocado
248
%{_bindir}/avocado-rest-client
C
Cleber Rosa 已提交
249
%{_mandir}/man1/avocado.1.gz
250
%{_mandir}/man1/avocado-rest-client.1.gz
251 252
%{_docdir}/avocado/avocado.rst
%{_docdir}/avocado/avocado-rest-client.rst
253 254 255 256
%exclude %{python_sitelib}/avocado_result_html*
%exclude %{python_sitelib}/avocado_runner_remote*
%exclude %{python_sitelib}/avocado_runner_vm*
%exclude %{python_sitelib}/avocado_runner_docker*
257
%exclude %{python_sitelib}/avocado_resultsdb*
258
%exclude %{python_sitelib}/avocado_loader_yaml*
C
Cleber Rosa 已提交
259
%exclude %{python_sitelib}/avocado_golang*
260
%exclude %{python_sitelib}/avocado_varianter_yaml_to_mux*
261
%exclude %{python_sitelib}/avocado_varianter_pict*
262
%exclude %{python_sitelib}/avocado_result_upload*
263 264 265 266
%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*
267
%exclude %{python_sitelib}/avocado_framework_plugin_resultsdb*
268
%exclude %{python_sitelib}/avocado_framework_plugin_varianter_yaml_to_mux*
269
%exclude %{python_sitelib}/avocado_framework_plugin_varianter_pict*
270
%exclude %{python_sitelib}/avocado_framework_plugin_loader_yaml*
C
Cleber Rosa 已提交
271
%exclude %{python_sitelib}/avocado_framework_plugin_golang*
272
%exclude %{python_sitelib}/avocado_framework_plugin_result_upload*
273 274 275 276 277
%{_libexecdir}/avocado/avocado-bash-utils
%{_libexecdir}/avocado/avocado_debug
%{_libexecdir}/avocado/avocado_error
%{_libexecdir}/avocado/avocado_info
%{_libexecdir}/avocado/avocado_warn
278

279 280
%package plugins-output-html
Summary: Avocado HTML report plugin
281 282 283
Requires: %{name} == %{version}, pystache
Obsoletes: %{srcname}-plugins-output-html < 47.0-1
Provides: %{srcname}-plugins-output-html = %{version}-%{release}
284 285 286 287 288 289 290

%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
291
%{python_sitelib}/avocado_result_html*
292
%{python_sitelib}/avocado_framework_plugin_result_html*
293

294 295
%package plugins-runner-remote
Summary: Avocado Runner for Remote Execution
296 297
Requires: %{name} == %{version}
Requires: fabric
298 299 300 301
%if 0%{?fedora} == 24
Requires: python-crypto
BuildRequires: python-crypto
%endif
302 303
Obsoletes: %{srcname}-plugins-runner-remote < 47.0-1
Provides: %{srcname}-plugins-runner-remote = %{version}-%{release}
304 305 306 307 308 309

%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
310
%{python_sitelib}/avocado_runner_remote*
311
%{python_sitelib}/avocado_framework_plugin_runner_remote*
312 313 314

%package plugins-runner-vm
Summary: Avocado Runner for libvirt VM Execution
315 316
Requires: %{name} == %{version}
Requires: %{name}-plugins-runner-remote == %{version}
317
Requires: libvirt-python
318 319
Obsoletes: %{srcname}-plugins-runner-vm < 47.0-1
Provides: %{srcname}-plugins-runner-vm = %{version}-%{release}
320 321 322 323 324 325 326

%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
327
%{python_sitelib}/avocado_runner_vm*
328
%{python_sitelib}/avocado_framework_plugin_runner_vm*
329 330 331

%package plugins-runner-docker
Summary: Avocado Runner for Execution on Docker Containers
332 333
Requires: %{name} == %{version}
Requires: %{name}-plugins-runner-remote == %{version}
334
Requires: python-aexpect
335 336
Obsoletes: %{srcname}-plugins-runner-docker < 47.0-1
Provides: %{srcname}-plugins-runner-docker = %{version}-%{release}
337 338 339 340 341 342 343

%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 已提交
344
%{python_sitelib}/avocado_runner_docker*
345
%{python_sitelib}/avocado_framework_plugin_runner_docker*
346

347 348 349 350 351 352 353 354 355 356 357 358 359
%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*

360 361 362
%package plugins-varianter-yaml-to-mux
Summary: Avocado plugin to generate variants out of yaml files
Requires: %{name} == %{version}
363
%if 0%{?rhel}
364
Requires: python-yaml
365 366 367
%else
Requires: python2-yaml
%endif
368 369 370 371 372 373 374 375

%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*
376

377 378 379 380 381 382 383 384 385 386 387 388
%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 已提交
389 390 391 392 393 394 395 396 397 398 399 400
%package plugins-golang
Summary: Avocado Plugin for Execution of golang tests
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*

401 402 403 404 405 406 407 408 409 410 411 412
%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*

413 414 415 416 417 418 419 420 421 422 423 424
%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*

425
%package examples
426
Summary: Avocado Test Framework Example Tests
427
Requires: %{name} == %{version}
428

429 430 431 432
%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.
433

434
%files examples
C
Cleber Rosa 已提交
435 436
%{_datadir}/avocado/gdb-prerun-scripts
%{_datadir}/avocado/plugins
437
%{_datadir}/avocado/tests
438
%{_datadir}/avocado/wrappers
C
Cleber Rosa 已提交
439 440
%{_datadir}/avocado/yaml_to_mux
%{_datadir}/avocado/yaml_to_mux_loader
441
%{_datadir}/avocado/varianter_pict
442 443

%changelog
444 445 446
* Sat Jan  6 2018 Cleber Rosa <cleber@redhat.com> - 57.0-3
- Move the avocado package config files to the system location

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

450 451 452
* 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 已提交
453 454 455
* Tue Dec 19 2017 Cleber Rosa <cleber@redhat.com> - 57.0-0
- New upstream release

456 457 458
* Fri Dec 15 2017 Cleber Rosa <cleber@redhat.com> - 56.0-1
- Added result_upload plugin

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

462 463 464
* Thu Nov 16 2017 Cleber Rosa <cleber@redhat.com> - 55.0-1
- Introduced sub-package plugins-varianter-pict

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

468 469
* Mon Oct 16 2017 Cleber Rosa <cleber@redhat.com> - 54.1-3
- Excluded avocado_loader_yaml files from main package
C
Cleber Rosa 已提交
470
- Package recently introduced golang plugin
471 472 473 474

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

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

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

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

484 485
* Tue Aug 22 2017 Cleber Rosa <cleber@redhat.com> - 53.0-1
- Use variable name for configuration dir
486
- Clean up old changelog entries
C
Cleber Rosa 已提交
487
- Include other example files
488

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

492 493 494
* Mon Aug 14 2017 Cleber Rosa <cleber@redhat.com> - 52.0-2
- Add python[2]-yaml requirements

495 496 497
* Tue Jun 27 2017 Cleber Rosa <cleber@redhat.com> - 52.0-1
- Fix python-aexpect depedency on EL7

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