-
Notifications
You must be signed in to change notification settings - Fork 1.2k
some component tests fixes #5442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,22 +17,19 @@ | |
| """ BVT tests for Hosts Maintenance | ||
| """ | ||
|
|
||
| # Import Local Modules | ||
| from marvin.codes import FAILED | ||
| from marvin.cloudstackTestCase import * | ||
| from marvin.cloudstackAPI import * | ||
| from marvin.lib.utils import * | ||
| from marvin.lib.base import * | ||
| from marvin.lib.common import * | ||
| from nose.plugins.attrib import attr | ||
|
|
||
| from time import sleep | ||
|
|
||
| _multiprocess_shared_ = False | ||
|
|
||
|
|
||
| class TestHostHA(cloudstackTestCase): | ||
|
|
||
| hostCountMsg = "Host HA can be tested with at least two hosts, only %s found" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not related but - isn't this VM HA? (not host HA with ipmi etc?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no? this is test_host_ha, is it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Tests are host ha indeed! |
||
|
|
||
| def setUp(self): | ||
| self.logger = logging.getLogger('TestHM') | ||
| self.stream_handler = logging.StreamHandler() | ||
|
|
@@ -86,17 +83,8 @@ def setUp(self): | |
| "timeout": 10, | ||
| } | ||
|
|
||
|
|
||
| def tearDown(self): | ||
| try: | ||
| # Clean up, terminate the created templates | ||
| cleanup_resources(self.apiclient, self.cleanup) | ||
|
|
||
| except Exception as e: | ||
| raise Exception("Warning: Exception during cleanup : %s" % e) | ||
|
|
||
| return | ||
|
|
||
| super(TestHostHA, self).tearDown() | ||
|
|
||
| def createVMs(self, hostId, number, local): | ||
|
|
||
|
|
@@ -319,19 +307,16 @@ def test_01_host_ha_with_nfs_storagepool_with_vm(self): | |
| for host in listHost: | ||
| self.logger.debug('Hypervisor = {}'.format(host.id)) | ||
|
|
||
|
|
||
| if len(listHost) != 2: | ||
| self.logger.debug("Host HA can be tested with two host only %s, found" % len(listHost)) | ||
| raise unittest.SkipTest("Host HA can be tested with two host only %s, found" % len(listHost)) | ||
|
|
||
| if len(listHost) < 2: | ||
| self.logger.debug(self.hostCountMsg % len(listHost)) | ||
| raise unittest.SkipTest(self.hostCountMsg % len(listHost)) | ||
|
|
||
| no_of_vms = self.noOfVMsOnHost(listHost[0].id) | ||
|
|
||
| no_of_vms = no_of_vms + self.noOfVMsOnHost(listHost[1].id) | ||
|
|
||
| self.logger.debug("Number of VMS on hosts = %s" % no_of_vms) | ||
|
|
||
|
|
||
| if no_of_vms < 5: | ||
| self.logger.debug("test_01: Create VMs as there are not enough vms to check host ha") | ||
| no_vm_req = 5 - no_of_vms | ||
|
|
@@ -396,10 +381,9 @@ def test_02_host_ha_with_local_storage_and_nfs(self): | |
| for host in listHost: | ||
| self.logger.debug('Hypervisor = {}'.format(host.id)) | ||
|
|
||
|
|
||
| if len(listHost) != 2: | ||
| self.logger.debug("Host HA can be tested with two host only %s, found" % len(listHost)) | ||
| raise unittest.SkipTest("Host HA can be tested with two host only %s, found" % len(listHost)) | ||
| if len(listHost) < 2: | ||
| self.logger.debug(self.hostCountMsg % len(listHost)) | ||
| raise unittest.SkipTest(self.hostCountMsg % len(listHost)) | ||
|
|
||
| no_of_vms = self.noOfVMsOnHost(listHost[0].id) | ||
|
|
||
|
|
@@ -473,10 +457,9 @@ def test_03_host_ha_with_only_local_storage(self): | |
| for host in listHost: | ||
| self.logger.debug('Hypervisor = {}'.format(host.id)) | ||
|
|
||
|
|
||
| if len(listHost) != 2: | ||
| self.logger.debug("Host HA can be tested with two host only %s, found" % len(listHost)) | ||
| raise unittest.SkipTest("Host HA can be tested with two host only %s, found" % len(listHost)) | ||
| if len(listHost) < 2: | ||
| self.logger.debug(self.hostCountMsg % len(listHost)) | ||
| raise unittest.SkipTest(self.hostCountMsg % len(listHost)) | ||
|
|
||
| no_of_vms = self.noOfVMsOnHost(listHost[0].id) | ||
|
|
||
|
|
@@ -548,18 +531,16 @@ def test_04_host_ha_vmactivity_check(self): | |
| for host in listHost: | ||
| self.logger.debug('Hypervisor = {}'.format(host.id)) | ||
|
|
||
|
|
||
| if len(listHost) != 2: | ||
| self.logger.debug("Host HA can be tested with two host only %s, found" % len(listHost)) | ||
| raise unittest.SkipTest("Host HA can be tested with two host only %s, found" % len(listHost)) | ||
| if len(listHost) < 2: | ||
| self.logger.debug(self.hostCountMsg % len(listHost)) | ||
| raise unittest.SkipTest(self.hostCountMsg % len(listHost)) | ||
|
|
||
| no_of_vms = self.noOfVMsOnHost(listHost[0].id) | ||
|
|
||
| no_of_vms = no_of_vms + self.noOfVMsOnHost(listHost[1].id) | ||
|
|
||
| self.logger.debug("Number of VMS on hosts = %s" % no_of_vms) | ||
|
|
||
|
|
||
| if no_of_vms < 5: | ||
| self.logger.debug("test_01: Create VMs as there are not enough vms to check host ha") | ||
| no_vm_req = 5 - no_of_vms | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file ready to be moved out of the 'broken' directory?