Skip to content

Commit 4f3f0f5

Browse files
utchoangsureshanaparti
authored andcommitted
Revert "some component tests fixes (apache#5442)"
This reverts commit bfe1697.
1 parent 92b24f9 commit 4f3f0f5

File tree

3 files changed

+38
-19
lines changed

3 files changed

+38
-19
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(cloudstackTestCase):
22+
class TestVMLifeCycleSharedNwVPC(cloudstackTesTODOtCase):
2323

2424
@classmethod
2525
def setUpClass(cls):

test/integration/component/test_host_ha.py

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

20+
# Import Local Modules
21+
from marvin.codes import FAILED
2022
from marvin.cloudstackTestCase import *
23+
from marvin.cloudstackAPI import *
2124
from marvin.lib.utils import *
2225
from marvin.lib.base import *
2326
from marvin.lib.common import *
2427
from nose.plugins.attrib import attr
2528

29+
from time import sleep
30+
2631
_multiprocess_shared_ = False
2732

2833

2934
class TestHostHA(cloudstackTestCase):
3035

31-
hostCountMsg = "Host HA can be tested with at least two hosts, only %s found"
32-
3336
def setUp(self):
3437
self.logger = logging.getLogger('TestHM')
3538
self.stream_handler = logging.StreamHandler()
@@ -83,8 +86,17 @@ def setUp(self):
8386
"timeout": 10,
8487
}
8588

89+
8690
def tearDown(self):
87-
super(TestHostHA, self).tearDown()
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+
88100

89101
def createVMs(self, hostId, number, local):
90102

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

310-
if len(listHost) < 2:
311-
self.logger.debug(self.hostCountMsg % len(listHost))
312-
raise unittest.SkipTest(self.hostCountMsg % len(listHost))
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+
313327

314328
no_of_vms = self.noOfVMsOnHost(listHost[0].id)
315329

316330
no_of_vms = no_of_vms + self.noOfVMsOnHost(listHost[1].id)
317331

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

334+
320335
if no_of_vms < 5:
321336
self.logger.debug("test_01: Create VMs as there are not enough vms to check host ha")
322337
no_vm_req = 5 - no_of_vms
@@ -381,9 +396,10 @@ def test_02_host_ha_with_local_storage_and_nfs(self):
381396
for host in listHost:
382397
self.logger.debug('Hypervisor = {}'.format(host.id))
383398

384-
if len(listHost) < 2:
385-
self.logger.debug(self.hostCountMsg % len(listHost))
386-
raise unittest.SkipTest(self.hostCountMsg % len(listHost))
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))
387403

388404
no_of_vms = self.noOfVMsOnHost(listHost[0].id)
389405

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

460-
if len(listHost) < 2:
461-
self.logger.debug(self.hostCountMsg % len(listHost))
462-
raise unittest.SkipTest(self.hostCountMsg % len(listHost))
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))
463480

464481
no_of_vms = self.noOfVMsOnHost(listHost[0].id)
465482

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

534-
if len(listHost) < 2:
535-
self.logger.debug(self.hostCountMsg % len(listHost))
536-
raise unittest.SkipTest(self.hostCountMsg % len(listHost))
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))
537555

538556
no_of_vms = self.noOfVMsOnHost(listHost[0].id)
539557

540558
no_of_vms = no_of_vms + self.noOfVMsOnHost(listHost[1].id)
541559

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

562+
544563
if no_of_vms < 5:
545564
self.logger.debug("test_01: Create VMs as there are not enough vms to check host ha")
546565
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_05_vmdeployment_with_size(self):
776+
def test_5_vmdeployment_with_size(self):
777777
"""Test vm deployment with new rootdisk size parameter
778778
779779
# Validate the following
@@ -855,7 +855,7 @@ def test_05_vmdeployment_with_size(self):
855855

856856

857857
@attr(tags=["advanced"], required_hardware="true")
858-
def test_06_resized_rootvolume_with_lessvalue(self):
858+
def test_6_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_06_resized_rootvolume_with_lessvalue(self):
939939

940940
# @attr(tags=["advanced"], required_hrdware="true")
941941
@attr(tags=["TODO"], required_hrdware="true")
942-
def test_07_usage_events_after_rootvolume_resized_(self):
942+
def test_7_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)