Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Amrita Mahapatra <[email protected]>
  • Loading branch information
amr1ta committed Jun 14, 2024
1 parent efea5ed commit 5d81873
Showing 1 changed file with 23 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,62 +1,51 @@
import logging
import pytest
import time

from ocs_ci.ocs.resources import pod
from ocs_ci.ocs import constants, ocp
from ocs_ci.framework import config
from ocs_ci.framework.testlib import (
skipif_ocs_version,
ManageTest,
tier1,
tier4c,
skipif_ocp_version,
skipif_managed_service,
runs_on_provider,
skipif_external_mode,
green_squad,
yellow_squad,
)
from ocs_ci.ocs.ui.validation_ui import ValidationUI

log = logging.getLogger(__name__)


@tier1
@green_squad
@tier4c
@yellow_squad
@skipif_ocs_version("<4.15")
@skipif_ocp_version("<4.15")
@skipif_external_mode
@runs_on_provider
@skipif_managed_service
class TestOnboardingTokenGeneration(ManageTest):
@pytest.fixture(autouse=True)
def setup(self, request):
def test_ux_server_pod_respin_for_provider_cluster(self):
"""
Resetting the default value of KeyRotation
"""
self.pod_obj = ocp.OCP(
kind="Pod", namespace=config.ENV_DATA["cluster_namespace"]
)
Test to verify that ux-backend-server pod is up and running for provider cluster.
And it is respinned successfully
def test_ux_server_pod_is_running(self):
"""
Test to verify that ux-backend-server pod is up and running.
Steps:
1. Check ux-backend-server pod is up for provider cluster
2. Delete ux-backend-server pod
3. Check ux-backend-server pod is respinned.
"""
assert self.pod_obj.wait_for_resource(
pod_obj = ocp.OCP(kind="Pod", namespace=config.ENV_DATA["cluster_namespace"])
# Check ux-backend-server pod is up for provider cluster
assert pod_obj.wait_for_resource(
condition=constants.STATUS_RUNNING,
selector=constants.UX_BACKEND_SERVER_LABEL,
resource_count=1,
timeout=180,
), "ux pod is not in running state as expected"
timeout=120,
), "ux-backend-server pod is not in running state as expected"

def test_respin_of_ux_server_pod(self):
"""
Test to verify the respin of ux pod.
Steps:
1. navigate to storage-->storage clients page
2. check Generate client onboarding token option is available
3. user can generate onboarding token by selecting this option.
"""
# Respin ux-backend-server pod
ux_pod = pod.get_pods_having_label(
label=constants.UX_BACKEND_SERVER_LABEL,
Expand All @@ -65,8 +54,13 @@ def test_respin_of_ux_server_pod(self):
ux_pod_obj = pod.Pod(**ux_pod[0])

ux_pod_obj.delete()
log.info("wait some time for another ux-backend-server pod to come up")
time.sleep(30)
assert pod_obj.wait_for_resource(
condition=constants.STATUS_RUNNING,
selector=constants.UX_BACKEND_SERVER_LABEL,
resource_count=1,
timeout=60,
), "ux-backend-server pod is not in running state as expected"

ux_pod = pod.get_pods_having_label(
label=constants.UX_BACKEND_SERVER_LABEL,
namespace=config.ENV_DATA["cluster_namespace"],
Expand Down

0 comments on commit 5d81873

Please sign in to comment.