From b6e7959cae25a1c9792d7db03b266ac04c320987 Mon Sep 17 00:00:00 2001 From: Jilju Joy Date: Thu, 13 Jun 2024 20:13:30 +0530 Subject: [PATCH] Update snapshot fixture to handle provider mode client Signed-off-by: Jilju Joy --- tests/conftest.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index f744979cd21..e4f5af8c47a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4248,6 +4248,22 @@ def factory( ): restore_pvc_yaml = restore_pvc_yaml or constants.CSI_LVM_PVC_RESTORE_YAML no_interface = True + elif ( + ocsci_config.ENV_DATA["platform"].lower() in constants.HCI_PC_OR_MS_PLATFORM + ): + storageclass = storageclass or vol_snapshot_class + storageclass_obj = OCP(kind="storageclass", resource_name=storageclass) + sc_data = storageclass_obj.get(resource_name=storageclass) + if sc_data["provisioner"] == constants.RBD_PROVISIONER: + restore_pvc_yaml = ( + restore_pvc_yaml or constants.CSI_RBD_PVC_RESTORE_YAML + ) + interface = constants.CEPHBLOCKPOOL + elif sc_data["provisioner"] == constants.CEPHFS_PROVISIONER: + restore_pvc_yaml = ( + restore_pvc_yaml or constants.CSI_CEPHFS_PVC_RESTORE_YAML + ) + interface = constants.CEPHFILESYSTEM restored_pvc = create_restore_pvc( sc_name=storageclass,