Skip to content

Commit

Permalink
pvc_name is initialized in clone method
Browse files Browse the repository at this point in the history
Signed-off-by: Avdhoot <[email protected]>
  • Loading branch information
avd-sagare committed Jan 6, 2025
1 parent 2691cfa commit 5f073d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions ocs_ci/ocs/cnv/virtual_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ def _clone_vm_pvc(self, vm_data):
access_mode=self.pvc_access_mode,
volume_mode=constants.VOLUME_MODE_BLOCK,
)
self.pvc_name = self.pvc_obj.name
wait_for_resource_state(self.pvc_obj, state=constants.STATUS_BOUND, timeout=300)
vm_data["spec"]["template"]["spec"]["volumes"][0]["persistentVolumeClaim"] = {
"claimName": self.pvc_obj.name
Expand Down
12 changes: 6 additions & 6 deletions tests/functional/workloads/cnv/test_vm_snapshot_cloning_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ def test_vm_snapshot_ops(
@pytest.mark.polarion_id("OCS-6288")
def test_vm_snap_of_clone(
self,
setup_cnv,
project_factory,
multi_cnv_workload,
clone_vm_workload,
snapshot_factory,
snapshot_restore_factory,
multi_cnv_workload,
cnv_workload,
clone_vm_workload,
setup_cnv,
):
"""
This test performs the VM cloning and IOs created using different volume interfaces(PVC/DV/DVT)
Expand Down Expand Up @@ -181,10 +181,10 @@ def test_vm_snap_of_clone(
), f"Failed: MD5 comparison between source {vm_obj.name} and cloned {clone_obj.name} VMs"
run_dd_io(vm_obj=clone_obj, file_path=file_paths[1])

clone_obj.stop()

# Taking Snapshot of PVC
cloned_pvc_obj = clone_obj.get_vm_pvc_obj()
# Stopping VM before taking snapshot of the VM PVC
clone_obj.stop()
# Taking Snapshot of cloned PVC
snap_obj = snapshot_factory(cloned_pvc_obj)

# Restore the snapshot
Expand Down

0 comments on commit 5f073d0

Please sign in to comment.