Skip to content

Commit

Permalink
Test if pv-pool backingstore reaching rejected phase in FIPS cluster (r…
Browse files Browse the repository at this point in the history
…ed-hat-storage#9264)


Signed-off-by: Mahesh Shetty <[email protected]>
  • Loading branch information
mashetty330 authored Feb 8, 2024
1 parent 25a1490 commit af8da41
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
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 @@ -185,6 +185,11 @@
reason="This test cannot run on MCG-Only deployments",
)

fips_required = pytest.mark.skipif(
config.ENV_DATA.get("fips") != "true",
reason="Test runs only on FIPS enabled cluster",
)

stretchcluster_required = pytest.mark.skipif(
config.DEPLOYMENT.get("arbiter_deployment") is False,
reason="Test runs only on Stretch cluster with arbiter deployments",
Expand Down
1 change: 1 addition & 0 deletions ocs_ci/ocs/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
# NooBaa statuses
BS_AUTH_FAILED = "AUTH_FAILED"
BS_OPTIMAL = "OPTIMAL"
BS_REJECTED = "REJECTED"
HEALTHY_OB = "OPTIMAL"
HEALTHY_OBC = STATUS_BOUND
HEALTHY_OBC_CLI_PHASE = "Phase:Bound"
Expand Down
36 changes: 36 additions & 0 deletions tests/functional/object/mcg/test_pv_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
red_squad,
runs_on_provider,
mcg,
fips_required,
)

from ocs_ci.ocs.bucket_utils import (
Expand All @@ -24,6 +25,7 @@
wait_for_pods_to_be_running,
get_pod_node,
get_pod_logs,
get_noobaa_core_pod,
)
from ocs_ci.ocs.resources.objectbucket import OBC
from ocs_ci.ocs.constants import MIN_PV_BACKINGSTORE_SIZE_IN_GB, CEPHBLOCKPOOL_SC
Expand All @@ -33,6 +35,7 @@
from ocs_ci.ocs.bucket_utils import (
copy_random_individual_objects,
)
from ocs_ci.ocs import constants

logger = logging.getLogger(__name__)
LOCAL_DIR_PATH = "/awsfiles"
Expand Down Expand Up @@ -346,3 +349,36 @@ def test_ephemeral_for_pv_bs(self, backingstore_factory):
assert (
"test_object" in search_output
), "Dummy data was not found in the node ephemeral storage!"

@fips_required
@tier2
@bugzilla("2247731")
@polarion_id("OCS-5422")
def test_pvpool_bs_in_fips(self, backingstore_factory):
"""
Create PV pool based backingstore and make sure the backingstore doesn't
goto Rejected phase on noobaa-core pod restarts
"""
# create pv-pool backingstore
pv_backingstore = backingstore_factory(
"OC",
{"pv": [(1, MIN_PV_BACKINGSTORE_SIZE_IN_GB, CEPHBLOCKPOOL_SC)]},
)[0]

# restart noobaa-core pod
get_noobaa_core_pod().delete()

# wait for about 10 mins to check if
# the backingstore has reached Rejected state
pv_bs_obj = OCP(
kind=constants.BACKINGSTORE,
namespace=constants.OPENSHIFT_STORAGE_NAMESPACE,
resource_name=pv_backingstore.name,
)
assert pv_bs_obj.wait_for_resource(
condition="Ready", column="PHASE", timeout=600, sleep=5
), "Pv pool backingstore reached rejected phase after noobaa core pod restart"
logger.info(
"Pv pool backingstore didnt goto Rejected phase after noobaa-core pod restarts"
)

0 comments on commit af8da41

Please sign in to comment.