From 6f643fc48690b0cdc3649f32e721221c7f0e9650 Mon Sep 17 00:00:00 2001 From: pritisarap12 Date: Fri, 19 Jun 2015 16:11:46 +0530 Subject: [PATCH] CLOUDSTACK-8574: Skip testcases including data disk creation for LXC if storagePool type is not RBD Signed-off-by: wilderrodrigues --- test/integration/component/test_stopped_vm.py | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/test/integration/component/test_stopped_vm.py b/test/integration/component/test_stopped_vm.py index de04d828d81..53a92bc3a51 100644 --- a/test/integration/component/test_stopped_vm.py +++ b/test/integration/component/test_stopped_vm.py @@ -19,7 +19,7 @@ """ # Import Local Modules from nose.plugins.attrib import attr -from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackTestCase import cloudstackTestCase,unittest from marvin.lib.utils import cleanup_resources from marvin.lib.base import (Account, VirtualMachine, @@ -36,7 +36,8 @@ from marvin.lib.common import (get_zone, get_domain, get_template, get_builtin_template_info, - update_resource_limit) + update_resource_limit, + find_storage_pool_type) from marvin.codes import PASS @@ -53,6 +54,13 @@ class TestDeployVM(cloudstackTestCase): cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.hypervisor = cls.testClient.getHypervisorInfo() + + 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.template = get_template( cls.api_client, cls.zone.id, @@ -743,6 +751,12 @@ class TestDeployHaEnabledVM(cloudstackTestCase): cls.testdata = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates + cls.hypervisor = cls.testClient.getHypervisorInfo() + + 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.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -946,6 +960,12 @@ class TestRouterStateAfterDeploy(cloudstackTestCase): cls.testdata = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates + cls.hypervisor = cls.testClient.getHypervisorInfo() + + 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.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -1102,6 +1122,12 @@ class TestDeployVMBasicZone(cloudstackTestCase): cls.testdata = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates + cls.hypervisor = cls.testClient.getHypervisorInfo() + + 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.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -1169,6 +1195,7 @@ class TestDeployVMFromTemplate(cloudstackTestCase): cls.api_client = cls.testClient.getApiClient() cls.testdata = cls.testClient.getParsedTestDataConfig() + # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -1297,6 +1324,7 @@ class TestVMAccountLimit(cloudstackTestCase): cls.api_client = cls.testClient.getApiClient() cls.testdata = cls.testClient.getParsedTestDataConfig() + # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -1419,6 +1447,12 @@ class TestUploadAttachVolume(cloudstackTestCase): cls.api_client = cls.testClient.getApiClient() cls.testdata = cls.testClient.getParsedTestDataConfig() + cls.hypervisor = cls.testClient.getHypervisorInfo() + + 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") + # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -1537,6 +1571,7 @@ class TestDeployOnSpecificHost(cloudstackTestCase): cls.api_client = cls.testClient.getApiClient() cls.testdata = cls.testClient.getParsedTestDataConfig() + # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())