From 7471d1bcfc80864ee4e9ca9ad3b8ad10868a3cdc Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Mon, 9 Jan 2017 15:17:31 +0100 Subject: [PATCH] tempest: use tempest img glance_image_create() must be called to upload the scenario-img to glance. Since we upload it ourself, just use this one. Change-Id: I030315796e68a9851f7a94b01a1e2cc8ac0a87ef --- .../tempest/scenario/test_autoscaling.py | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/ceilometer/tests/tempest/scenario/test_autoscaling.py b/ceilometer/tests/tempest/scenario/test_autoscaling.py index bed56c38ed..e9b5ba0f40 100644 --- a/ceilometer/tests/tempest/scenario/test_autoscaling.py +++ b/ceilometer/tests/tempest/scenario/test_autoscaling.py @@ -15,20 +15,11 @@ import unittest from gabbi import driver from tempest import config -from tempest import test - -from ceilometer.tests.tempest.service import client +from tempest.scenario import manager -class ClientManager(client.Manager): - load_clients = [ - 'image_client_v2', - ] - - -class TestAutoscalingGabbi(test.BaseTestCase): - credentials = ['admin'] - client_manager = ClientManager +class TestAutoscalingGabbi(manager.ScenarioTest): + credentials = ['admin', 'primary'] @classmethod def skip_checks(cls): @@ -63,17 +54,6 @@ class TestAutoscalingGabbi(test.BaseTestCase): auth, "orchestration") os.environ["NOVA_SERVICE_URL"] = cls._get_endpoint_for(auth, "compute") os.environ["GLANCE_SERVICE_URL"] = cls._get_endpoint_for(auth, "image") - images = cls.os_admin.image_client_v2.list_images()["images"] - for img in images: - name = img["name"] - # devstack or tempest format - if ((name.startswith("cirros") and name.endswith("-uec")) or - name == 'scenario-img'): - os.environ["GLANCE_IMAGE_NAME"] = name - break - - else: - cls.skipException("A cirros-.*-uec/cirros image is required") @staticmethod def clear_credentials(): @@ -85,6 +65,7 @@ class TestAutoscalingGabbi(test.BaseTestCase): def run(self, result=None): self.setUp() + os.environ["GLANCE_IMAGE_NAME"] = self.glance_image_create() try: self.tests.run(result) finally: