mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merging all required changes for these test paths to run properly
This commit is contained in:
parent
1664c91214
commit
229f23874a
@ -125,7 +125,7 @@ class TestAdvancedZoneStoppedVM(cloudstackTestCase):
|
||||
testClient = super(TestAdvancedZoneStoppedVM, cls).getClsTestClient()
|
||||
cls.apiclient = testClient.getApiClient()
|
||||
cls.testdata = testClient.getParsedTestDataConfig()
|
||||
|
||||
cls.hypervisor = testClient.getHypervisorInfo()
|
||||
# Get Zone, Domain and templates
|
||||
cls.domain = get_domain(cls.apiclient)
|
||||
cls.zone = get_zone(cls.apiclient)
|
||||
@ -373,7 +373,7 @@ class TestAdvancedZoneStoppedVM(cloudstackTestCase):
|
||||
self.assertTrue(response[0], response[1])
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "basic"], required_hardware="false")
|
||||
@attr("simulator_only", tags=["advanced", "basic"], required_hardware="false")
|
||||
def test_03_pt_deploy_vm_with_startvm_false(self):
|
||||
""" Positive test for stopped VM test path - T2
|
||||
|
||||
@ -415,7 +415,7 @@ class TestAdvancedZoneStoppedVM(cloudstackTestCase):
|
||||
self.assertTrue(response[0], response[1])
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "basic"], required_hardware="false")
|
||||
@attr("simulator_only", tags=["advanced", "basic"], required_hardware="false")
|
||||
def test_04_pt_startvm_false_attach_disk(self):
|
||||
""" Positive test for stopped VM test path - T3 and variant, T9
|
||||
|
||||
@ -554,7 +554,7 @@ class TestAdvancedZoneStoppedVM(cloudstackTestCase):
|
||||
)
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "basic"], required_hardware="false")
|
||||
@attr("simulator_only", tags=["advanced", "basic"], required_hardware="false")
|
||||
def test_05_pt_startvm_false_attach_disk_change_SO(self):
|
||||
""" Positive test for stopped VM test path - T4
|
||||
|
||||
@ -790,6 +790,11 @@ class TestAdvancedZoneStoppedVM(cloudstackTestCase):
|
||||
# 4. Start the VM, verify that it is in running state
|
||||
# 5. Verify that new password is generated for the VM
|
||||
"""
|
||||
|
||||
if self.hypervisor.lower() in ['lxc']:
|
||||
self.skipTest(
|
||||
"feature is not supported in %s" %
|
||||
self.hypervisor)
|
||||
vm_for_template = VirtualMachine.create(
|
||||
self.userapiclient,
|
||||
self.testdata["small"],
|
||||
@ -888,7 +893,7 @@ class TestAdvancedZoneStoppedVM(cloudstackTestCase):
|
||||
)
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "basic"], required_hardware="false")
|
||||
@attr("simulator_only", tags=["advanced", "basic"], required_hardware="false")
|
||||
def test_09_pt_destroy_stopped_vm(self):
|
||||
""" Positive test for stopped VM test path - T11
|
||||
|
||||
@ -939,7 +944,7 @@ class TestAdvancedZoneStoppedVM(cloudstackTestCase):
|
||||
self.assertEqual(response[0], PASS, response[1])
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "basic"], required_hardware="false")
|
||||
@attr("simulator_only", tags=["advanced", "basic"], required_hardware="false")
|
||||
def test_10_max_account_limit(self):
|
||||
""" Positive test for stopped VM test path - T12
|
||||
|
||||
|
||||
@ -37,9 +37,11 @@ from marvin.lib.common import (get_domain,
|
||||
list_virtual_machines,
|
||||
list_storage_pools,
|
||||
list_clusters,
|
||||
list_hosts
|
||||
list_hosts,
|
||||
validateList
|
||||
)
|
||||
from marvin.codes import (ZONETAG1,
|
||||
from marvin.codes import (PASS,
|
||||
ZONETAG1,
|
||||
CLUSTERTAG1)
|
||||
|
||||
from marvin.cloudstackAPI import (deleteVolume)
|
||||
@ -412,20 +414,21 @@ class TestStorageMigration(cloudstackTestCase):
|
||||
cls.testdata["ostype"])
|
||||
|
||||
cls._cleanup = []
|
||||
cls.unsupportedHypervisor = False
|
||||
cls.insuffPools = False
|
||||
|
||||
if cls.hypervisor.lower() not in [
|
||||
"vmware",
|
||||
"kvm",
|
||||
"xenserver",
|
||||
"hyper-v"]:
|
||||
raise unittest.SkipTest(
|
||||
"Storage migration not supported on %s" %
|
||||
cls.hypervisor)
|
||||
|
||||
cls.unsupportedHypervisor = True
|
||||
return
|
||||
try:
|
||||
cls.pools = StoragePool.list(cls.apiclient, zoneid=cls.zone.id)
|
||||
except Exception as e:
|
||||
raise unittest.SkipTest(e)
|
||||
cls.insuffPools = True
|
||||
return
|
||||
try:
|
||||
|
||||
# Create an account
|
||||
@ -507,6 +510,9 @@ class TestStorageMigration(cloudstackTestCase):
|
||||
def setUp(self):
|
||||
self.apiclient = self.testClient.getApiClient()
|
||||
self.dbclient = self.testClient.getDbConnection()
|
||||
if self.unsupportedHypervisor or self.insuffPools:
|
||||
self.skipTest("Skipping test because unsupported hypervisor\
|
||||
%s" % self.hypervisor)
|
||||
self.cleanup = []
|
||||
|
||||
def tearDown(self):
|
||||
@ -518,7 +524,7 @@ class TestStorageMigration(cloudstackTestCase):
|
||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "basic"])
|
||||
@attr(tags=["advanced", "basic"], required_hardware="True")
|
||||
def test_01_migrate_root_and_data_disk_nonlive(self):
|
||||
""" Test migrate Volume (root and data disk)
|
||||
|
||||
@ -1205,7 +1211,7 @@ class TestStorageMigration(cloudstackTestCase):
|
||||
), None, "VM list should be empty")
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "basic"])
|
||||
@attr(tags=["advanced", "basic"], required_hardware="True")
|
||||
def test_02_migration_nonlive_xenserver_supported(self):
|
||||
""" Test migrate Volume (root and data disk) for Hypervisor Xenserver
|
||||
|
||||
@ -1650,7 +1656,7 @@ class TestStorageMigration(cloudstackTestCase):
|
||||
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "basic"])
|
||||
@attr(tags=["advanced", "basic"], required_hardware="True")
|
||||
def test_03_migrate_root_and_data_disk_nonlive_cwps_vmware(self):
|
||||
""" Test migrate Volume (root and data disk)
|
||||
|
||||
@ -2088,7 +2094,7 @@ class TestStorageMigration(cloudstackTestCase):
|
||||
), None, "VM list should be empty")
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "basic"])
|
||||
@attr(tags=["advanced", "basic"], required_hardware="True")
|
||||
def test_04_migrate_root_and_data_disk_nonlive_zwps_vmware(self):
|
||||
""" Test migrate Volume (root and data disk)
|
||||
|
||||
@ -2279,15 +2285,15 @@ class NegativeTestStorageMigration(cloudstackTestCase):
|
||||
cls.testdata["ostype"])
|
||||
|
||||
cls._cleanup = []
|
||||
|
||||
cls.unsupportedHypervisor = False
|
||||
cls.insuffPools = False
|
||||
if cls.hypervisor.lower() not in [
|
||||
"vmware",
|
||||
"kvm",
|
||||
"xenserver",
|
||||
"hyper-v"]:
|
||||
raise unittest.SkipTest(
|
||||
"Storage migration not supported on %s" %
|
||||
cls.hypervisor)
|
||||
cls.unsupportedHypervisor = True
|
||||
return
|
||||
|
||||
try:
|
||||
cls.pools = StoragePool.list(cls.apiclient, zoneid=cls.zone.id)
|
||||
@ -2300,7 +2306,8 @@ class NegativeTestStorageMigration(cloudstackTestCase):
|
||||
"There must be at least two cluster wide\
|
||||
storage pools available in the setup"
|
||||
except Exception as e:
|
||||
raise unittest.SkipTest(e)
|
||||
cls.insuffPools = True
|
||||
return
|
||||
try:
|
||||
|
||||
# Create an account
|
||||
@ -2382,6 +2389,9 @@ class NegativeTestStorageMigration(cloudstackTestCase):
|
||||
def setUp(self):
|
||||
self.apiclient = self.testClient.getApiClient()
|
||||
self.dbclient = self.testClient.getDbConnection()
|
||||
if self.unsupportedHypervisor or self.insuffPools:
|
||||
self.skipTest("Skipping test because unsupported hypervisor\
|
||||
%s" % self.hypervisor)
|
||||
self.cleanup = []
|
||||
|
||||
def tearDown(self):
|
||||
@ -2434,7 +2444,7 @@ class NegativeTestStorageMigration(cloudstackTestCase):
|
||||
except Exception as e:
|
||||
self.exceptionList.append(e)
|
||||
|
||||
@attr(tags=["advanced", "basic"])
|
||||
@attr(tags=["advanced", "basic"], required_hardware="True")
|
||||
def test_01_migrate_data_disk_negative_test(self):
|
||||
""" Negative test cases
|
||||
|
||||
@ -2689,16 +2699,17 @@ class TestLiveStorageMigration(cloudstackTestCase):
|
||||
cls.testdata["ostype"])
|
||||
|
||||
cls._cleanup = []
|
||||
|
||||
cls.unsupportedHypervisor = False
|
||||
cls.insuffPools = False
|
||||
if cls.hypervisor.lower() in ["kvm", "lxc"]:
|
||||
raise unittest.SkipTest(
|
||||
"Live Storage migration not supported on %s" %
|
||||
cls.hypervisor)
|
||||
cls.unsupportedHypervisor = True
|
||||
return
|
||||
|
||||
try:
|
||||
cls.pools = StoragePool.list(cls.apiclient, zoneid=cls.zone.id)
|
||||
except Exception as e:
|
||||
raise unittest.SkipTest(e)
|
||||
cls.insuffPools = True
|
||||
return
|
||||
try:
|
||||
|
||||
# Create an account
|
||||
@ -2780,6 +2791,9 @@ class TestLiveStorageMigration(cloudstackTestCase):
|
||||
def setUp(self):
|
||||
self.apiclient = self.testClient.getApiClient()
|
||||
self.dbclient = self.testClient.getDbConnection()
|
||||
if self.unsupportedHypervisor or self.insuffPools:
|
||||
self.skipTest("Skipping test because unsupported hypervisor\
|
||||
%s" % self.hypervisor)
|
||||
self.cleanup = []
|
||||
|
||||
def tearDown(self):
|
||||
@ -2979,7 +2993,7 @@ class TestLiveStorageMigration(cloudstackTestCase):
|
||||
@unittest.skip(
|
||||
"Requires setup with 2 pods - Each pod having 2 clusters. \
|
||||
Yet to be tested")
|
||||
@attr(tags=["advanced", "basic"])
|
||||
@attr(tags=["advanced", "basic"], required_hardware="True")
|
||||
def test_02_migration_live_different_pods(self):
|
||||
""" Test migrate Volume (root and data disk)
|
||||
|
||||
@ -3573,35 +3587,37 @@ class TestStorageLiveMigrationVmware(cloudstackTestCase):
|
||||
cls.testdata["ostype"])
|
||||
|
||||
cls._cleanup = []
|
||||
|
||||
cls.hypervisorNotSupported = False
|
||||
cls.NoResource = False
|
||||
if cls.hypervisor.lower() not in [
|
||||
"vmware",
|
||||
"kvm",
|
||||
"xenserver",
|
||||
"hyper-v"]:
|
||||
raise unittest.SkipTest(
|
||||
"Storage migration not supported on %s" %
|
||||
cls.hypervisor)
|
||||
"vmware"]:
|
||||
cls.hypervisorNotSupported = True
|
||||
# Get Hosts in the cluster and iscsi/vmfs storages for that cluster
|
||||
iscsi_pools = []
|
||||
try :
|
||||
list_vmware_clusters = list_clusters(cls.apiclient, hypervisor="vmware")
|
||||
except Exception as e:
|
||||
raise unittest.SkipTest(e)
|
||||
|
||||
cls.NoResource = True
|
||||
return
|
||||
assert validateList(list_vmware_clusters)[0] == PASS
|
||||
if len(list_vmware_clusters) < 1 :
|
||||
raise unittest.SkipTest("There is no cluster available in the setup")
|
||||
cls.NoResource = True
|
||||
return
|
||||
else :
|
||||
for cluster in list_vmware_clusters :
|
||||
try:
|
||||
list_esx_hosts = list_hosts(cls.apiclient, clusterid = cluster.id)
|
||||
except Exception as e:
|
||||
raise unittest.SkipTest(e)
|
||||
cls.NoResource = True
|
||||
return
|
||||
assert validateList(list_esx_hosts)[0] == PASS
|
||||
if len(list_esx_hosts) > 1 :
|
||||
try:
|
||||
list_storage = list_storage_pools(cls.apiclient, clusterid = cluster.id)
|
||||
except Exception as e:
|
||||
raise unittest.SkipTest(e)
|
||||
cls.NoResource = True
|
||||
return
|
||||
assert validateList(list_storage)[0] == PASS
|
||||
for storage in list_storage :
|
||||
if storage.type == "VMFS" :
|
||||
iscsi_pools.append(storage)
|
||||
@ -3611,7 +3627,8 @@ class TestStorageLiveMigrationVmware(cloudstackTestCase):
|
||||
else :
|
||||
iscsi_pools = []
|
||||
if len(iscsi_pools) < 2 :
|
||||
raise unittest.SkipTest("Not enough resources available in the setup")
|
||||
cls.NoResource = True
|
||||
return
|
||||
cls.hosts = list_esx_hosts
|
||||
cls.pools = list_storage
|
||||
|
||||
@ -3656,6 +3673,9 @@ class TestStorageLiveMigrationVmware(cloudstackTestCase):
|
||||
def setUp(self):
|
||||
self.apiclient = self.testClient.getApiClient()
|
||||
self.dbclient = self.testClient.getDbConnection()
|
||||
if self.unsupportedHypervisor or self.NoResource:
|
||||
self.skipTest("Skipping test because unsupported hypervisor\
|
||||
%s" % self.hypervisor)
|
||||
self.cleanup = []
|
||||
|
||||
def tearDown(self):
|
||||
@ -3700,7 +3720,7 @@ class TestStorageLiveMigrationVmware(cloudstackTestCase):
|
||||
return destinationHost
|
||||
|
||||
|
||||
@attr(tags=["advanced", "basic", "vmware", "vmfs"])
|
||||
@attr(tags=["advanced", "basic", "vmware", "vmfs"], required_hardware="True")
|
||||
def test_01_migrate_root_and_data_disk_live(self):
|
||||
"""
|
||||
Migrate VMs/Volumes on VMware with VMFS storage
|
||||
|
||||
@ -84,8 +84,10 @@ class TestUsage(cloudstackTestCase):
|
||||
cls.mgtSvrDetails = cls.config.__dict__["mgtSvr"][0].__dict__
|
||||
|
||||
isUsageJobRunning = cls.IsUsageJobRunning()
|
||||
cls.usageJobNotRunning = False
|
||||
if not isUsageJobRunning:
|
||||
raise unittest.SkipTest("Skipping, usage job is not running")
|
||||
cls.usageJobNotRunning = True
|
||||
return
|
||||
|
||||
if cls.testdata["configurableData"][
|
||||
"setUsageConfigurationThroughTestCase"]:
|
||||
@ -188,6 +190,8 @@ class TestUsage(cloudstackTestCase):
|
||||
self.apiclient = self.testClient.getApiClient()
|
||||
self.dbclient = self.testClient.getDbConnection()
|
||||
self.cleanup = []
|
||||
if self.usageJobNotRunning:
|
||||
self.skipTest("Skipping test because usage job not running")
|
||||
# Create an account
|
||||
self.account = Account.create(
|
||||
self.apiclient,
|
||||
@ -424,7 +428,7 @@ class TestUsage(cloudstackTestCase):
|
||||
)
|
||||
return result
|
||||
|
||||
@attr(tags=["advanced"], required_hardware="true")
|
||||
@attr(tags=["advanced"], required_hardware="True")
|
||||
def test_01_positive_tests_usage(self):
|
||||
""" Positive test for usage test path
|
||||
|
||||
@ -2963,8 +2967,9 @@ class TestUsageDirectMeteringBasicZone(cloudstackTestCase):
|
||||
cls.mgtSvrDetails = cls.config.__dict__["mgtSvr"][0].__dict__
|
||||
|
||||
isUsageJobRunning = cls.IsUsageJobRunning()
|
||||
cls.usageJobNotRunning = False
|
||||
if not isUsageJobRunning:
|
||||
raise unittest.SkipTest("Skipping, usage job is not running")
|
||||
cls.usageJobNotRunning = True
|
||||
|
||||
if cls.testdata["configurableData"][
|
||||
"setUsageConfigurationThroughTestCase"]:
|
||||
@ -3025,6 +3030,8 @@ class TestUsageDirectMeteringBasicZone(cloudstackTestCase):
|
||||
self.apiclient = self.testClient.getApiClient()
|
||||
self.dbclient = self.testClient.getDbConnection()
|
||||
self.cleanup = []
|
||||
if self.usageJobNotRunning:
|
||||
self.skipTest("Skipping test because usage job not running")
|
||||
# Create an account
|
||||
self.account = Account.create(
|
||||
self.apiclient,
|
||||
|
||||
@ -316,7 +316,7 @@ class TestPathVMLC(cloudstackTestCase):
|
||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||
return
|
||||
|
||||
@attr(tags=["advanced"], required_hardware="false")
|
||||
@attr(tags=["advanced"], required_hardware="True")
|
||||
@data(ISOLATED_NETWORK, VPC_NETWORK)
|
||||
def test_01_positive_tests_vm_operations_advanced_zone(self, value):
|
||||
""" Positive tests for VMLC test path - Advanced Zone
|
||||
@ -508,7 +508,7 @@ class TestPathVMLC(cloudstackTestCase):
|
||||
self.fail("Exception while SSHing to VM: %s" % e)
|
||||
return
|
||||
|
||||
@attr(tags=["advanced"], required_hardware="false")
|
||||
@attr(tags=["advanced"], required_hardware="True")
|
||||
def test_01_positive_tests_vm_deploy_shared_nw(self):
|
||||
""" Positive tests for VMLC test path - Advanced Zone in Shared Network
|
||||
|
||||
@ -560,7 +560,7 @@ class TestPathVMLC(cloudstackTestCase):
|
||||
)
|
||||
return
|
||||
|
||||
@attr(tags=["basic"], required_hardware="false")
|
||||
@attr(tags=["basic"], required_hardware="True")
|
||||
def test_01_positive_tests_vm_operations_basic_zone(self):
|
||||
""" Positive tests for VMLC test path - Basic Zone
|
||||
|
||||
@ -722,7 +722,7 @@ class TestPathVMLC(cloudstackTestCase):
|
||||
self.fail("Exception while SSHing to VM: %s" % e)
|
||||
return
|
||||
|
||||
@attr(tags=["advanced"], required_hardware="false")
|
||||
@attr(tags=["advanced"], required_hardware="True")
|
||||
@data(ISOLATED_NETWORK, SHARED_NETWORK, VPC_NETWORK)
|
||||
def test_02_negative_tests_destroy_VM_operations_advanced_zone(
|
||||
self,
|
||||
@ -774,7 +774,7 @@ class TestPathVMLC(cloudstackTestCase):
|
||||
|
||||
return
|
||||
|
||||
@attr(tags=["basic"], required_hardware="false")
|
||||
@attr(tags=["basic"], required_hardware="True")
|
||||
def test_02_negative_tests_destroy_VM_operations_basic_zone(self):
|
||||
""" Negative tests for VMLC test path - destroy VM
|
||||
|
||||
@ -817,7 +817,7 @@ class TestPathVMLC(cloudstackTestCase):
|
||||
|
||||
return
|
||||
|
||||
@attr(tags=["advanced"], required_hardware="false")
|
||||
@attr(tags=["advanced"], required_hardware="True")
|
||||
@data(ISOLATED_NETWORK, SHARED_NETWORK, VPC_NETWORK)
|
||||
def test_03_negative_tests_expunge_VM_operations_advanced_zone(
|
||||
self,
|
||||
@ -875,7 +875,7 @@ class TestPathVMLC(cloudstackTestCase):
|
||||
|
||||
return
|
||||
|
||||
@attr(tags=["basic"], required_hardware="false")
|
||||
@attr(tags=["basic"], required_hardware="True")
|
||||
def test_03_negative_tests_expunge_VM_operations_basic_zone(self):
|
||||
""" Negative tests for VMLC test path - expunge VM
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ from marvin.lib.base import (Account,
|
||||
Resources)
|
||||
from marvin.lib.utils import cleanup_resources, validateList
|
||||
|
||||
# common - commonly used methods for all tests are listed here
|
||||
#common - commonly used methods for all tests are listed here
|
||||
from marvin.lib.common import (get_zone,
|
||||
get_domain,
|
||||
get_template,
|
||||
@ -117,7 +117,6 @@ def verify_vm(self, vmid):
|
||||
|
||||
|
||||
class TestPathVolume(cloudstackTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
testClient = super(TestPathVolume, cls).getClsTestClient()
|
||||
@ -128,10 +127,11 @@ class TestPathVolume(cloudstackTestCase):
|
||||
cls.zone = get_zone(cls.apiclient)
|
||||
cls.testdata["mode"] = cls.zone.networktype
|
||||
cls.hypervisor = testClient.getHypervisorInfo()
|
||||
cls.insuffStorage = False
|
||||
#for LXC if the storage pool of type 'rbd' ex: ceph is not available, skip the test
|
||||
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 %s" % cls.hypervisor.lower())
|
||||
cls.insuffStorage = True
|
||||
|
||||
cls.template = get_template(
|
||||
cls.apiclient,
|
||||
@ -217,12 +217,19 @@ class TestPathVolume(cloudstackTestCase):
|
||||
password=cls.testdata["account"]["password"]
|
||||
)
|
||||
assert response.sessionkey is not None
|
||||
# response should have non null value
|
||||
#response should have non null value
|
||||
except Exception as e:
|
||||
cls.tearDownClass()
|
||||
raise e
|
||||
cls.tearDownClass()
|
||||
raise e
|
||||
return
|
||||
|
||||
def setUp(self):
|
||||
self.apiclient = self.testClient.getApiClient()
|
||||
self.dbclient = self.testClient.getDbConnection()
|
||||
if self.unsupportedHypervisor or self.insuffPools:
|
||||
self.skipTest("Skipping test because of insuff resources\
|
||||
%s" % self.hypervisor)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
try:
|
||||
@ -264,7 +271,10 @@ class TestPathVolume(cloudstackTestCase):
|
||||
# 20.Detach data disks from VM2 and delete volume
|
||||
|
||||
"""
|
||||
|
||||
if self.hypervisor.lower() in ['lxc']:
|
||||
self.skipTest(
|
||||
"feature is not supported in %s" %
|
||||
self.hypervisor)
|
||||
# 1. Deploy a vm [vm1] with shared storage and data disk
|
||||
self.virtual_machine_1 = VirtualMachine.create(
|
||||
self.userapiclient,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user