Skip to content

Commit b728e23

Browse files
committed
Marvin: Register template
1 parent 41fcf43 commit b728e23

2 files changed

Lines changed: 25 additions & 8 deletions

File tree

test/integration/component/test_configdrive.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
Hypervisor, Template)
5353
from marvin.lib.common import (get_domain,
5454
get_template,
55-
get_zone)
55+
get_zone, get_test_template)
5656
from marvin.lib.utils import random_gen
5757
# Import System Modules
5858
from nose.plugins.attrib import attr
@@ -100,6 +100,19 @@ class Services:
100100

101101
def __init__(self):
102102
self.services = {
103+
"test_templates": {
104+
"kvm": {
105+
"name": "Centos-5.5-configdrive",
106+
"displaytext": "ConfigDrive enabled CentOS",
107+
"format": "qcow2",
108+
"hypervisor": "kvm",
109+
"ostype": "CentOS 5.5 (64-bit)",
110+
"url": "http://people.apache.org/~fmaximus/centos55-extended.qcow2.bz2",
111+
"requireshvm": "False",
112+
"ispublic": "True",
113+
"isextractable": "True"
114+
}
115+
},
103116
"vpc_offering_configdrive": {
104117
"name": 'VPC offering ConfigDrive',
105118
"displaytext": 'VPC offering ConfigDrive',
@@ -1144,17 +1157,19 @@ def setUpClass(cls):
11441157
cls.api_client = test_client.getApiClient()
11451158
cls.db_client = test_client.getDbConnection()
11461159
cls.test_data = test_client.getParsedTestDataConfig()
1160+
cls.test_data.update(Services().services)
11471161

11481162
# Get Zone, Domain and templates
11491163
cls.zone = get_zone(cls.api_client)
11501164
cls.domain = get_domain(cls.api_client)
1151-
cls.template = get_template(cls.api_client,
1152-
cls.zone.id,
1153-
cls.test_data["ostype"]
1154-
)
1165+
1166+
cls.hypervisor = cls.testClient.getHypervisorInfo()
1167+
cls.template = get_test_template(cls.api_client,
1168+
cls.zone.id,
1169+
cls.hypervisor,
1170+
cls.test_data["test_templates"])
11551171
cls.test_data["virtual_machine"]["zoneid"] = cls.zone.id
11561172
cls.test_data["virtual_machine"]["template"] = cls.template.id
1157-
cls.test_data.update(Services().services)
11581173

11591174
# Create service offering
11601175
cls.service_offering = ServiceOffering.create(

tools/marvin/marvin/lib/common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,16 @@ def get_template(
345345
return list_templatesout[0]
346346

347347

348-
def get_test_template(apiclient, zone_id=None, hypervisor=None):
348+
def get_test_template(apiclient, zone_id=None, hypervisor=None, test_templates=None):
349349
"""
350350
@Name : get_test_template
351351
@Desc : Retrieves the test template used to running tests. When the template
352352
is missing it will be download at most one in a zone for a hypervisor.
353353
@Input : returns a template
354354
"""
355-
test_templates = test_data["test_templates"]
355+
356+
if test_templates is None:
357+
test_templates = test_data["test_templates"]
356358

357359
if hypervisor is None:
358360
return FAILED

0 commit comments

Comments
 (0)