diff --git a/tests/functional/workloads/cnv/test_vm_pvc_expansion.py b/tests/functional/workloads/cnv/test_vm_pvc_expansion.py index 1d29c8b2b02..622f165d5d8 100644 --- a/tests/functional/workloads/cnv/test_vm_pvc_expansion.py +++ b/tests/functional/workloads/cnv/test_vm_pvc_expansion.py @@ -4,6 +4,7 @@ from ocs_ci.framework.pytest_customization.marks import workloads, magenta_squad from ocs_ci.framework.testlib import E2ETest from ocs_ci.ocs import constants +from ocs_ci.helpers.cnv_helpers import cal_md5sum_vm, run_dd_io log = logging.getLogger(__name__) @@ -25,8 +26,18 @@ def test_pvc_expansion(self, cnv_workload): )[-1] vm_pvc_obj = vm_obj.get_vm_pvc_obj() log.info(vm_pvc_obj.size) - # Resize PVC to a random size between 31 and 35 GiB + # writing data to the PVC + file_paths = "/source_file.txt" + source_csum = run_dd_io(vm_obj=vm_obj, file_path=file_paths, verify=True) + log.info(source_csum) + # Resize PVC to a random size between 31 and 35 GiB as 30GiB is default new_size = random.randint(31, 35) - log.info(vm_pvc_obj.size) + log.info(f"Size of VM PVC before expansion: {vm_pvc_obj.size}") vm_pvc_obj.resize_pvc(new_size) - pass + log.info(f"Size of VM PVC after expansion: {vm_pvc_obj.size}") + res_csum = cal_md5sum_vm(vm_obj=vm_obj, file_path=file_paths) + log.info(res_csum) + assert source_csum == res_csum and vm_obj.get_vm_pvc_obj().size == new_size, ( + f"Failed: MD5 comparison of {vm_obj.name} before and after " + f"PVC expansion" + )