Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM snapshot pvc clone #11151

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

ayush-patni
Copy link
Contributor

This PR consists of two test cases resp for CNV: VM snapshot pvc clone.
Replacing PR 11062 with this one for better availability

@ayush-patni ayush-patni requested a review from a team as a code owner January 15, 2025 07:55
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines label Jan 15, 2025
Copy link

openshift-ci bot commented Jan 15, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ayush-patni

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pull-request-size pull-request-size bot added size/L PR that changes 100-499 lines size/M PR that changes 30-99 lines and removed size/M PR that changes 30-99 lines size/L PR that changes 100-499 lines labels Jan 15, 2025
Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: apatni-cnv-hotpl2
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/functional/workloads/cnv/test_vm_snapshot_cloning_ops.py::TestVmSnapshotClone::test_vm_snapshot_pvc_clone
Additional Test Params:
OCP VERSION: 4.18
OCS VERSION: 4.18
tested against branch: master

Job UNSTABLE (some or all tests failed).

Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: apatni-cnv-hotpl2
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/functional/workloads/cnv/test_vm_snapshot_cloning_ops.py::TestVmSnapshotClone::test_vm_snapshot_pvc_clone
Additional Test Params:
OCP VERSION: 4.18
OCS VERSION: 4.18
tested against branch: master

Job UNSTABLE (some or all tests failed).

Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: apatni-cnv-hotpl2
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/functional/workloads/cnv/test_vm_snapshot_cloning_ops.py::TestVmSnapshotClone::test_vm_snapshot_pvc_clone
Additional Test Params:
OCP VERSION: 4.18
OCS VERSION: 4.18
tested against branch: master

Job UNSTABLE (some or all tests failed).

Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: apatni-cnv-snap
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/functional/workloads/cnv/test_vm_snapshot_cloning_ops.py::TestVmSnapshotClone::test_vm_snapshot_pvc_clone
Additional Test Params:
OCP VERSION: 4.18
OCS VERSION: 4.18
tested against branch: master

Job PASSED.

@ayush-patni ayush-patni added the team/e2e E2E team related issues/PRs label Jan 17, 2025
7. Verify that the data persisted after cloning
"""
proj_obj = project_factory()
file_paths = ["/file.txt", "/new_file.txt"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not writing new data in the test. There is no need for new_file.txt here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existing_pvc_obj=res_snap_obj,
namespace=vm_obj.namespace,
storageclass=vm_obj.sc_name,
)[-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indexing was removed in the cnv_workload fixture, please rebase your PR to pull the latest code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# Clone the restored VM
res_vm_obj_clone = clone_vm_workload(
res_vm_obj, namespace=vm_obj.namespace
)[-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indexing was removed in the clone_vm_workload fixture, please rebase your PR to pull the latest code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -119,3 +119,76 @@ def test_vm_snapshot_ops(
source_csum == res_csum
), f"Failed: MD5 comparison between source {vm_obj.name} and cloned {res_vm_obj.name} VMs"
res_vm_obj.stop()

@workloads
@pytest.mark.polarion_id("OCS-")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a testcase in polarion and add its id here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

assert source_csum == res_csum, (
f"Failed: MD5 comparison between source {vm_obj.name} and cloned "
f"{res_vm_obj.name} VMs"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add new data in cloned vm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

4. Deploy a new VM using the restored snapshot PVC
5. Clone the VM workload to create a new PVC from the restored snapshot PVC
6. Check data integrity in the cloned VM
7. Verify that the data persisted after cloning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add step which we added at last

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

size=vm_obj.pvc_size,
volume_mode=snap_obj.parent_volume_mode,
access_mode=vm_obj.pvc_access_mode,
status=constants.STATUS_BOUND,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default is constants.STATUS_BOUND

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: apatni-cnv-snap3
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/functional/workloads/cnv/test_vm_snapshot_cloning_ops.py::TestVmSnapshotClone::test_vm_snapshot_pvc_clone
Additional Test Params:
OCP VERSION: 4.18
OCS VERSION: 4.18
tested against branch: master

Job UNSTABLE (some or all tests failed).

Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: apatni-cnv-snap3
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/functional/workloads/cnv/test_vm_snapshot_cloning_ops.py::TestVmSnapshotClone::test_vm_snapshot_pvc_clone
Additional Test Params:
OCP VERSION: 4.18
OCS VERSION: 4.18
tested against branch: master

Job UNSTABLE (some or all tests failed).

AYUSH-D-PATNI and others added 8 commits January 23, 2025 15:18
Signed-off-by: AYUSH-D-PATNI <[email protected]>
Signed-off-by: AYUSH-D-PATNI <[email protected]>
Signed-off-by: AYUSH-D-PATNI <[email protected]>
Signed-off-by: AYUSH-D-PATNI <[email protected]>
AYUSH-D-PATNI added 8 commits January 23, 2025 15:18
@ayush-patni ayush-patni requested a review from a team as a code owner January 23, 2025 09:51
Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: apatni-cnv-snap3
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/functional/workloads/cnv/test_vm_snapshot_cloning_ops.py::TestVmSnapshotClone::test_vm_snapshot_pvc_clone
Additional Test Params:
OCP VERSION: 4.18
OCS VERSION: 4.18
tested against branch: master

Job UNSTABLE (some or all tests failed).

Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: apatni-cnv-snap3
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/functional/workloads/cnv/test_vm_snapshot_cloning_ops.py::TestVmSnapshotClone::test_vm_snapshot_pvc_clone
Additional Test Params:
OCP VERSION: 4.18
OCS VERSION: 4.18
tested against branch: master

Job PASSED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M PR that changes 30-99 lines team/e2e E2E team related issues/PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants