diff --git a/0001-compute-Make-image-certificate-validation-a-configur.patch b/0001-compute-Make-image-certificate-validation-a-configur.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f9d43a42cde6b2fb77de0980e6c1f94a6d7f5f3 --- /dev/null +++ b/0001-compute-Make-image-certificate-validation-a-configur.patch @@ -0,0 +1,94 @@ +From cc95d9602b8b5bfd45217c3cf1b5cc3d347be992 Mon Sep 17 00:00:00 2001 +From: Lee Yarwood +Date: Thu, 6 Jun 2019 10:57:19 +0100 +Subject: [PATCH] compute: Make image certificate validation a configurable + feature + +tempest.api.compute.servers.test_servers.ServerShowV263Test would +previously always run and provide the optional +trusted_image_certificates parameter to validate the 2.63 API +microversion. However if the test image had not been cached locally this +would actually cause the underlying certificate validation logic within +Nova to be called resulting in the test failing as the test image would +not have the required img_signature_* properties set and the provided +trusted certificates are just test strings. + +This change makes this specific test optional (not running by default) +now by introducing two required compute configurables. These allow a +signed image with the required img_signature_* properties set along with +a valid list of trusted image certificates to also be used during the +test. + +Ica1d32ca66d6f89692e9cc90e415bf569332f58d is currently attempting to +wire up various image certificate and signature validation tests under +the barbican-tempest-plugin. + +Change-Id: Ib346d383c430d5151d9aafa6e856dd0a7cae8a23 +Closes-bug: 1831866 +(cherry picked from commit 7f7c232b29fe4e3f1cb446a810112db43d7dccdc) +--- + ...ig_image_certificate_compute_feature-c56efb520d54aff5.yaml | 8 ++++++++ + tempest/api/compute/servers/test_servers.py | 9 ++++++++- + tempest/config.py | 11 +++++++++++ + 3 files changed, 27 insertions(+), 1 deletion(-) + create mode 100644 releasenotes/notes/config_image_certificate_compute_feature-c56efb520d54aff5.yaml + +diff --git a/releasenotes/notes/config_image_certificate_compute_feature-c56efb520d54aff5.yaml b/releasenotes/notes/config_image_certificate_compute_feature-c56efb520d54aff5.yaml +new file mode 100644 +index 0000000..8475f50 +--- /dev/null ++++ b/releasenotes/notes/config_image_certificate_compute_feature-c56efb520d54aff5.yaml +@@ -0,0 +1,8 @@ ++--- ++other: ++ - | ++ New configuration options ``[compute]/certified_image_ref`` and ++ ``[compute]/certified_image_trusted_certs`` have been introduced. These ++ are required in order to run the ``ServerShowV263Test`` test and allow a ++ signed image with the required img_signature_* properties set along ++ with a list of trusted certificates to be used during the test. +diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py +index 56d973e..7429fc4 100644 +--- a/tempest/api/compute/servers/test_servers.py ++++ b/tempest/api/compute/servers/test_servers.py +@@ -215,10 +215,17 @@ class ServerShowV263Test(base.BaseV2ComputeTest): + min_microversion = '2.63' + max_microversion = 'latest' + ++ @testtools.skipUnless(CONF.compute.certified_image_ref, ++ '``[compute]/certified_image_ref`` required to test ' ++ 'image certificate validation.') ++ @testtools.skipUnless(CONF.compute.certified_image_trusted_certs, ++ '``[compute]/certified_image_trusted_certs`` ' ++ 'required to test image certificate validation.') + @decorators.idempotent_id('71b8e3d5-11d2-494f-b917-b094a4afed3c') + def test_show_update_rebuild_list_server(self): +- trusted_certs = ['test-cert-1', 'test-cert-2'] ++ trusted_certs = CONF.compute.certified_image_trusted_certs + server = self.create_test_server( ++ imageRef=CONF.compute.certified_image_ref, + trusted_image_certificates=trusted_certs, + wait_until='ACTIVE') + +diff --git a/tempest/config.py b/tempest/config.py +index 0f3fa54..cd032fd 100644 +--- a/tempest/config.py ++++ b/tempest/config.py +@@ -256,6 +256,17 @@ ComputeGroup = [ + help="Valid secondary image reference to be used in tests. " + "This is a required option, but if only one image is " + "available duplicate the value of image_ref above"), ++ cfg.StrOpt('certified_image_ref', ++ help="Valid image reference to be used in image certificate " ++ "validation tests when enabled. This image must also " ++ "have the required img_signature_* properties set. " ++ "Additional details available within the following Nova " ++ "documentation: https://docs.openstack.org/nova/latest/" ++ "user/certificate-validation.html"), ++ cfg.ListOpt('certified_image_trusted_certs', ++ help="A list of trusted certificates to be used when the " ++ "image certificate validation compute feature is " ++ "enabled."), + cfg.StrOpt('flavor_ref', + default="1", + help="Valid primary flavor to use in tests."), diff --git a/0002-compute-Correctly-pass-certified_image_ref-as-image_.patch b/0002-compute-Correctly-pass-certified_image_ref-as-image_.patch new file mode 100644 index 0000000000000000000000000000000000000000..24c801e57644dcd544bd9361d2afe3f5e45c7a88 --- /dev/null +++ b/0002-compute-Correctly-pass-certified_image_ref-as-image_.patch @@ -0,0 +1,29 @@ +From b19b299f4d268f04a2d50809c6cba0a91799ad28 Mon Sep 17 00:00:00 2001 +From: Lee Yarwood +Date: Thu, 27 Jun 2019 11:38:37 +0100 +Subject: [PATCH] compute: Correctly pass certified_image_ref as image_id + +Ib346d383c430d5151d9aafa6e856dd0a7cae8a23 incorrectly attempted to pass +this as imageRef leading to duplicate arguments being used when calling +the servers client to create the server. + +Closes-Bug: #1834461 +Change-Id: Ic913176b429b3465dcdbc2e4f44eea32f0b17dfa +(cherry picked from commit cff4ed761da330db1c3611312687f034d812ac98) +--- + tempest/api/compute/servers/test_servers.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py +index 7429fc4..b1bc075 100644 +--- a/tempest/api/compute/servers/test_servers.py ++++ b/tempest/api/compute/servers/test_servers.py +@@ -225,7 +225,7 @@ class ServerShowV263Test(base.BaseV2ComputeTest): + def test_show_update_rebuild_list_server(self): + trusted_certs = CONF.compute.certified_image_trusted_certs + server = self.create_test_server( +- imageRef=CONF.compute.certified_image_ref, ++ image_id=CONF.compute.certified_image_ref, + trusted_image_certificates=trusted_certs, + wait_until='ACTIVE') + diff --git a/openstack-tempest.spec b/openstack-tempest.spec index 863a290757e021168f656ef05e22f930cc87db48..bcf86e3c4f3c994d2602f67a33d748bac3f56b1a 100644 --- a/openstack-tempest.spec +++ b/openstack-tempest.spec @@ -1,164 +1,273 @@ -%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.\ + +%global with_python3 0 + +Name: openstack-%{project} +Version: 19.0.0 +Release: 2 +Summary: OpenStack Integration Test Suite (Tempest) +License: Apache-2.0 +Url: https://launchpad.net/tempest +Source0: http://tarballs.openstack.org/tempest/tempest-%{upstream_version}.tar.gz + +Patch0001: 0001-compute-Make-image-certificate-validation-a-configur.patch +Patch0002: 0002-compute-Correctly-pass-certified_image_ref-as-image_.patch -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 +BuildArch: noarch + +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 + +%if 0%{?with_python3} +Requires: python3-tempest = %{version}-%{release} +%else +Requires: python2-tempest = %{version}-%{release} +%endif + + +%description +%{common_desc} + +%package -n python2-%{project} +Summary: Tempest Python library + +%{?python_provide:%python_provide python2-%{project}} + +# Obsoletes: python-tempest-lib + +Requires: python2-cliff +Requires: python2-debtcollector +Requires: python2-fixtures +Requires: python2-jsonschema +Requires: python2-netaddr +Requires: python2-oslo-concurrency >= 3.26.0 +Requires: python2-oslo-config >= 5.2.0 +Requires: python2-oslo-log >= 3.36.0 +Requires: python2-oslo-serialization >= 2.18.0 +Requires: python2-oslo-utils >= 3.33.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. + +%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.26.0 +Requires: python3-oslo-config >= 5.2.0 +Requires: python3-oslo-log >= 3.36.0 +Requires: python3-oslo-serialization >= 2.18.0 +Requires: python3-oslo-utils >= 3.33.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 %py_req_cleanup +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} +export PYTHONPATH=. 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 +sphinx-build-2 -b html doc/source doc/build/html rm -rf doc/build/html/.{doctrees,buildinfo} - +%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 +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 +* Tue Jun 8 2021 zhangy1317 +- Remove Requires and epoch +* Mon May 17 2021 openstack-sig +- Package Spec generated diff --git a/openstack-tempest.tmpfiles b/openstack-tempest.tmpfiles deleted file mode 100644 index 40433f8094f08270cf95b5b9e0f44b8b11ff4f30..0000000000000000000000000000000000000000 --- a/openstack-tempest.tmpfiles +++ /dev/null @@ -1 +0,0 @@ -d /run/tempest 0755 root root - \ No newline at end of file diff --git a/tempest-19.0.0.tar.gz b/tempest-19.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0f4359f6b690126edddf34c0b195e745382d0a16 Binary files /dev/null and b/tempest-19.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