Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 61 additions & 6 deletions test/integration/component/test_stopped_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
get_domain,
get_template,
get_builtin_template_info,
update_resource_limit)
update_resource_limit,
find_storage_pool_type)
from marvin.codes import PASS


Expand All @@ -53,6 +54,14 @@ def setUpClass(cls):
cls.domain = get_domain(cls.api_client)
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'):
cls.skip = True
return

cls.template = get_template(
cls.api_client,
cls.zone.id,
Expand Down Expand Up @@ -84,6 +93,9 @@ def tearDownClass(cls):

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
Expand Down Expand Up @@ -627,11 +639,11 @@ def test_09_stop_vm_migrate_vol(self):
# 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
Expand Down Expand Up @@ -743,6 +755,14 @@ def setUpClass(cls):

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'):
cls.skip = True
return

cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())

Expand Down Expand Up @@ -778,6 +798,9 @@ def tearDownClass(cls):

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()
Expand Down Expand Up @@ -851,7 +874,6 @@ def test_02_deploy_ha_vm_from_iso(self):
# 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" %
Expand Down Expand Up @@ -909,10 +931,8 @@ def test_03_deploy_ha_vm_iso_startvm_false(self):
# 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" %
Expand Down Expand Up @@ -946,6 +966,14 @@ def setUpClass(cls):

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'):
cls.skip = True
return

cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())

Expand Down Expand Up @@ -980,6 +1008,9 @@ def tearDownClass(cls):

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
Expand Down Expand Up @@ -1102,6 +1133,14 @@ def setUpClass(cls):

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'):
cls.skip = True
return

cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())

Expand Down Expand Up @@ -1136,6 +1175,9 @@ def tearDownClass(cls):

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
Expand Down Expand Up @@ -1169,6 +1211,7 @@ def setUpClass(cls):
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())
Expand Down Expand Up @@ -1297,6 +1340,7 @@ def setUpClass(cls):
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())
Expand Down Expand Up @@ -1419,6 +1463,13 @@ def setUpClass(cls):
cls.api_client = cls.testClient.getApiClient()

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'):
cls.skip = True

# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
Expand Down Expand Up @@ -1457,6 +1508,9 @@ def tearDownClass(cls):
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 = []
Expand Down Expand Up @@ -1537,6 +1591,7 @@ def setUpClass(cls):
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())
Expand Down