Skip to content

Commit 21819da

Browse files
author
Prasanna Santhanam
committed
Summary: Devcloud tests for vm life cycle
Detail: VM Life cycle tests needed minor changes to run them against a devcloud - basic zone, local storage envrioment. Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1354760111 -0800
1 parent 7ce2227 commit 21819da

3 files changed

Lines changed: 36 additions & 12 deletions

File tree

test/integration/smoke/test_vm_life_cycle.py

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(self):
9090
"displaytext": "Small Instance",
9191
"cpunumber": 1,
9292
"cpuspeed": 100,
93-
"memory": 256
93+
"memory": 256,
9494
},
9595
"medium":
9696
{
@@ -100,7 +100,7 @@ def __init__(self):
100100
"displaytext": "Medium Instance",
101101
"cpunumber": 1,
102102
"cpuspeed": 100,
103-
"memory": 256
103+
"memory": 256,
104104
}
105105
},
106106
"iso": # ISO settings for Attach/Detach ISO tests
@@ -125,7 +125,6 @@ def __init__(self):
125125
#Migrate VM to hostid
126126
"ostype": 'CentOS 5.3 (64-bit)',
127127
# CentOS 5.3 (64-bit)
128-
"mode":'advanced',
129128
}
130129

131130

@@ -139,6 +138,14 @@ def setUp(self):
139138
# Get Zone, Domain and templates
140139
domain = get_domain(self.apiclient, self.services)
141140
zone = get_zone(self.apiclient, self.services)
141+
self.services['mode'] = zone.networktype
142+
143+
#if local storage is enabled, alter the offerings to use localstorage
144+
#this step is needed for devcloud
145+
if zone.localstorageenabled == True:
146+
self.services["service_offerings"]["tiny"]["storagetype"] = 'local'
147+
self.services["service_offerings"]["small"]["storagetype"] = 'local'
148+
self.services["service_offerings"]["medium"]["storagetype"] = 'local'
142149

143150
template = get_template(
144151
self.apiclient,
@@ -170,7 +177,7 @@ def setUp(self):
170177
self.account
171178
]
172179

173-
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"])
180+
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"])
174181
def test_deploy_vm(self):
175182
"""Test Deploy Virtual Machine
176183
"""
@@ -185,7 +192,8 @@ def test_deploy_vm(self):
185192
self.services["small"],
186193
accountid=self.account.account.name,
187194
domainid=self.account.account.domainid,
188-
serviceofferingid=self.service_offering.id
195+
serviceofferingid=self.service_offering.id,
196+
mode=self.services['mode']
189197
)
190198

191199
list_vm_response = list_virtual_machines(
@@ -242,6 +250,15 @@ def setUpClass(cls):
242250
# Get Zone, Domain and templates
243251
domain = get_domain(cls.api_client, cls.services)
244252
zone = get_zone(cls.api_client, cls.services)
253+
cls.services['mode'] = zone.networktype
254+
255+
#if local storage is enabled, alter the offerings to use localstorage
256+
#this step is needed for devcloud
257+
if zone.localstorageenabled == True:
258+
cls.services["service_offerings"]["tiny"]["storagetype"] = 'local'
259+
cls.services["service_offerings"]["small"]["storagetype"] = 'local'
260+
cls.services["service_offerings"]["medium"]["storagetype"] = 'local'
261+
245262
template = get_template(
246263
cls.api_client,
247264
zone.id,
@@ -319,7 +336,7 @@ def tearDown(self):
319336
return
320337

321338

322-
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"])
339+
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"])
323340
def test_01_stop_vm(self):
324341
"""Test Stop Virtual Machine
325342
"""
@@ -355,7 +372,7 @@ def test_01_stop_vm(self):
355372
)
356373
return
357374

358-
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"])
375+
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"])
359376
def test_02_start_vm(self):
360377
"""Test Start Virtual Machine
361378
"""
@@ -393,7 +410,7 @@ def test_02_start_vm(self):
393410
)
394411
return
395412

396-
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"])
413+
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"])
397414
def test_03_reboot_vm(self):
398415
"""Test Reboot Virtual Machine
399416
"""
@@ -669,7 +686,7 @@ def test_05_change_offering_medium(self):
669686
)
670687
return
671688

672-
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"])
689+
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"])
673690
def test_06_destroy_vm(self):
674691
"""Test destroy Virtual Machine
675692
"""
@@ -705,7 +722,7 @@ def test_06_destroy_vm(self):
705722
)
706723
return
707724

708-
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"])
725+
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"])
709726
def test_07_restore_vm(self):
710727
"""Test recover Virtual Machine
711728
"""
@@ -818,7 +835,7 @@ def test_08_migrate_vm(self):
818835

819836
@attr(configuration = "expunge.interval")
820837
@attr(configuration = "expunge.delay")
821-
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"])
838+
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"])
822839
def test_09_expunge_vm(self):
823840
"""Test destroy(expunge) Virtual Machine
824841
"""

tools/marvin/marvin/integration/lib/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,7 @@ def create(cls, apiclient, services, domainid=None, **kwargs):
10391039
cmd.displaytext = services["displaytext"]
10401040
cmd.memory = services["memory"]
10411041
cmd.name = services["name"]
1042+
cmd.storagetype = services["storagetype"]
10421043

10431044
# Service Offering private to that domain
10441045
if domainid:

tools/marvin/marvin/setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
# under the License.
1717

1818
import os
19-
from setuptools import setup
19+
try:
20+
from setuptools import setup, find_packages
21+
except ImportError:
22+
from distribute_setup import use_setuptools
23+
use_setuptools()
24+
from setuptools import setup, find_packages
25+
2026

2127
def read(fname):
2228
return open(os.path.join(os.path.dirname(__file__), fname)).read().strip()

0 commit comments

Comments
 (0)