Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Mahesh Shetty <[email protected]>
  • Loading branch information
mashetty330 committed Jul 16, 2024
1 parent 97242a7 commit ea5d88f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ DEPLOYMENT:
dummy_zone_node_labels: true
network_split_setup: true
network_zone_latency: 5
cnv_deployment: True
ENV_DATA:
platform: 'vsphere'
deployment_type: 'upi'
Expand Down
5 changes: 5 additions & 0 deletions ocs_ci/framework/pytest_customization/marks.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@
reason="Test runs only on Stretch cluster with arbiter deployments",
)

cnv_required = pytest.mark.skipif(
config.DEPLOYMENT.get("cnv_deployment") is False,
reason="Test runs only on CNV deployed clusters",
)

sts_deployment_required = pytest.mark.skipif(
config.DEPLOYMENT.get("sts_enabled") is False,
reason="Test runs only on the AWS STS enabled cluster deployments",
Expand Down
2 changes: 1 addition & 1 deletion ocs_ci/ocs/resources/stretchcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def check_for_data_loss(self, label):
return True

@retry(CommandFailed, tries=15, delay=5)
def check_ceph_accessibility(self, timeout, delay=5, grace=15):
def check_ceph_accessibility(self, timeout, delay=5, grace=120):
"""
Check for ceph access for the 'timeout' seconds
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7834,6 +7834,8 @@ def setup_vms_standalone_pvc(request, project_factory):
vm_obj = None

def factory():

nonlocal vm_obj
project_obj = project_factory()
log.info(f"Created project {project_obj.namespace} for VMs")
vm_obj = create_vm_using_standalone_pvc(
Expand Down
18 changes: 8 additions & 10 deletions tests/functional/disaster-recovery/sc_arbiter/test_netsplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
turquoise_squad,
tier1,
stretchcluster_required,
cnv_required,
)
from ocs_ci.helpers.stretchcluster_helper import (
recover_workload_pods_post_recovery,
Expand All @@ -35,6 +36,7 @@

@tier1
@stretchcluster_required
@cnv_required
@turquoise_squad
class TestNetSplit:
@pytest.fixture()
Expand Down Expand Up @@ -63,10 +65,10 @@ def finalizer():
@pytest.mark.parametrize(
argnames="zones, duration",
argvalues=[
pytest.param(constants.NETSPLIT_DATA_1_DATA_2, 13),
pytest.param(constants.NETSPLIT_ARBITER_DATA_1, 13),
pytest.param(constants.NETSPLIT_ARBITER_DATA_1_AND_ARBITER_DATA_2, 13),
pytest.param(constants.NETSPLIT_ARBITER_DATA_1_AND_DATA_1_DATA_2, 13),
pytest.param(constants.NETSPLIT_DATA_1_DATA_2, 15),
pytest.param(constants.NETSPLIT_ARBITER_DATA_1, 15),
pytest.param(constants.NETSPLIT_ARBITER_DATA_1_AND_ARBITER_DATA_2, 15),
pytest.param(constants.NETSPLIT_ARBITER_DATA_1_AND_DATA_1_DATA_2, 15),
],
ids=[
"Data-1-Data-2",
Expand Down Expand Up @@ -117,16 +119,12 @@ def test_netsplit(
) = setup_logwriter_cephfs_workload_factory(read_duration=(duration + 10))
logger.info("Workloads are running")

# Generate 5 minutes worth of logs before inducing the netsplit
logger.info("Generating 2 mins worth of log")
time.sleep(120)

# setup vm and write some data to the VM instance
vm_obj = setup_vms_standalone_pvc()
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 = vm_obj.run_ssh_cmd(command="md5sum /file_1.txt")

# note all the pod names
sc_obj.get_logwriter_reader_pods(label=constants.LOGWRITER_CEPHFS_LABEL)
Expand Down Expand Up @@ -171,7 +169,7 @@ def test_netsplit(
logger.info(f"Ended netsplit at {end_time}")

# check vm data written before the failure for integrity
md5sum_after = vm_obj.run_ssh_cmd(command="md5sum ./file_1.txt")
md5sum_after = vm_obj.run_ssh_cmd(command="md5sum /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 ea5d88f

Please sign in to comment.