diff --git a/openstack-tempest.spec b/openstack-tempest.spec index 863a290757e021168f656ef05e22f930cc87db48..3e65077cd14670de456e96097fe431e9ff92a57d 100644 --- a/openstack-tempest.spec +++ b/openstack-tempest.spec @@ -1,164 +1,277 @@ -%if 0%{?rhel} || 0%{?fedora} -%global rdo 1 -%endif -%if 0%{?rhel} == 7 -%global skip_python3 1 -%endif +%global project tempest +%{!?upstream_version: %global upstream_version %{version}%{?milestone}} +%global with_doc 1 +%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. + +%global with_python3 0 + +Name: openstack-%{project} +Version: 18.0.0 +Release: 1 +Summary: OpenStack Integration Test Suite (Tempest) +License: Apache-2.0 +Url: https://opendev.org/openstack/tempest +Source0: http://tarballs.openstack.org/tempest/tempest-%{upstream_version}.tar.gz +BuildArch: noarch -Name: openstack-tempest -Version: 25.0.1 -Release: 1%{?dist} -Epoch: 0 -Summary: The OpenStack Integration Test Suite (Tempest) -License: ASL 2.0 -Group: Development/Languages/Python -URL: https://docs.openstack.org/tempest -Source0: https://files.pythonhosted.org/packages/source/t/tempest/tempest-25.0.1.tar.gz -Source1: openstack-tempest.tmpfiles +BuildRequires: git +BuildRequires: python2-oslo-config +BuildRequires: python2-pbr +BuildRequires: python2-setuptools +BuildRequires: python2-devel BuildRequires: openstack-macros -BuildRequires: python3-prettytable -BuildRequires: python3-PyYAML -BuildRequires: python3-cliff -BuildRequires: python3-debtcollector -BuildRequires: python3-fixtures -BuildRequires: python3-jsonschema -BuildRequires: python3-netaddr -BuildRequires: python3-oslo-concurrency + +Requires: python2-tempest = %{version}-%{release} + +%description +%{common_desc} + +%package -n python2-%{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: python2-cliff +Requires: python2-debtcollector +Requires: python2-fixtures +Requires: python2-jsonschema +Requires: python2-netaddr +Requires: python2-oslo-concurrency >= 3.8.0 +Requires: python2-oslo-config >= 4.0.0 +Requires: python2-oslo-log >= 3.22.0 +Requires: python2-oslo-serialization >= 1.10.0 +Requires: python2-oslo-utils >= 3.20.0 +Requires: python2-os-testr >= 0.8.0 +Requires: python2-paramiko +Requires: python2-pbr +Requires: python2-prettytable +Requires: python2-six +Requires: python2-stevedore +Requires: python2-stestr +Requires: python2-testtools +Requires: python2-urllib3 +Requires: python2-subunit +Requires: python2-unittest2 +Requires: python2-pyyaml +%description -n python2-%{project} +%{common_desc} + +This package contains the tempest python library. + +%package -n python2-%{project}-tests +Summary: Python Tempest tests +Requires: python2-tempest = %{version}-%{release} +%{?python_provide:%python_provide python2-%{project}-tests} + +BuildRequires: python2-mock +BuildRequires: python2-oslotest +BuildRequires: python2-subunit +BuildRequires: python2-oslo-log +BuildRequires: python2-jsonschema +BuildRequires: python2-urllib3 +BuildRequires: python2-pyyaml +BuildRequires: python2-oslo-concurrency +BuildRequires: python2-paramiko +BuildRequires: python2-cliff +BuildRequires: python2-pep8 +BuildRequires: python2-os-testr +BuildRequires: python2-stestr + +Requires: python2-mock +Requires: python2-oslotest + +%description -n python2-%{project}-tests +%{common_desc} + +This package contains tests for the tempest python library. + +# Python3 package +%if 0%{?with_python3} +%package -n python3-%{project} +Summary: Tempest Python library + +%{?python_provide:%python_provide python3-%{project}} BuildRequires: python3-oslo-config +BuildRequires: python3-pbr +BuildRequires: python3-setuptools +BuildRequires: python3-devel + +Requires: python3-cliff +Requires: python3-debtcollector +Requires: python3-fixtures +Requires: python3-jsonschema +Requires: python3-netaddr +Requires: python3-oslo-concurrency >= 3.8.0 +Requires: python3-oslo-config >= 4.0.0 +Requires: python3-oslo-log >= 3.22.0 +Requires: python3-oslo-serialization >= 1.10.0 +Requires: python3-oslo-utils >= 3.20.0 +Requires: python3-os-testr >= 0.8.0 +Requires: python3-paramiko +Requires: python3-pbr +Requires: python3-prettytable +Requires: python3-six +Requires: python3-stevedore +Requires: python3-stestr +Requires: python3-testtools +Requires: python3-urllib3 +Requires: python3-PyYAML +Requires: python3-subunit +Requires: python3-unittest2 + +%description -n python3-%{project} +%{common_desc} + +This package contains the tempest python library. + +%package -n python3-%{project}-tests +Summary: Python Tempest tests +%{?python_provide:%python_provide python3-%{project}-tests} + +Requires: python3-tempest = %{version}-%{release} + +BuildRequires: python3-oslotest +BuildRequires: python3-subunit BuildRequires: python3-oslo-log -BuildRequires: python3-oslo-serialization -BuildRequires: python3-oslo-utils +BuildRequires: python3-jsonschema +BuildRequires: python3-urllib3 +BuildRequires: python3-PyYAML +BuildRequires: python3-oslo-concurrency BuildRequires: python3-paramiko -BuildRequires: python3-subunit -BuildRequires: python3-six +BuildRequires: python3-cliff +BuildRequires: python3-pep8 +BuildRequires: python3-os-testr BuildRequires: python3-stestr -BuildRequires: python3-stevedore -BuildRequires: python3-testtools -BuildRequires: python3-unittest2 -BuildRequires: python3-urllib3 -Requires: python3-tempest = %{epoch}:%{version}-%{release} -BuildArch: noarch -%if 0%{?suse_version} -# to be compatible with older tempest packages -Provides: openstack-tempest-test = %{epoch}:%{version}-%{release} -Obsoletes: openstack-tempest-test < %{epoch}:%{version}-%{release} + +Requires: python3-oslotest + +%description -n python3-%{project}-tests +%{common_desc} + +This package contains tests for the tempest python library. %endif -%description -Tempest 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 python3-tempest -Summary: Documentation for the OpenStack Integration Test Suite -Group: Development/Languages/Python -Requires: python3-prettytable -Requires: python3-PyYAML -Requires: python3-cliff -Requires: python3-debtcollector -Requires: python3-fixtures -Requires: python3-jsonschema -Requires: python3-netaddr -Requires: python3-oslo-concurrency -Requires: python3-oslo-config -Requires: python3-oslo-log -Requires: python3-oslo-serialization -Requires: python3-oslo-utils -Requires: python3-paramiko -Requires: python3-subunit -Requires: python3-six -Requires: python3-stestr -Requires: python3-stevedore -Requires: python3-testtools -Requires: python3-unittest2 -Requires: python3-urllib3 - -%description -n python3-tempest -Tempest 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. - -This package contains the python module. - -%package doc -Summary: Documentation for the OpenStack Integration Test Suite -BuildRequires: python3-sphinx -BuildRequires: python3-openstackdocstheme -BuildRequires: python3-sphinxcontrib-svg2pdfconverter - -%description doc -Tempest 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. - -This package contains the documentation. + +%if 0%{?with_doc} +%package -n %{name}-doc +Summary: %{name} documentation + +BuildRequires: python2-sphinx +BuildRequires: python2-openstackdocstheme + +%description -n %{name}-doc +%{common_desc} + +It contains the documentation for Tempest. +%endif %prep -%autosetup -p1 -n tempest-25.0.1 +%autosetup -n tempest-%{upstream_version} -S git +# have dependencies being handled by rpms, rather than requirement files %py_req_cleanup +# 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 -%{py3_build} +%py2_build +%if 0%{?with_python3} +%py3_build +%endif -# generate html docs +%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 GENERATE_TEMPEST_PLUGIN_LIST='False' -PBR_VERSION=25.0.1 sphinx-build -b html doc/source doc/build/html -# remove the sphinx-build leftovers -rm -rf doc/build/html/.{doctrees,buildinfo} - +# TODO(ihrachys): remove when https://review.openstack.org/#/c/523235/ is +# released +sed -i 's/warning-is-error = 1/warning-is-error = 0/' setup.cfg +%{__python2} setup.py build_sphinx -b html +%endif %install -%{py3_install} - -# NOTE(toabctl): config files are installed into usr/etc/ -install -d -m 755 %{buildroot}%{_sysconfdir}/tempest -mv %{buildroot}/%{_prefix}/%{_sysconfdir}/tempest/accounts.yaml.sample %{buildroot}/%{_sysconfdir}/tempest/accounts.yaml -mv %{buildroot}/%{_prefix}/%{_sysconfdir}/tempest/logging.conf.sample %{buildroot}/%{_sysconfdir}/tempest/logging.conf -mv %{buildroot}/%{_prefix}/%{_sysconfdir}/tempest/whitelist.yaml %{buildroot}/%{_sysconfdir}/tempest/whitelist.yaml +%py2_install +%if 0%{?with_python3} +%py3_install +%endif -# install config -PYTHONPATH=. oslo-config-generator --config-file %{_builddir}/tempest-25.0.1/tempest/cmd/config-generator.tempest.conf --output-file %{buildroot}%{_sysconfdir}/tempest/tempest.conf +# Generate tempest config +mkdir -p %{buildroot}%{_sysconfdir}/%{project}/ +oslo-config-generator --config-file tempest/cmd/config-generator.tempest.conf \ + --output-file %{buildroot}%{_sysconfdir}/%{project}/tempest.conf -# install tmpfiles -install -D -m 644 %{SOURCE1} %{buildroot}/%_tmpfilesdir/%{name}.conf +mkdir -p %{buildroot}/etc/tempest +mv %{buildroot}/usr/etc/tempest/* %{buildroot}/etc/tempest -%if 0%{?suse_version} -# to be compatible with older tempest packages -%openstack_test_package_install tempest -cp -av .stestr.conf %{buildroot}/%{_localstatedir}/lib/%{name}-test/ +%check +export OS_TEST_PATH='./tempest/tests' +export PATH=$PATH:$RPM_BUILD_ROOT/usr/bin +export PYTHONPATH=$PWD +stestr --test-path $OS_TEST_PATH run +%if 0%{?with_python3} +rm -rf .stestr +stestr-3 --test-path $OS_TEST_PATH run %endif -%post -%tmpfiles_create %{_tmpfilesdir}/%{name}.conf - %files %license LICENSE -%doc README.rst ChangeLog -%_tmpfilesdir/%{name}.conf +%doc README.rst %{_bindir}/tempest - -%{_bindir}/skip-tracker %{_bindir}/check-uuid +%{_bindir}/skip-tracker %{_bindir}/subunit-describe-calls -%dir %{_sysconfdir}/tempest -%config(noreplace) %{_sysconfdir}/tempest/tempest.conf -%config(noreplace) %{_sysconfdir}/tempest/logging.conf -%config(noreplace) %{_sysconfdir}/tempest/accounts.yaml -%config(noreplace) %{_sysconfdir}/tempest/whitelist.yaml -%if 0%{?suse_version} -%{_localstatedir}/lib/openstack-tempest-test -%endif +%{_bindir}/tempest-account-generator +%{_bindir}/verify-tempest-config +%{_sysconfdir}/%{project}/*sample +%{_sysconfdir}/%{project}/*yaml +%config(noreplace) %{_sysconfdir}/%{project}/*.conf -%files -n python3-tempest +%files -n python2-%{project} %license LICENSE -%{python3_sitelib}/tempest -%{python3_sitelib}/*.egg-info +%{python2_sitelib}/%{project} +%{python2_sitelib}/%{project}*.egg-info +%exclude %{python2_sitelib}/tempest/tests -%files doc +%files -n python2-%{project}-tests %license LICENSE +%{python2_sitelib}/tempest/tests + +%if 0%{?with_python3} +%files -n python3-%{project} +%license LICENSE +%{python3_sitelib}/%{project} +%{python3_sitelib}/%{project}*.egg-info +%exclude %{python3_sitelib}/tempest/tests + +%files -n python3-%{project}-tests +%license LICENSE +%{python3_sitelib}/tempest/tests +%endif + +%if 0%{?with_doc} +%files -n %{name}-doc %doc doc/build/html +%license LICENSE +%endif %changelog +* Thu May 27 2021 openstack-sig +- Package init + diff --git a/tempest-18.0.0.tar.gz b/tempest-18.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..98db6e75eb0c26f60838e275dcc74b1af4f05cf0 Binary files /dev/null and b/tempest-18.0.0.tar.gz differ diff --git a/tempest-25.0.1.tar.gz b/tempest-25.0.1.tar.gz deleted file mode 100644 index 38ffdfb66fccc47d10769e1617fe45bd3a58416d..0000000000000000000000000000000000000000 Binary files a/tempest-25.0.1.tar.gz and /dev/null differ