aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2020-04-02 18:37:30 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2020-04-11 09:20:52 +0200
commitb97dedc2c1b222901ce3dd4a2a71ca361f3f0792 (patch)
tree4c88a3fbfcfbe2a757a5a77276bb4289de765795
parentf88a304380916dd44be49caecaae2b37b8d8ec14 (diff)
Add tempest_heat (heat-tempest-plugin)
It asks for the Fedora-Cloud-Base image and a second user account. It should be noted that heat-tempest-plugin duplicates all configs from tempest. Minimal image is still Cirros and the first account is the admin one. Then it conforms with the TempestCommon logic. AodhAlarmTest is skipped by default because pre conditions are missing. SoftwareConfigIntegrationTest is skipped as in gates because it requires a custom image [1] [1] https://github.com/openstack/heat/blob/master/devstack/lib/heat#L444 Change-Id: I8b39dc65ef3714411cd828e17b95e124f2e90f34 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r--ansible/site.yml1
-rw-r--r--docker/smoke/Dockerfile10
-rw-r--r--docker/smoke/testcases.yaml15
-rw-r--r--docs/release/release-notes/functest-release.rst1
-rw-r--r--functest/ci/download_images.sh1
-rw-r--r--functest/ci/testcases.yaml15
-rw-r--r--functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml5
-rw-r--r--functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf_ovn.yaml5
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py66
-rw-r--r--setup.cfg1
10 files changed, 118 insertions, 2 deletions
diff --git a/ansible/site.yml b/ansible/site.yml
index f9852b585..0941c9a00 100644
--- a/ansible/site.yml
+++ b/ansible/site.yml
@@ -55,6 +55,7 @@
- neutron-tempest-plugin-api
- tempest_cinder
- tempest_keystone
+ - tempest_heat
- rally_sanity
- refstack_compute
- refstack_object
diff --git a/docker/smoke/Dockerfile b/docker/smoke/Dockerfile
index f8f0c41b2..c390ab5b6 100644
--- a/docker/smoke/Dockerfile
+++ b/docker/smoke/Dockerfile
@@ -9,6 +9,7 @@ ARG CINDER_TEMPEST_TAG=0.3.0
ARG KEYSTONE_TEMPEST_TAG=0.3.0
ARG BARBICAN_TAG=0.3.0
ARG OCTAVIA_TAG=1.2.0
+ARG HEAT_TEMPEST_TAG=37a8df97277b42693ead3f5709f23544788f5a9f
RUN apk --no-cache add --update libxml2 libxslt && \
apk --no-cache add --virtual .build-deps --update \
@@ -53,10 +54,15 @@ RUN apk --no-cache add --update libxml2 libxslt && \
git fetch --tags https://git.openstack.org/openstack/octavia-tempest-plugin.git $OCTAVIA_TAG && \
git checkout FETCH_HEAD) && \
update-requirements -s --source /src/openstack-requirements /src/octavia-tempest-plugin && \
+ git init /src/heat-tempest-plugin && \
+ (cd /src/heat-tempest-plugin && \
+ git fetch --tags https://git.openstack.org/openstack/heat-tempest-plugin.git $HEAT_TEMPEST_TAG && \
+ git checkout FETCH_HEAD) && \
+ update-requirements -s --source /src/openstack-requirements /src/heat-tempest-plugin && \
pip3 install --no-cache-dir --src /src -cupper-constraints.txt -cupper-constraints.opnfv.txt \
/src/patrole /src/barbican-tempest-plugin /src/neutron-tempest-plugin \
/src/cinder-tempest-plugin /src/keystone-tempest-plugin \
- /src/octavia-tempest-plugin && \
+ /src/octavia-tempest-plugin /src/heat-tempest-plugin && \
mkdir -p /home/opnfv/functest/data/refstack && \
mkdir -p /etc/neutron /etc/glance && \
wget -q -O /etc/glance/policy.json https://opendev.org/openstack/glance/raw/branch/$OPENSTACK_TAG/etc/policy.json && \
@@ -68,7 +74,7 @@ RUN apk --no-cache add --update libxml2 libxslt && \
rm -r oslo upper-constraints.txt upper-constraints.opnfv.txt \
/src/patrole /src/barbican-tempest-plugin /src/neutron-tempest-plugin \
/src/cinder-tempest-plugin /src/keystone-tempest-plugin \
- /src/octavia-tempest-plugin /src/neutron && \
+ /src/octavia-tempest-plugin /src/heat-tempest-plugin /src/neutron && \
apk del .build-deps
COPY compute.txt /home/opnfv/functest/data/refstack/compute.txt
COPY object.txt /home/opnfv/functest/data/refstack/object.txt
diff --git a/docker/smoke/testcases.yaml b/docker/smoke/testcases.yaml
index 72ba933cb..5b918991d 100644
--- a/docker/smoke/testcases.yaml
+++ b/docker/smoke/testcases.yaml
@@ -55,6 +55,21 @@ tiers:
- '--concurrency=3'
-
+ case_name: tempest_heat
+ project_name: functest
+ criteria: 100
+ blocking: false
+ description: >-
+ This test case runs the Tempest suite proposed by the
+ Heat project.
+ run:
+ name: tempest_heat
+ args:
+ mode: '^heat_tempest_plugin.tests'
+ option:
+ - '--concurrency=4'
+
+ -
case_name: rally_sanity
project_name: functest
criteria: 100
diff --git a/docs/release/release-notes/functest-release.rst b/docs/release/release-notes/functest-release.rst
index 0e34c3f5b..1d6df808c 100644
--- a/docs/release/release-notes/functest-release.rst
+++ b/docs/release/release-notes/functest-release.rst
@@ -38,6 +38,7 @@ The internal test cases are:
* neutron-tempest-plugin-api
* tempest_cinder
* tempest_keystone
+ * tempest_heat
* rally_sanity
* refstack_compute
* refstack_object
diff --git a/functest/ci/download_images.sh b/functest/ci/download_images.sh
index 219bcbb02..808f25858 100644
--- a/functest/ci/download_images.sh
+++ b/functest/ci/download_images.sh
@@ -14,4 +14,5 @@ https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloud
http://repository.cloudifysource.org/cloudify/19.01.24/community-release/cloudify-docker-manager-community-19.01.24.tar
http://testresults.opnfv.org/functest/vyos-1.1.8-amd64.qcow2
http://testresults.opnfv.org/functest/shaker-image-1.3.0+stretch.qcow2
+https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/30/Cloud/x86_64/images/Fedora-Cloud-Base-30-1.2.x86_64.qcow2
EOF
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml
index bcc8f4c45..a48b2c2a3 100644
--- a/functest/ci/testcases.yaml
+++ b/functest/ci/testcases.yaml
@@ -233,6 +233,21 @@ tiers:
- '--concurrency=3'
-
+ case_name: tempest_heat
+ project_name: functest
+ criteria: 100
+ blocking: false
+ description: >-
+ This test case runs the Tempest suite proposed by the
+ Heat project.
+ run:
+ name: tempest_heat
+ args:
+ mode: '^heat_tempest_plugin.tests'
+ option:
+ - '--concurrency=4'
+
+ -
case_name: rally_sanity
project_name: functest
criteria: 100
diff --git a/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml b/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml
index ea4563b0e..427bfe051 100644
--- a/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml
+++ b/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml
@@ -81,3 +81,8 @@ object-storage-feature-enabled:
tempurl,crossdomain,container_quotas,staticweb,account_quotas,slo"
object_versioning: true
discoverability: true
+heat_plugin:
+ skip_scenario_test_list: AodhAlarmTest,SoftwareConfigIntegrationTest
+ auth_version: 3
+heat_features_enabled:
+ multi_cloud: false
diff --git a/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf_ovn.yaml b/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf_ovn.yaml
index aa9340f3b..50a32a242 100644
--- a/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf_ovn.yaml
+++ b/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf_ovn.yaml
@@ -81,3 +81,8 @@ object-storage-feature-enabled:
tempurl,crossdomain,container_quotas,staticweb,account_quotas,slo"
object_versioning: true
discoverability: true
+heat_plugin:
+ skip_scenario_test_list: AodhAlarmTest,SoftwareConfigIntegrationTest
+ auth_version: 3
+heat_features_enabled:
+ multi_cloud: false
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index 6abc72f4f..eb1872567 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -676,3 +676,69 @@ class TempestHorizon(TempestCommon):
with open(self.conf_file, 'w') as config_file:
rconfig.write(config_file)
self.backup_tempest_config(self.conf_file, self.res_dir)
+
+
+class TempestHeat(TempestCommon):
+ """Tempest Heat testcase implementation class."""
+
+ filename_alt = ('/home/opnfv/functest/images/'
+ 'Fedora-Cloud-Base-30-1.2.x86_64.qcow2')
+ flavor_alt_ram = 512
+ flavor_alt_vcpus = 1
+ flavor_alt_disk = 4
+
+ def __init__(self, **kwargs):
+ super(TempestHeat, self).__init__(**kwargs)
+ self.user2 = self.orig_cloud.create_user(
+ name='{}-user2_{}'.format(self.case_name, self.project.guid),
+ password=self.project.password,
+ domain_id=self.project.domain.id)
+ if not self.orig_cloud.get_role("heat_stack_owner"):
+ self.role = self.orig_cloud.create_role("heat_stack_owner")
+ self.orig_cloud.grant_role(
+ "heat_stack_owner", user=self.user2.id,
+ project=self.project.project.id,
+ domain=self.project.domain.id)
+
+ def configure(self, **kwargs):
+ assert self.user2
+ super(TempestHeat, self).configure(**kwargs)
+ rconfig = configparser.RawConfigParser()
+ rconfig.read(self.conf_file)
+ if not rconfig.has_section('heat_plugin'):
+ rconfig.add_section('heat_plugin')
+ # It fails if region and domain ids are unset
+ rconfig.set(
+ 'heat_plugin', 'region',
+ os.environ.get('OS_REGION_NAME', 'RegionOne'))
+ rconfig.set('heat_plugin', 'auth_url', os.environ["OS_AUTH_URL"])
+ rconfig.set('heat_plugin', 'project_domain_id', self.project.domain.id)
+ rconfig.set('heat_plugin', 'user_domain_id', self.project.domain.id)
+ rconfig.set(
+ 'heat_plugin', 'project_domain_name', self.project.domain.name)
+ rconfig.set(
+ 'heat_plugin', 'user_domain_name', self.project.domain.name)
+ rconfig.set('heat_plugin', 'username', self.user2.name)
+ rconfig.set('heat_plugin', 'password', self.project.password)
+ rconfig.set('heat_plugin', 'project_name', self.project.project.name)
+ rconfig.set('heat_plugin', 'admin_username', self.project.user.name)
+ rconfig.set('heat_plugin', 'admin_password', self.project.password)
+ rconfig.set(
+ 'heat_plugin', 'admin_project_name', self.project.project.name)
+ rconfig.set('heat_plugin', 'image_ref', self.image_alt.id)
+ rconfig.set('heat_plugin', 'instance_type', self.flavor_alt.id)
+ rconfig.set('heat_plugin', 'minimal_image_ref', self.image.id)
+ rconfig.set('heat_plugin', 'minimal_instance_type', self.flavor.id)
+ rconfig.set('heat_plugin', 'floating_network_name', self.ext_net.name)
+ rconfig.set('heat_plugin', 'fixed_network_name', self.network.name)
+ with open(self.conf_file, 'w') as config_file:
+ rconfig.write(config_file)
+ self.backup_tempest_config(self.conf_file, self.res_dir)
+
+ def clean(self):
+ """
+ Cleanup all OpenStack objects. Should be called on completion.
+ """
+ super(TempestHeat, self).clean()
+ if self.user2:
+ self.orig_cloud.delete_user(self.user2.id)
diff --git a/setup.cfg b/setup.cfg
index fb2596510..9121930d2 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -28,6 +28,7 @@ xtesting.testcase =
tempest_common = functest.opnfv_tests.openstack.tempest.tempest:TempestCommon
tempest_scenario = functest.opnfv_tests.openstack.tempest.tempest:TempestScenario
tempest_horizon = functest.opnfv_tests.openstack.tempest.tempest:TempestHorizon
+ tempest_heat = functest.opnfv_tests.openstack.tempest.tempest:TempestHeat
rally_sanity = functest.opnfv_tests.openstack.rally.rally:RallySanity
refstack = functest.opnfv_tests.openstack.refstack.refstack:Refstack
patrole = functest.opnfv_tests.openstack.patrole.patrole:Patrole