From 81e835841c9f63a5c6f5a7dc1ef0732493fce3d4 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Mon, 17 Sep 2012 16:54:23 +0100 Subject: [PATCH] heat tests : functional tests allow non-default stackname Allow the default "teststack" to be overridden, so multiple stacks can be created in one test Change-Id: I09a4128b98df7af6c6b85552ac2175919a697c50 Signed-off-by: Steven Hardy --- heat/tests/functional/util.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/heat/tests/functional/util.py b/heat/tests/functional/util.py index dcface9f..e104c1bd 100644 --- a/heat/tests/functional/util.py +++ b/heat/tests/functional/util.py @@ -41,10 +41,12 @@ from heat import client as heat_client from heat import boto_client as heat_client_boto from keystoneclient.v2_0 import client +DEFAULT_STACKNAME = 'teststack' + class Instance(object): - def __init__(self, instance_name): - self.name = 'teststack.%s' % instance_name + def __init__(self, instance_name, stackname=DEFAULT_STACKNAME): + self.name = '%s.%s' % (stackname, instance_name) # during nose test execution this file will be imported even if # the unit tag was specified @@ -63,7 +65,6 @@ class Instance(object): auth_url=os.environ['OS_AUTH_URL'], strategy=os.environ['OS_AUTH_STRATEGY']) dbusername = 'testuser' - stackname = 'teststack' # this test is in heat/tests/functional, so go up 3 dirs basepath = os.path.abspath( @@ -288,8 +289,9 @@ class Instance(object): class Stack(object): def __init__(self, template_file, distribution, arch, jeos_type, - stack_paramstr): + stack_paramstr, stackname=DEFAULT_STACKNAME): + self.stackname = stackname self.template_file = template_file self.distribution = distribution self.stack_paramstr = stack_paramstr @@ -368,7 +370,6 @@ class Stack(object): auth_url=os.environ['OS_AUTH_URL'], strategy=os.environ['OS_AUTH_STRATEGY']) dbusername = 'testuser' - stackname = 'teststack' # this test is in heat/tests/functional, so go up 3 dirs basepath = os.path.abspath( -- 2.45.2