File openstack-tempest.spec of Package openstack-tempest

#
# spec file for package openstack-tempest
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2013 B1 Systems GmbH, Vohburg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define component tempest
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
%define version_unconverted 17.0.0
Name:           openstack-%{component}
Version:        17.0.0
Release:        0
Summary:        OpenStack Integration Test Suite (Tempest)
License:        Apache-2.0
Group:          System/Management
Url:            https://launchpad.net/tempest
Source0:        http://tarballs.openstack.org/tempest/tempest-%{version}.tar.gz
Source10:       %{name}.conf
Patch0:         install_absolute.patch
# PATCH-FIX-UPSTREAM 0001-Fix-identity-tests-when-domain-specific-drivers-are-.patch -- https://review.openstack.org/#/c/490735/
Patch1:         0001-Fix-identity-tests-when-domain-specific-drivers-are-.patch
# Skip the images member test cases because they require admin role due to BSC#1055943 -- https://bugzilla.suse.com/show_bug.cgi?id=1023507
Patch2:         0050-Skip-images-member-tempest.patch
# PATCH-FIX-UPSTREAM https://review.openstack.org/#/c/535270/
Patch3:         0001-Restrict-test_list_endpoints_for_token-to-tempest.patch
# PATCH-FIX-UPSTREAM 0001-Refactor-of-_check_tenant_network_connectivity.patch
Patch4:         0001-Refactor-of-_check_tenant_network_connectivity.patch
BuildRequires:  crudini
BuildRequires:  fdupes
BuildRequires:  openstack-suse-macros
# Documentatin build requirements:
BuildRequires:  python-Sphinx
BuildRequires:  python-base
BuildRequires:  python-oslo.concurrency
BuildRequires:  python-oslo.config
BuildRequires:  python-oslo.i18n
BuildRequires:  python-oslo.log
BuildRequires:  python-oslo.serialization
BuildRequires:  python-oslo.utils
BuildRequires:  python-oslosphinx
BuildRequires:  python-pbr
BuildRequires:  python-tempest-lib
BuildRequires:  python-urllib3
BuildRequires:  systemd
Requires:       %{name}-test = %{version}
Requires:       git-core
Requires:       python >= 2.6.8
Requires:       python-PyYAML >= 3.10
Requires:       python-tempest = %{version}
Requires(pre):  pwdutils
BuildArch:      noarch

%description
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.

%package test
Summary:        OpenStack Integration Test Suite (Tempest) - Test Package
Group:          Development/Languages/Python
Requires:       %{name} = %{version}

%description test
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.

%package -n python-tempest
Summary:        OpenStack Integration Test Suite (Tempest) - Python module
Group:          Development/Languages/Python
Requires:       python-PrettyTable >= 0.7.1
Requires:       python-cliff >= 2.8.0
Requires:       python-ddt
Requires:       python-debtcollector >= 1.2.0
Requires:       python-fixtures >= 3.0.0
Requires:       python-jsonschema >= 2.0.0
Requires:       python-mock >= 2.0.0
Requires:       python-netaddr >= 0.7.13
Requires:       python-os-testr >= 0.8.0
Requires:       python-oslo.concurrency >= 3.8.0
Requires:       python-oslo.config >= 4.0.0
Requires:       python-oslo.i18n >= 2.1.0
Requires:       python-oslo.log >= 3.30.0
Requires:       python-oslo.serialization >= 1.10.0
Requires:       python-oslo.utils >= 3.20.0
Requires:       python-oslotest >= 1.10.0
Requires:       python-paramiko >= 2.0.0
Requires:       python-pbr >= 2.0.0
Requires:       python-python-subunit >= 0.0.18
Requires:       python-six >= 1.9.0
Requires:       python-stevedore >= 1.20.0
Requires:       python-testrepository >= 0.0.18
Requires:       python-testscenarios >= 0.4
Requires:       python-testtools >= 1.4.0
Requires:       python-urllib3 >= 1.21.1

%description -n python-tempest
This package contains the core Python module of OpenStack Tempest.

%prep
%setup -q -n %{component}-%{version_unconverted}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%{openstack_cleanup_prep}

%build
python setup.py build
## python setup.py build_sphinx -b man

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
install -d -m 755 %{buildroot}%{_localstatedir}/lib/tempest
install -d -m 700 %{buildroot}%{_rundir}/tempest
install -D -m 644 %{SOURCE10} %{buildroot}/%{_tmpfilesdir}/%{name}.conf

### configuration files
PYTHONPATH=. oslo-config-generator --config-file %{_builddir}/%{component}-%{version_unconverted}/tempest/cmd/config-generator.tempest.conf --output-file %{buildroot}%{_sysconfdir}/tempest/tempest.conf
rm -f %{buildroot}%{_sysconfdir}/tempest/config-generator.tempest.conf

install -d -m 755 %{buildroot}%{_sysconfdir}/tempest
for fn in logging.conf accounts.yaml ; do
    mv %{buildroot}%{_sysconfdir}/tempest/$fn{.sample,}
done
## install -d %{buildroot}%{_mandir}/man1
## install -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1
%fdupes %{buildroot}%{python_sitelib}/%{component}

# configuration fixes
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf oslo_concurrency lock_path %{_localstatedir}/run/tempest
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf boto s3_materials_path ""
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf boto s3_url http://localhost:3333
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf service_available neutron true
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf service_available swift false
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf service_available heat false
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf auth admin_username admin
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf auth admin_tenant_name service
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf identity alt_username alt_demo
crudini --set %{buildroot}%{_sysconfdir}/tempest/tempest.conf identity alt_tenant_name alt_demo

### test subpackage
%{openstack_test_package_install}

%post
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf

%files
%doc LICENSE
%dir %{_sysconfdir}/tempest
%{_bindir}/tempest
%{_tmpfilesdir}/%{name}.conf
%config(noreplace) %{_sysconfdir}/tempest/logging.conf
%config(noreplace) %{_sysconfdir}/tempest/tempest.conf
%config(noreplace) %{_sysconfdir}/tempest/accounts.yaml
%config(noreplace) %{_sysconfdir}/tempest/whitelist.yaml

%files test
%doc LICENSE README.rst
%{_bindir}/verify-tempest-config
%{_bindir}/check-uuid
%{_bindir}/skip-tracker
%{_bindir}/tempest-account-generator
%{_bindir}/subunit-describe-calls
%{_localstatedir}/lib/openstack-%{component}-test
%{_localstatedir}/lib/openstack-tempest-test/
## %{_mandir}/man1/tempest.1%{?ext_man}

%files -n python-tempest
%doc LICENSE
%{python_sitelib}/%{component}/
%{python_sitelib}/%{component}-*.egg-info

%changelog
openSUSE Build Service is sponsored by