Skip to content

Commit

Permalink
Updating the PR with teardown function
Browse files Browse the repository at this point in the history
Signed-off-by: pintojoy <[email protected]>
  • Loading branch information
pintojoy committed May 21, 2024
1 parent 69bc356 commit ee78076
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
16 changes: 12 additions & 4 deletions tests/functional/z_cluster/cluster_expansion/test_add_capacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
skipif_bm,
skipif_external_mode,
skipif_bmpsi,
tier4b,
skipif_ibm_power,
skipif_no_lso,
skipif_lso,
Expand Down Expand Up @@ -219,15 +220,16 @@ def test_add_capacity_pre_upgrade(self, reduce_and_resume_cluster_load):
@brown_squad
@ignore_leftovers
@pytest.mark.second_to_last
@skipif_managed_service
@skipif_aws_i3
@skipif_bm
@skipif_bmpsi
@skipif_lso
@skipif_external_mode
@skipif_ibm_power
@skipif_managed_service
@skipif_hci_provider_and_client
@skipif_no_lso
@skipif_stretch_cluster
@tier4b
@pytest.mark.polarion_id("OCS-XXXX")
@pytest.mark.parametrize(
argnames=["recovery_profile"],
Expand All @@ -239,7 +241,8 @@ def test_add_capacity_pre_upgrade(self, reduce_and_resume_cluster_load):
)
class TestAddCapacityRecoveryProfile(ManageTest):
"""
Add capacity on lso cluster
Add capacity on non-lso cluster
"""

@pytest.fixture(autouse=True)
Expand Down Expand Up @@ -312,6 +315,7 @@ def setup(self, recovery_profile, multi_pvc_factory, pod_factory):
logger.error("After 3600 seconds the used capacity smaller than 30%")
raise TimeoutExpiredError

@pytest.fixture(autouse=True)
def teardown(self):
"""
teardown function, Setting recovery-profile back to balanced.
Expand All @@ -338,6 +342,10 @@ def test_add_capacity_recovery_profile_cli(self, reduce_and_resume_cluster_load)

def test_add_capacity_recovery_profile_ui(self, reduce_and_resume_cluster_load):
"""
Add capacity on lso cluster via UI on tier1 suite
Test setting the recovery profile by ODF CLI and run add capacity test.
Steps:
1. Set recovery-profile using ODF cli tool
2. Verify recovery profile from the ceph toolbox pod
3. Add capacity test via UI
"""
add_capacity_test(ui_flag=True)
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
skipif_hci_provider_and_client,
skipif_bmpsi,
bugzilla,
tier4b,
skipif_external_mode,
skipif_ms_consumer,
skipif_hci_client,
Expand Down Expand Up @@ -356,7 +357,7 @@ def test_nodereplacement_twice(self):


@brown_squad
@tier4a
@tier4b
@ignore_leftovers
@ipi_deployment_required
@skipif_managed_service
Expand All @@ -377,6 +378,18 @@ def init_sanity(self):
"""
self.sanity_helpers = Sanity()

@pytest.fixture(autouse=True)
def teardown(self):
"""
teardown function, Setting recovery-profile back to balanced.
"""
assert odf_cli_set_recover_profile("balanced")
logger.info(
"Fetching ceph osd_mclock_profile/recovery profile using odf-cli tool."
)
a = get_ceph_recovery_profile()
logger.info(f"Applied recovery profile on ceph cluster is {a}")

@pytest.mark.polarion_id("OCS-XXXX")
@pytest.mark.parametrize(
argnames=["recovery_profile"],
Expand Down

0 comments on commit ee78076

Please sign in to comment.