From: Steven Hardy Date: Mon, 17 Sep 2012 15:54:23 +0000 (+0100) Subject: heat tests : functional tests allow non-default stackname X-Git-Tag: 2014.1~1401 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=81e835841c9f63a5c6f5a7dc1ef0732493fce3d4;p=openstack-build%2Fheat-build.git 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 --- 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(