From b57d248b39f4d8cd9660c4df5f1d2f22ba26edf6 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Mon, 18 Jun 2018 16:59:52 -0400 Subject: [PATCH] Move Octavia tests to scenario tests The Octavia test is similar to the other scenario tests and is currently the only 'functional' test to use external templates. Make it a scenario test for consistency, and also so that we can remove the _load_template() method from the HeatIntegrationTest base class. Change-Id: Ifaa5b45c96e6e8125b8ba36a349a07b0355b6077 Story: #1739447 Task: 22221 --- .../templates/lb_member.yaml | 0 .../templates/octavia_lbaas.yaml | 0 .../test_octavia_lbaas.py | 22 ++++++------------- 3 files changed, 7 insertions(+), 15 deletions(-) rename heat_tempest_plugin/tests/{functional => scenario}/templates/lb_member.yaml (100%) rename heat_tempest_plugin/tests/{functional => scenario}/templates/octavia_lbaas.yaml (100%) rename heat_tempest_plugin/tests/{functional => scenario}/test_octavia_lbaas.py (82%) diff --git a/heat_tempest_plugin/tests/functional/templates/lb_member.yaml b/heat_tempest_plugin/tests/scenario/templates/lb_member.yaml similarity index 100% rename from heat_tempest_plugin/tests/functional/templates/lb_member.yaml rename to heat_tempest_plugin/tests/scenario/templates/lb_member.yaml diff --git a/heat_tempest_plugin/tests/functional/templates/octavia_lbaas.yaml b/heat_tempest_plugin/tests/scenario/templates/octavia_lbaas.yaml similarity index 100% rename from heat_tempest_plugin/tests/functional/templates/octavia_lbaas.yaml rename to heat_tempest_plugin/tests/scenario/templates/octavia_lbaas.yaml diff --git a/heat_tempest_plugin/tests/functional/test_octavia_lbaas.py b/heat_tempest_plugin/tests/scenario/test_octavia_lbaas.py similarity index 82% rename from heat_tempest_plugin/tests/functional/test_octavia_lbaas.py rename to heat_tempest_plugin/tests/scenario/test_octavia_lbaas.py index b1e500c..67afadc 100644 --- a/heat_tempest_plugin/tests/functional/test_octavia_lbaas.py +++ b/heat_tempest_plugin/tests/scenario/test_octavia_lbaas.py @@ -13,11 +13,11 @@ from tempest.lib import decorators from heat_tempest_plugin.common import test -from heat_tempest_plugin.tests.functional import functional_base +from heat_tempest_plugin.tests.scenario import scenario_base @test.requires_resource_type('OS::Octavia::LoadBalancer') -class LoadBalancerTest(functional_base.FunctionalTestsBase): +class LoadBalancerTest(scenario_base.ScenarioTestsBase): def setUp(self): super(LoadBalancerTest, self).setUp() self.template_name = 'octavia_lbaas.yaml' @@ -36,11 +36,9 @@ class LoadBalancerTest(functional_base.FunctionalTestsBase): ) self.files = {'lb_member.yaml': member_template} self.env = {'resource_registry': { - 'OS::Test::PoolMember': 'lb_member.yaml'}} + 'OS::Test::PoolMember': self.member_template_name}} - self.template = self._load_template(__file__, self.template_name, - self.sub_dir) - return self.stack_create(template=self.template, + return self.launch_stack(self.template_name, parameters=self.parameters, files=self.files, environment=self.env) @@ -54,10 +52,8 @@ class LoadBalancerTest(functional_base.FunctionalTestsBase): self.parameters['lb_algorithm'] = 'SOURCE_IP' self.update_stack(stack_identifier, - template=self.template, parameters=self.parameters, - files=self.files, - environment=self.env) + existing=True) stack = self.client.stacks.get(stack_identifier) output = self._stack_output(stack, 'loadbalancer') @@ -76,10 +72,8 @@ class LoadBalancerTest(functional_base.FunctionalTestsBase): # add pool member self.parameters['member_count'] = 2 self.update_stack(stack_identifier, - template=self.template, parameters=self.parameters, - files=self.files, - environment=self.env) + existing=True) stack = self.client.stacks.get(stack_identifier) output = self._stack_output(stack, 'loadbalancer') @@ -89,10 +83,8 @@ class LoadBalancerTest(functional_base.FunctionalTestsBase): # delete pool member self.parameters['member_count'] = 1 self.update_stack(stack_identifier, - template=self.template, parameters=self.parameters, - files=self.files, - environment=self.env) + existing=True) stack = self.client.stacks.get(stack_identifier) output = self._stack_output(stack, 'loadbalancer')