CLOUDSTACK-7727 Skip various BVT tests on LXC

A number of BVT tests are not valid for LXC (e.g. migrating a VM), so this patch
ensures they skip if LXC is in use.

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
Alex Brett 2014-10-15 18:50:57 +01:00 committed by SrikanteswaraRao Talluri
parent 1f8cf0bee4
commit 20d3cf1acc
6 changed files with 23 additions and 13 deletions

View File

@ -154,8 +154,8 @@ class TestPrimaryStorageServices(cloudstackTestCase):
"""Test primary storage pools - XEN. Not Supported for kvm,hyperv,vmware
"""
if self.hypervisor.lower() in ["kvm","hyperv", "vmware"]:
raise self.skipTest("iscsi primary storage not supported on kvm, VMWare or Hyper-V")
if self.hypervisor.lower() in ["kvm","hyperv", "vmware", "lxc"]:
raise self.skipTest("iscsi primary storage not supported on kvm, VMWare, Hyper-V, or LXC")
# Validate the following:
# 1. List Clusters

View File

@ -35,8 +35,8 @@ class TestScaleVm(cloudstackTestCase):
cls.apiclient = testClient.getApiClient()
cls.services = testClient.getParsedTestDataConfig()
cls.hypervisor = cls.testClient.getHypervisorInfo()
if cls.hypervisor.lower() in ('kvm', 'hyperv'):
raise unittest.SkipTest("ScaleVM is not supported on KVM or Hyper-V. Hence, skipping the test")
if cls.hypervisor.lower() in ('kvm', 'hyperv', 'lxc'):
raise unittest.SkipTest("ScaleVM is not supported on KVM, Hyper-V or LXC. Hence, skipping the test")
# Get Zone, Domain and templates
domain = get_domain(cls.apiclient)

View File

@ -37,8 +37,8 @@ class TestSnapshotRootDisk(cloudstackTestCase):
cls.services['mode'] = cls.zone.networktype
cls.hypervisor = cls.testClient.getHypervisorInfo()
if cls.hypervisor.lower() == 'hyperv':
raise unittest.SkipTest("Snapshots not supported on Hyper-V")
if cls.hypervisor.lower() in ['hyperv', 'lxc']:
raise unittest.SkipTest("Snapshots not supported on Hyper-V or LXC")
template = get_template(
cls.apiclient,

View File

@ -60,6 +60,9 @@ class TestCreateTemplate(cloudstackTestCase):
testClient = super(TestCreateTemplate, cls).getClsTestClient()
cls.apiclient = testClient.getApiClient()
cls.services = testClient.getParsedTestDataConfig()
cls.hypervisor = testClient.getHypervisorInfo()
if cls.hypervisor.lower() in ['lxc']:
raise unittest.SkipTest("Template creation from root volume is not supported in LXC")
# Get Zone, Domain and templates
cls.domain = get_domain(cls.apiclient)
@ -208,6 +211,9 @@ class TestTemplates(cloudstackTestCase):
testClient = super(TestTemplates, cls).getClsTestClient()
cls.apiclient = testClient.getApiClient()
cls.services = testClient.getParsedTestDataConfig()
cls.hypervisor = testClient.getHypervisorInfo()
if cls.hypervisor.lower() in ['lxc']:
raise unittest.SkipTest("Template creation from root volume is not supported in LXC")
# Get Zone, Domain and templates
cls.domain = get_domain(cls.apiclient)

View File

@ -23,8 +23,7 @@ from marvin.cloudstackAPI import (recoverVirtualMachine,
attachIso,
detachIso)
from marvin.lib.utils import (cleanup_resources,
validateList,
get_hypervisor_type)
validateList)
from marvin.lib.base import (Account,
ServiceOffering,
VirtualMachine,
@ -261,6 +260,7 @@ class TestVMLifeCycle(cloudstackTestCase):
testClient = super(TestVMLifeCycle, cls).getClsTestClient()
cls.apiclient = testClient.getApiClient()
cls.services = testClient.getParsedTestDataConfig()
cls.hypervisor = testClient.getHypervisorInfo()
# Get Zone, Domain and templates
domain = get_domain(cls.apiclient)
@ -548,20 +548,21 @@ class TestVMLifeCycle(cloudstackTestCase):
if len(hosts) < 2:
self.skipTest("At least two hosts should be present in the zone for migration")
hypervisor = str(get_hypervisor_type(self.apiclient)).lower()
if self.hypervisor.lower() in ["lxc"]:
self.skipTest("Migration is not supported on LXC")
# For KVM, two hosts used for migration should be present in same cluster
# For XenServer and VMware, migration is possible between hosts belonging to different clusters
# with the help of XenMotion and Vmotion respectively.
if hypervisor.lower() in ["kvm","simulator"]:
if self.hypervisor.lower() in ["kvm","simulator"]:
#identify suitable host
clusters = [h.clusterid for h in hosts]
#find hosts withe same clusterid
clusters = [cluster for index, cluster in enumerate(clusters) if clusters.count(cluster) > 1]
if len(clusters) <= 1:
self.skipTest("In " + hypervisor.lower() + " Live Migration needs two hosts within same cluster")
self.skipTest("In " + self.hypervisor.lower() + " Live Migration needs two hosts within same cluster")
suitable_hosts = [host for host in hosts if host.clusterid == clusters[0]]
else:
@ -661,6 +662,9 @@ class TestVMLifeCycle(cloudstackTestCase):
# 5. Detach ISO
# 6. Check the device is properly detached by logging into VM
if self.hypervisor.lower() in ["lxc"]:
self.skipTest("ISOs are not supported on LXC")
iso = Iso.create(
self.apiclient,
self.services["iso1"],

View File

@ -38,8 +38,8 @@ class TestVmSnapshot(cloudstackTestCase):
testClient = super(TestVmSnapshot, cls).getClsTestClient()
hypervisor = testClient.getHypervisorInfo()
if hypervisor.lower() in (KVM.lower(), "hyperv"):
raise unittest.SkipTest("VM snapshot feature is not supported on KVM or Hyper-V")
if hypervisor.lower() in (KVM.lower(), "hyperv", "lxc"):
raise unittest.SkipTest("VM snapshot feature is not supported on KVM, Hyper-V or LXC")
cls.apiclient = testClient.getApiClient()
cls.services = testClient.getParsedTestDataConfig()