This is an automated email from the ASF dual-hosted git repository.

weizhouapache pushed a commit to branch 4.23.0-ceph
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 3d0bd231bd93692fbc16e43979d35a9e9aaf10eb
Author: Wei Zhou <[email protected]>
AuthorDate: Wed Oct 29 15:45:02 2025 +0100

    smoke test: support ceph storage pools
---
 test/integration/smoke/test_backup_recovery_nas.py |  2 +-
 test/integration/smoke/test_direct_download.py     |  4 ++--
 test/integration/smoke/test_over_provisioning.py   |  4 ++--
 test/integration/smoke/test_snapshots.py           |  7 +++----
 test/integration/smoke/test_vm_life_cycle.py       | 17 +++++++++++------
 test/integration/smoke/test_vm_snapshots.py        |  6 ++++++
 test/integration/smoke/test_volumes.py             | 13 +++++++++++++
 7 files changed, 38 insertions(+), 15 deletions(-)

diff --git a/test/integration/smoke/test_backup_recovery_nas.py 
b/test/integration/smoke/test_backup_recovery_nas.py
index 41aa82bd085..06faa1cc1f4 100644
--- a/test/integration/smoke/test_backup_recovery_nas.py
+++ b/test/integration/smoke/test_backup_recovery_nas.py
@@ -51,7 +51,7 @@ class TestNASBackupAndRecovery(cloudstackTestCase):
 
         cls.storage_pool = StoragePool.list(cls.api_client)[0]
         if cls.storage_pool.type.lower() != 'networkfilesystem':
-            cls.skipTest(cls, reason="Test can be run only if the primary 
storage is of type NFS")
+            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)
 
         # Check backup configuration values, set them to enable the nas 
provider
         backup_enabled_cfg = Configurations.list(cls.api_client, 
name='backup.framework.enabled')
diff --git a/test/integration/smoke/test_direct_download.py 
b/test/integration/smoke/test_direct_download.py
index e6960163bc2..5a34c02d641 100644
--- a/test/integration/smoke/test_direct_download.py
+++ b/test/integration/smoke/test_direct_download.py
@@ -218,7 +218,7 @@ class TestDirectDownloadTemplates(cloudstackTestCase):
                 zoneid=cls.zone.id
             )
             for pool in storage_pools:
-                if not cls.nfsStorageFound and pool.type == 
"NetworkFilesystem":
+                if not cls.nfsStorageFound and pool.type in 
("NetworkFilesystem", "RBD"):
                     cls.nfsStorageFound = True
                     cls.nfsPoolId = pool.id
                 elif not cls.localStorageFound and pool.type == "Filesystem":
@@ -298,7 +298,7 @@ class TestDirectDownloadTemplates(cloudstackTestCase):
     @skipTestIf("nfsKvmNotAvailable")
     @attr(tags=["advanced", "basic", "eip", "advancedns", "sg"], 
required_hardware="false")
     def test_01_deploy_vm_from_direct_download_template_nfs_storage(self):
