Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Mahesh Shetty <[email protected]>
  • Loading branch information
Mahesh Shetty authored and Mahesh Shetty committed Dec 11, 2024
1 parent 08fb694 commit 6b62d57
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
stretchcluster_required,
turquoise_squad,
)
from ocs_ci.helpers.cnv_helpers import cal_md5sum_vm
from ocs_ci.helpers.helpers import modify_deployment_replica_count
from ocs_ci.helpers.stretchcluster_helper import recover_workload_pods_post_recovery
from ocs_ci.ocs.exceptions import UnexpectedBehaviour
Expand Down Expand Up @@ -142,14 +143,14 @@ def setup_cnv_workload(request, cnv_workload, setup_cnv):
logger.info("Setting up CNV workload and creating some data")
vm_obj = cnv_workload(volume_interface=constants.VM_VOLUME_PVC)[0]
vm_obj.run_ssh_cmd(command="dd if=/dev/zero of=/file_1.txt bs=1024 count=102400")
md5sum_before = vm_obj.run_ssh_cmd(command="md5sum /file_1.txt")
md5sum_before = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")

def finalizer():

# check vm data written before the failure for integrity
logger.info("Waiting for VM SSH connectivity!")
vm_obj.wait_for_ssh_connectivity()
md5sum_after = vm_obj.run_ssh_cmd(command="md5sum /file_1.txt")
md5sum_after = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")
assert (
md5sum_before == md5sum_after
), "Data integrity of the file inside VM is not maintained during the failure"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
tier1,
stretchcluster_required,
)
from ocs_ci.helpers.cnv_helpers import cal_md5sum_vm
from ocs_ci.helpers.stretchcluster_helper import (
check_for_logwriter_workload_pods,
recover_from_ceph_stuck,
Expand Down Expand Up @@ -149,7 +150,7 @@ def test_netsplit(
vm_obj.run_ssh_cmd(
command="dd if=/dev/zero of=/file_1.txt bs=1024 count=102400"
)
md5sum_before = vm_obj.run_ssh_cmd(command="md5sum /file_1.txt")
md5sum_before = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")

# note all the pod names
check_for_logwriter_workload_pods(sc_obj, nodes=nodes)
Expand Down Expand Up @@ -186,7 +187,7 @@ def test_netsplit(
# check vm data written before the failure for integrity
logger.info("Waiting for VM SSH connectivity!")
vm_obj.wait_for_ssh_connectivity()
md5sum_after = vm_obj.run_ssh_cmd(command="md5sum /file_1.txt")
md5sum_after = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")
assert (
md5sum_before == md5sum_after
), "Data integrity of the file inside VM is not maintained during the failure"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import concurrent.futures as futures
from datetime import datetime, timezone, timedelta

from ocs_ci.helpers.cnv_helpers import cal_md5sum_vm
from ocs_ci.helpers.stretchcluster_helper import (
recover_from_ceph_stuck,
check_for_logwriter_workload_pods,
Expand Down Expand Up @@ -187,7 +188,7 @@ def test_zone_shutdowns(
vm_obj.run_ssh_cmd(
command="dd if=/dev/zero of=/file_1.txt bs=1024 count=102400"
)
md5sum_before = vm_obj.run_ssh_cmd(command="md5sum /file_1.txt")
md5sum_before = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")

start_time = None
end_time = None
Expand Down Expand Up @@ -287,7 +288,7 @@ def test_zone_shutdowns(
time.sleep(delay * 60)

# check vm data written before the failure for integrity
md5sum_after = vm_obj.run_ssh_cmd(command="md5sum /file_1.txt")
md5sum_after = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")
assert (
md5sum_before == md5sum_after
), "Data integrity of the file inside VM is not maintained during the failure"
Expand Down Expand Up @@ -427,7 +428,7 @@ def test_zone_crashes(
vm_obj.run_ssh_cmd(
command="dd if=/dev/zero of=/file_1.txt bs=1024 count=102400"
)
md5sum_before = vm_obj.run_ssh_cmd(command="md5sum /file_1.txt")
md5sum_before = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")

for i in range(iteration):
log.info(f"------ Iteration {i+1} ------")
Expand Down Expand Up @@ -514,7 +515,7 @@ def test_zone_crashes(
time.sleep(delay * 60)

# check vm data written before the failure for integrity
md5sum_after = vm_obj.run_ssh_cmd(command="md5sum /file_1.txt")
md5sum_after = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")
assert (
md5sum_before == md5sum_after
), "Data integrity of the file inside VM is not maintained during the failure"
Expand Down

0 comments on commit 6b62d57

Please sign in to comment.