Skip to content

Commit e47b38b

Browse files
DaanHooglandDaan Hoogland
authored andcommitted
some component tests fixes (apache#5442)
* allow 3 hosts or more * make numbering consistent * stray TODO removed Co-authored-by: Daan Hoogland <dahn@onecht.net>
1 parent 38a0abb commit e47b38b

File tree

3 files changed

+19
-38
lines changed

3 files changed

+19
-38
lines changed

test/integration/broken/test_vpc_vm_life_cycle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from component.test_vpc_vm_life_cycle import Services
2020

2121

22-
class TestVMLifeCycleSharedNwVPC(cloudstackTesTODOtCase):
22+
class TestVMLifeCycleSharedNwVPC(cloudstackTestCase):
2323

2424
@classmethod
2525
def setUpClass(cls):

test/integration/component/test_host_ha.py

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,19 @@
1717
""" BVT tests for Hosts Maintenance
1818
"""
1919

20-
# Import Local Modules
21-
from marvin.codes import FAILED
2220
from marvin.cloudstackTestCase import *
23-
from marvin.cloudstackAPI import *
2421
from marvin.lib.utils import *
2522
from marvin.lib.base import *
2623
from marvin.lib.common import *
2724
from nose.plugins.attrib import attr
2825

29-
from time import sleep
30-
3126
_multiprocess_shared_ = False
3227

3328

3429
class TestHostHA(cloudstackTestCase):
3530

31+
hostCountMsg = "Host HA can be tested with at least two hosts, only %s found"
32+
3633
def setUp(self):
3734
self.logger = logging.getLogger('TestHM')
3835
self.stream_handler = logging.StreamHandler()
@@ -86,17 +83,8 @@ def setUp(self):
8683
"timeout": 10,
8784
}
8885

89-
9086
def tearDown(self):
91-
try:
92-
# Clean up, terminate the created templates
93-
cleanup_resources(self.apiclient, self.cleanup)
94-
95-
except Exception as e:
96-
raise Exception("Warning: Exception during cleanup : %s" % e)
97-
98-
return
99-
87+
super(TestHostHA, self).tearDown()
10088

10189
def createVMs(self, hostId, number, local):
10290

@@ -319,19 +307,16 @@ def test_01_host_ha_with_nfs_storagepool_with_vm(self):
319307
for host in listHost:
320308
self.logger.debug('Hypervisor = {}'.format(host.id))
321309

322-
323-
if len(listHost) != 2:
324-
self.logger.debug("Host HA can be tested with two host only %s, found" % len(listHost))
325-
raise unittest.SkipTest("Host HA can be tested with two host only %s, found" % len(listHost))
326-
310+
if len(listHost) < 2:
311+
self.logger.debug(self.hostCountMsg % len(listHost))
312+
raise unittest.SkipTest(self.hostCountMsg % len(listHost))
327313

328314
no_of_vms = self.noOfVMsOnHost(listHost[0].id)
329315

330316
no_of_vms = no_of_vms + self.noOfVMsOnHost(listHost[1].id)
331317

332318
self.logger.debug("Number of VMS on hosts = %s" % no_of_vms)
333319

334-
335320
if no_of_vms < 5:
336321
self.logger.debug("test_01: Create VMs as there are not enough vms to check host ha")
337322
no_vm_req = 5 - no_of_vms
@@ -396,10 +381,9 @@ def test_02_host_ha_with_local_storage_and_nfs(self):
396381
for host in listHost:
397382
self.logger.debug('Hypervisor = {}'.format(host.id))
398383

399-
400-
if len(listHost) != 2:
401-
self.logger.debug("Host HA can be tested with two host only %s, found" % len(listHost))
402-
raise unittest.SkipTest("Host HA can be tested with two host only %s, found" % len(listHost))
384+
if len(listHost) < 2:
385+
self.logger.debug(self.hostCountMsg % len(listHost))
386+
raise unittest.SkipTest(self.hostCountMsg % len(listHost))
403387

404388
no_of_vms = self.noOfVMsOnHost(listHost[0].id)
405389

@@ -473,10 +457,9 @@ def test_03_host_ha_with_only_local_storage(self):
473457
for host in listHost:
474458
self.logger.debug('Hypervisor = {}'.format(host.id))
475459

476-
477-
if len(listHost) != 2:
478-
self.logger.debug("Host HA can be tested with two host only %s, found" % len(listHost))
479-
raise unittest.SkipTest("Host HA can be tested with two host only %s, found" % len(listHost))
460+
if len(listHost) < 2:
461+
self.logger.debug(self.hostCountMsg % len(listHost))
462+
raise unittest.SkipTest(self.hostCountMsg % len(listHost))
480463

481464
no_of_vms = self.noOfVMsOnHost(listHost[0].id)
482465

@@ -548,18 +531,16 @@ def test_04_host_ha_vmactivity_check(self):
548531
for host in listHost:
549532
self.logger.debug('Hypervisor = {}'.format(host.id))
550533

551-
552-
if len(listHost) != 2:
553-
self.logger.debug("Host HA can be tested with two host only %s, found" % len(listHost))
554-
raise unittest.SkipTest("Host HA can be tested with two host only %s, found" % len(listHost))
534+
if len(listHost) < 2:
535+
self.logger.debug(self.hostCountMsg % len(listHost))
536+
raise unittest.SkipTest(self.hostCountMsg % len(listHost))
555537

556538
no_of_vms = self.noOfVMsOnHost(listHost[0].id)
557539

558540
no_of_vms = no_of_vms + self.noOfVMsOnHost(listHost[1].id)
559541

560542
self.logger.debug("Number of VMS on hosts = %s" % no_of_vms)
561543

562-
563544
if no_of_vms < 5:
564545
self.logger.debug("test_01: Create VMs as there are not enough vms to check host ha")
565546
no_vm_req = 5 - no_of_vms

test/integration/component/test_rootvolume_resize.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ def test_04_vmreset_after_migrate_vm__rootvolume_resized(self):
773773
return
774774

775775
@attr(tags=["advanced"], required_hardware="true")
776-
def test_5_vmdeployment_with_size(self):
776+
def test_05_vmdeployment_with_size(self):
777777
"""Test vm deployment with new rootdisk size parameter
778778
779779
# Validate the following
@@ -855,7 +855,7 @@ def test_5_vmdeployment_with_size(self):
855855

856856

857857
@attr(tags=["advanced"], required_hardware="true")
858-
def test_6_resized_rootvolume_with_lessvalue(self):
858+
def test_06_resized_rootvolume_with_lessvalue(self):
859859
"""Test resize root volume with less than original volume size
860860
861861
# Validate the following
@@ -939,7 +939,7 @@ def test_6_resized_rootvolume_with_lessvalue(self):
939939

940940
# @attr(tags=["advanced"], required_hrdware="true")
941941
@attr(tags=["TODO"], required_hrdware="true")
942-
def test_7_usage_events_after_rootvolume_resized_(self):
942+
def test_07_usage_events_after_rootvolume_resized_(self):
943943
"""Test check usage events after root volume resize
944944
945945
# Validate the following

0 commit comments

Comments
 (0)