-        """Test Deploy VM from direct download template on NFS storage
+        """Test Deploy VM from direct download template on NFS or RBD storage
         """
 
         # Create service offering for local storage using storage tags
diff --git a/test/integration/smoke/test_over_provisioning.py 
b/test/integration/smoke/test_over_provisioning.py
index c2b1a5ac205..70a3b84b9cf 100644
--- a/test/integration/smoke/test_over_provisioning.py
+++ b/test/integration/smoke/test_over_provisioning.py
@@ -60,10 +60,10 @@ class TestUpdateOverProvision(cloudstackTestCase):
                             "The environment don't have storage pools required 
for test")
 
         for pool in storage_pools:
-            if pool.type == "NetworkFilesystem" or pool.type == "VMFS" or 
pool.type == "PowerFlex":
+            if pool.type in ("NetworkFilesystem", "VMFS", "PowerFlex", "RBD"):
                 break
 
-        if pool.type != "NetworkFilesystem" and pool.type != "VMFS" and 
pool.type != "PowerFlex":
+        if pool.type not in ("NetworkFilesystem", "VMFS", "PowerFlex", "RBD"):
             raise self.skipTest("Storage overprovisioning currently not 
supported on " + pool.type + " pools")
 
         self.poolId = pool.id
diff --git a/test/integration/smoke/test_snapshots.py 
b/test/integration/smoke/test_snapshots.py
index b1a2569d969..284d8959df5 100644
--- a/test/integration/smoke/test_snapshots.py
+++ b/test/integration/smoke/test_snapshots.py
@@ -262,7 +262,7 @@ class TestSnapshotRootDisk(cloudstackTestCase):
         volume_pool_response = list_storage_pools(self.apiclient,
                                                     id=vol_res[0].storageid)
         volume_pool = volume_pool_response[0]
-        if volume_pool.type.lower() != 'networkfilesystem':
+        if volume_pool.type not in ("NetworkFilesystem", "RBD"):
             self.skipTest("This test is not supported for volume created on 
storage pool type %s" % volume_pool.type)
         clusters = list_clusters(
             self.apiclient,
@@ -291,9 +291,8 @@ class TestSnapshotRootDisk(cloudstackTestCase):
             'Up',
             "Check primary storage state"
         )
-        self.assertEqual(
-            storage.type,
-            'NetworkFilesystem',
+        self.assertTrue(
+            storage.type in ("NetworkFilesystem", "RBD"),
             "Check storage pool type"
         )
         storage_pools_response = list_storage_pools(self.apiclient,
diff --git a/test/integration/smoke/test_vm_life_cycle.py 
b/test/integration/smoke/test_vm_life_cycle.py
index 8df0b994a55..59e33d7d790 100644
--- a/test/integration/smoke/test_vm_life_cycle.py
+++ b/test/integration/smoke/test_vm_life_cycle.py
@@ -48,6 +48,7 @@ from marvin.lib.common import (get_domain,
                                get_suitable_test_template,
                                get_test_ovf_templates,
                                list_hosts,
+                               list_storage_pools,
                                get_vm_vapp_configs)
 from marvin.codes import FAILED, PASS
 from nose.plugins.attrib import attr
@@ -1707,12 +1708,16 @@ class TestKVMLiveMigration(cloudstackTestCase):
 
         return target_hosts[0]
 
-    def get_target_pool(self, volid):
-        target_pools = StoragePool.listForMigration(self.apiclient, id=volid)
+    def get_target_pool(self, vol):
+        target_pools = StoragePool.listForMigration(self.apiclient, id=vol.id)
 
         if target_pools is None or len(target_pools) == 0:
             self.skipTest("Not enough storage pools found for migration")
 
+        source_pool = list_storage_pools(self.apiclient, id=vol.storageid)[0]
+        if source_pool.type == 'RBD' and target_pools[0].type == 'RBD':
+            self.skipTest("Live VM migration between RBD pools is unsupported")
+
         return target_pools[0]
 
     def get_vm_volumes(self, id):
@@ -1751,7 +1756,7 @@ class TestKVMLiveMigration(cloudstackTestCase):
 
         root_volume = self.get_vm_volumes(vm.id)[0]
 
-        target_pool = self.get_target_pool(root_volume.id)
+        target_pool = self.get_target_pool(root_volume)
 
         target_host = self.get_target_host(vm.id)
 
@@ -1789,9 +1794,9 @@ class TestKVMLiveMigration(cloudstackTestCase):
 
         root_volume = self.get_vm_volumes(vm.id)[0]
 
-        target_pool = self.get_target_pool(root_volume.id)
-        volume1.target_pool = self.get_target_pool(volume1.id)
-        volume2.target_pool = self.get_target_pool(volume2.id)
+        target_pool = self.get_target_pool(root_volume)
+        volume1.target_pool = self.get_target_pool(volume1)
+        volume2.target_pool = self.get_target_pool(volume2)
 
         target_host = self.get_target_host(vm.id)
 
diff --git a/test/integration/smoke/test_vm_snapshots.py 
b/test/integration/smoke/test_vm_snapshots.py
index c64de12b1c3..7132140d4f8 100644
--- a/test/integration/smoke/test_vm_snapshots.py
+++ b/test/integration/smoke/test_vm_snapshots.py
@@ -47,6 +47,11 @@ class TestVmSnapshot(cloudstackTestCase):
             cls.unsupportedHypervisor = True
             return
 
+        list_volume_pool_response = list_storage_pools(cls.apiclient)
+        volume_pool = list_volume_pool_response[0]
+        if volume_pool.type == "RBD":
+            cls.skipTest(cls, reason="VM snapshot is unsupported for VMs on 
RBD storage pool")
+
         cls.services = testClient.getParsedTestDataConfig()
         # Get Zone, Domain and templates
         cls.domain = get_domain(cls.apiclient)
@@ -89,6 +94,7 @@ class TestVmSnapshot(cloudstackTestCase):
             serviceofferingid=cls.service_offering.id,
             mode=cls.zone.networktype
         )
+        cls._cleanup.append(cls.virtual_machine)
         volumes = list_volumes(
             cls.apiclient,
             virtualmachineid=cls.virtual_machine.id,
diff --git a/test/integration/smoke/test_volumes.py 
b/test/integration/smoke/test_volumes.py
index ad1c359c27b..b84535efccd 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -1039,6 +1039,14 @@ class TestVolumes(cloudstackTestCase):
         else:
             raise self.skipTest("Not enough storage pools found, skipping 
test")
 
+        volume = Volume.list(self.apiclient,
+                             id=volume.id,
+                             account=self.account.name,
+                             domainid=self.account.domainid)[0]
+        source_pool = list_storage_pools(self.apiclient, 
id=volume.storageid)[0]
+        if source_pool.type == 'RBD' and pool.type == 'RBD':
+            self.skipTest("Volume migration between RBD pools is unsupported")
+
         if hasattr(pool, 'tags'):
             StoragePool.update(self.apiclient, id=pool.id, tags="")
 
@@ -1111,6 +1119,11 @@ class TestVolumeEncryption(cloudstackTestCase):
             cls.unsupportedHypervisor = True
             return
 
+        list_volume_pool_response = list_storage_pools(cls.apiclient)
+        volume_pool = list_volume_pool_response[0]
+        if volume_pool.type == "RBD":
+            cls.skipTest(cls, reason="Volume encryption is unsupported for 
volumes on RBD storage pool")
+
         # Get Zone and Domain
         cls.domain = get_domain(cls.apiclient)
         cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())

Reply via email to