Skip to content

Commit 248bc6c

Browse files
committed
smoke test: support ceph storage pools
1 parent 2dbc86a commit 248bc6c

File tree

8 files changed

+42
-19
lines changed

8 files changed

+42
-19
lines changed

test/integration/smoke/test_backup_recovery_nas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def setUpClass(cls):
5151

5252
cls.storage_pool = StoragePool.list(cls.api_client)[0]
5353
if cls.storage_pool.type.lower() != 'networkfilesystem':
54-
cls.skipTest(cls, reason="Test can be run only if the primary storage is of type NFS")
54+
cls.skipTest(cls, reason="Test can be run only if the primary storage is of type NFS. The pool type is %s " % cls.storage_pool.type)
5555

5656
# Check backup configuration values, set them to enable the nas provider
5757
backup_enabled_cfg = Configurations.list(cls.api_client, name='backup.framework.enabled')

test/integration/smoke/test_direct_download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def setUpClass(cls):
218218
zoneid=cls.zone.id
219219
)
220220
for pool in storage_pools:
221-
if not cls.nfsStorageFound and pool.type == "NetworkFilesystem":
221+
if not cls.nfsStorageFound and pool.type in ("NetworkFilesystem", "RBD"):
222222
cls.nfsStorageFound = True
223223
cls.nfsPoolId = pool.id
224224
elif not cls.localStorageFound and pool.type == "Filesystem":
@@ -295,7 +295,7 @@ def deployVM(self, offering) :
295295
@skipTestIf("nfsKvmNotAvailable")
296296
@attr(tags=["advanced", "basic", "eip", "advancedns", "sg"], required_hardware="false")
297297
def test_01_deploy_vm_from_direct_download_template_nfs_storage(self):
298-
"""Test Deploy VM from direct download template on NFS storage
298+
"""Test Deploy VM from direct download template on NFS or RBD storage
299299
"""
300300

301301
# Create service offering for local storage using storage tags

test/integration/smoke/test_human_readable_logs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def test_01_disableHumanReadableLogs(self):
4848
sshClient.execute(command)
4949

5050
# CapacityChecker runs as soon as management server is up
51-
# Check if "usedMem: (" is printed out within 60 seconds while server is starting
52-
command = "timeout 60 tail -f /var/log/cloudstack/management/management-server.log | grep 'usedMem: ('"
53-
sshClient.timeout = 60
51+
# Check if "usedMem: (" is printed out within 120 seconds while server is starting
52+
command = "timeout 120 tail -f /var/log/cloudstack/management/management-server.log | grep 'usedMem: ('"
53+
sshClient.timeout = 120
5454
result = sshClient.runCommand(command)
5555
self.assertTrue(result['status'] == "FAILED")
5656

@@ -70,7 +70,7 @@ def test_02_enableHumanReadableLogs(self):
7070
sshClient.execute(command)
7171

7272
# CapacityChecker runs as soon as management server is up
73-
# Check if "usedMem: (" is printed out within 60 seconds while server is restarting
73+
# Check if "usedMem: (" is printed out within 120 seconds while server is restarting
7474
command = "timeout 120 tail -f /var/log/cloudstack/management/management-server.log | grep 'usedMem: ('"
7575
sshClient.timeout = 120
7676
result = sshClient.runCommand(command)

test/integration/smoke/test_over_provisioning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ def test_UpdateStorageOverProvisioningFactor(self):
6060
"The environment don't have storage pools required for test")
6161

6262
for pool in storage_pools:
63-
if pool.type == "NetworkFilesystem" or pool.type == "VMFS" or pool.type == "PowerFlex":
63+
if pool.type in ("NetworkFilesystem", "VMFS", "PowerFlex", "RBD"):
6464
break
6565

66-
if pool.type != "NetworkFilesystem" and pool.type != "VMFS" and pool.type != "PowerFlex":
66+
if pool.type not in ("NetworkFilesystem", "VMFS", "PowerFlex", "RBD"):
6767
raise self.skipTest("Storage overprovisioning currently not supported on " + pool.type + " pools")
6868

6969
self.poolId = pool.id

test/integration/smoke/test_snapshots.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def test_02_list_snapshots_with_removed_data_store(self):
262262
volume_pool_response = list_storage_pools(self.apiclient,
263263
id=vol_res[0].storageid)
264264
volume_pool = volume_pool_response[0]
265-
if volume_pool.type.lower() != 'networkfilesystem':
265+
if volume_pool.type not in ("NetworkFilesystem", "RBD"):
266266
self.skipTest("This test is not supported for volume created on storage pool type %s" % volume_pool.type)
267267
clusters = list_clusters(
268268
self.apiclient,
@@ -291,9 +291,8 @@ def test_02_list_snapshots_with_removed_data_store(self):
291291
'Up',
292292
"Check primary storage state"
293293
)
294-
self.assertEqual(
295-
storage.type,
296-
'NetworkFilesystem',
294+
self.assertTrue(
295+
storage.type in ("NetworkFilesystem", "RBD"),
297296
"Check storage pool type"
298297
)
299298
storage_pools_response = list_storage_pools(self.apiclient,

test/integration/smoke/test_vm_life_cycle.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
get_suitable_test_template,
4949
get_test_ovf_templates,
5050
list_hosts,
51+
list_storage_pools,
5152
get_vm_vapp_configs)
5253
from marvin.codes import FAILED, PASS
5354
from nose.plugins.attrib import attr
@@ -1707,12 +1708,16 @@ def get_target_host(self, virtualmachineid):
17071708

17081709
return target_hosts[0]
17091710

1710-
def get_target_pool(self, volid):
1711-
target_pools = StoragePool.listForMigration(self.apiclient, id=volid)
1711+
def get_target_pool(self, vol):
1712+
target_pools = StoragePool.listForMigration(self.apiclient, id=vol.id)
17121713

17131714
if target_pools is None or len(target_pools) == 0:
17141715
self.skipTest("Not enough storage pools found for migration")
17151716

1717+
source_pool = list_storage_pools(self.apiclient, id=vol.storageid)[0]
1718+
if source_pool.type == 'RBD' and target_pools[0].type == 'RBD':
1719+
self.skipTest("Live VM migration between RBD pools is unsupported")
1720+
17161721
return target_pools[0]
17171722

17181723
def get_vm_volumes(self, id):
@@ -1751,7 +1756,7 @@ def test_01_migrate_VM_and_root_volume(self):
17511756

17521757
root_volume = self.get_vm_volumes(vm.id)[0]
17531758

1754-
target_pool = self.get_target_pool(root_volume.id)
1759+
target_pool = self.get_target_pool(root_volume)
17551760

17561761
target_host = self.get_target_host(vm.id)
17571762

@@ -1789,9 +1794,9 @@ def test_02_migrate_VM_with_two_data_disks(self):
17891794

17901795
root_volume = self.get_vm_volumes(vm.id)[0]
17911796

1792-
target_pool = self.get_target_pool(root_volume.id)
1793-
volume1.target_pool = self.get_target_pool(volume1.id)
1794-
volume2.target_pool = self.get_target_pool(volume2.id)
1797+
target_pool = self.get_target_pool(root_volume)
1798+
volume1.target_pool = self.get_target_pool(volume1)
1799+
volume2.target_pool = self.get_target_pool(volume2)
17951800

17961801
target_host = self.get_target_host(vm.id)
17971802

test/integration/smoke/test_vm_snapshots.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ def setUpClass(cls):
4747
cls.unsupportedHypervisor = True
4848
return
4949

50+
list_volume_pool_response = list_storage_pools(cls.apiclient)
51+
volume_pool = list_volume_pool_response[0]
52+
if volume_pool.type == "RBD":
53+
cls.skipTest(cls, reason="VM snapshot is unsupported for VMs on RBD storage pool")
54+
5055
cls.services = testClient.getParsedTestDataConfig()
5156
# Get Zone, Domain and templates
5257
cls.domain = get_domain(cls.apiclient)
@@ -89,6 +94,7 @@ def setUpClass(cls):
8994
serviceofferingid=cls.service_offering.id,
9095
mode=cls.zone.networktype
9196
)
97+
cls._cleanup.append(cls.virtual_machine)
9298
volumes = list_volumes(
9399
cls.apiclient,
94100
virtualmachineid=cls.virtual_machine.id,

test/integration/smoke/test_volumes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,14 @@ def test_13_migrate_volume_and_change_offering(self):
10391039
else:
10401040
raise self.skipTest("Not enough storage pools found, skipping test")
10411041

1042+
volume = Volume.list(self.apiclient,
1043+
id=volume.id,
1044+
account=self.account.name,
1045+
domainid=self.account.domainid)[0]
1046+
source_pool = list_storage_pools(self.apiclient, id=volume.storageid)[0]
1047+
if source_pool.type == 'RBD' and pool.type == 'RBD':
1048+
self.skipTest("Volume migration between RBD pools is unsupported")
1049+
10421050
if hasattr(pool, 'tags'):
10431051
StoragePool.update(self.apiclient, id=pool.id, tags="")
10441052

@@ -1111,6 +1119,11 @@ def setUpClass(cls):
11111119
cls.unsupportedHypervisor = True
11121120
return
11131121

1122+
list_volume_pool_response = list_storage_pools(cls.apiclient)
1123+
volume_pool = list_volume_pool_response[0]
1124+
if volume_pool.type == "RBD":
1125+
cls.skipTest(cls, reason="Volume encryption is unsupported for volumes on RBD storage pool")
1126+
11141127
# Get Zone and Domain
11151128
cls.domain = get_domain(cls.apiclient)
11161129
cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())

0 commit comments

Comments
 (0)