CLOUDSTACK-8574: Skip testcases for LXC if storagePool type is not RBD

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #488
This commit is contained in:
pritisarap12 2015-06-23 11:33:21 +05:30 committed by wilderrodrigues
parent 6f643fc486
commit da72bb9aeb
1 changed files with 33 additions and 13 deletions

View File

@ -19,7 +19,7 @@
"""
# Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase,unittest
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.utils import cleanup_resources
from marvin.lib.base import (Account,
VirtualMachine,
@ -55,11 +55,12 @@ class TestDeployVM(cloudstackTestCase):
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
cls.hypervisor = cls.testClient.getHypervisorInfo()
cls.skip = False
if cls.hypervisor.lower() == 'lxc':
if not find_storage_pool_type(cls.apiclient, storagetype='rbd'):
raise unittest.SkipTest("RBD storage type is required for data volumes for LXC")
cls.skip = True
return
cls.template = get_template(
cls.api_client,
@ -92,6 +93,9 @@ class TestDeployVM(cloudstackTestCase):
def setUp(self):
if self.skip:
self.skipTest("RBD storage type is required for data volumes for LXC")
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.testdata["virtual_machine"]["zoneid"] = self.zone.id
@ -635,11 +639,11 @@ class TestDeployVM(cloudstackTestCase):
# 4. Stop the vm
# 5.list primary storages in the cluster , should be more than one
# 6.Migrate voluem to another available primary storage
self.hypervisor = self.testClient.getHypervisorInfo()
if self.hypervisor.lower() in ['lxc']:
self.skipTest(
"vm migrate is not supported in %s" %
self.hypervisor)
clusters = Cluster.list(
self.apiclient,
zoneid=self.zone.id
@ -752,10 +756,12 @@ class TestDeployHaEnabledVM(cloudstackTestCase):
cls.testdata = cls.testClient.getParsedTestDataConfig()
# Get Zone, Domain and templates
cls.hypervisor = cls.testClient.getHypervisorInfo()
cls.skip = False
if cls.hypervisor.lower() == 'lxc':
if not find_storage_pool_type(cls.apiclient, storagetype='rbd'):
raise unittest.SkipTest("RBD storage type is required for data volumes for LXC")
cls.skip = True
return
cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
@ -792,6 +798,9 @@ class TestDeployHaEnabledVM(cloudstackTestCase):
def setUp(self):
if self.skip:
self.skipTest("RBD storage type is required for data volumes for LXC ")
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.hypervisor = self.testClient.getHypervisorInfo()
@ -865,7 +874,6 @@ class TestDeployHaEnabledVM(cloudstackTestCase):
# 1. deployHA enabled Vm using ISO with the startvm parameter=true
# 2. listVM command should return the deployed VM. State of this VM
# should be "Running".
self.hypervisor = self.testClient.getHypervisorInfo()
if self.hypervisor.lower() in ['lxc']:
self.skipTest(
"vm deploy from ISO feature is not supported on %s" %
@ -923,10 +931,8 @@ class TestDeployHaEnabledVM(cloudstackTestCase):
# 1. deployHA enabled Vm using ISO with the startvm parameter=false
# 2. listVM command should return the deployed VM. State of this VM
# should be "Stopped".
self.hypervisor = self.testClient.getHypervisorInfo()
if self.hypervisor.lower() in ['lxc']:
self.skipTest(
"vm deploy from ISO feature is not supported on %s" %
self.skipTest("vm deploy from ISO feature is not supported on %s" %
self.hypervisor.lower())
self.debug("Deploying instance in the account: %s" %
@ -961,10 +967,12 @@ class TestRouterStateAfterDeploy(cloudstackTestCase):
cls.testdata = cls.testClient.getParsedTestDataConfig()
# Get Zone, Domain and templates
cls.hypervisor = cls.testClient.getHypervisorInfo()
cls.skip = False
if cls.hypervisor.lower() == 'lxc':
if not find_storage_pool_type(cls.apiclient, storagetype='rbd'):
raise unittest.SkipTest("RBD storage type is required for data volumes for LXC")
cls.skip = True
return
cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
@ -1000,6 +1008,9 @@ class TestRouterStateAfterDeploy(cloudstackTestCase):
def setUp(self):
if self.skip:
self.skipTest("RBD storage type is required for data volumes for LXC")
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.testdata["virtual_machine"]["zoneid"] = self.zone.id
@ -1123,10 +1134,12 @@ class TestDeployVMBasicZone(cloudstackTestCase):
cls.testdata = cls.testClient.getParsedTestDataConfig()
# Get Zone, Domain and templates
cls.hypervisor = cls.testClient.getHypervisorInfo()
cls.skip = False
if cls.hypervisor.lower() == 'lxc':
if not find_storage_pool_type(cls.apiclient, storagetype='rbd'):
raise unittest.SkipTest("RBD storage type is required for data volumes for LXC")
cls.skip = True
return
cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
@ -1162,6 +1175,9 @@ class TestDeployVMBasicZone(cloudstackTestCase):
def setUp(self):
if self.skip:
self.skipTest("RBD storage type is required for data volumes for LXC")
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.testdata["virtual_machine"]["zoneid"] = self.zone.id
@ -1448,10 +1464,11 @@ class TestUploadAttachVolume(cloudstackTestCase):
cls.testdata = cls.testClient.getParsedTestDataConfig()
cls.hypervisor = cls.testClient.getHypervisorInfo()
cls.skip = False
if cls.hypervisor.lower() == 'lxc':
if not find_storage_pool_type(cls.apiclient, storagetype='rbd'):
raise unittest.SkipTest("RBD storage type is required for data volumes for LXC")
cls.skip = True
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client)
@ -1491,6 +1508,9 @@ class TestUploadAttachVolume(cloudstackTestCase):
return
def setUp(self):
if self.skip:
self.skipTest("RBD storage type is required for data volumes for LXC")
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []