Skip to content

Commit

Permalink
Fix mon and osd failure test fixture usecase
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 12, 2024
1 parent eefe887 commit 6893ce7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7042,8 +7042,25 @@ def teardown():
return factory


@pytest.fixture(scope="class")
def cnv_workload_class(request):
"""
Class scoped fixture to deploy CNV workload
"""
return cnv_workload_factory(request)


@pytest.fixture()
def cnv_workload(request):
"""
Function scoped fixture to deploy CNV workload
"""
return cnv_workload_factory(request)


def cnv_workload_factory(request):
"""
Deploys CNV based workloads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ def finalizer():


@pytest.fixture(scope="class")
def setup_cnv_workload(request, cnv_workload, setup_cnv):
def setup_cnv_workload(request, cnv_workload_class, 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 = cnv_workload_class(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 = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")

Expand Down

0 comments on commit 6893ce7

Please sign in to comment.