Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.16] login_ui and namespace selection for rosa hcp clusters #11059

Open
wants to merge 7 commits into
base: release-4.16
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions conf/deployment/aws/rosa_hcp_1az_3w_m5.12x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DEPLOYMENT:
allow_lower_instance_requirements: false
RUN:
username: 'cluster-admin'
ENV_DATA:
platform: 'rosa_hcp'
deployment_type: 'managed'
region: 'us-west-2'
worker_availability_zones:
- 'us-west-2a'
worker_replicas: 3
worker_instance_type: 'm5.12xlarge'
cluster_namespace: "odf-storage"
13 changes: 13 additions & 0 deletions conf/deployment/aws/rosa_hcp_1az_6w_m5.2x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DEPLOYMENT:
allow_lower_instance_requirements: false
RUN:
username: 'cluster-admin'
ENV_DATA:
platform: 'rosa_hcp'
deployment_type: 'ipi'
region: 'us-west-2'
worker_availability_zones:
- 'us-west-2a'
worker_replicas: 6
worker_instance_type: 'm5.2xlarge'
cluster_namespace: "odf-storage"
16 changes: 12 additions & 4 deletions ocs_ci/ocs/ui/base_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ def login_ui(console_url=None, username=None, password=None, **kwargs):

username_el = wait_for_element_to_be_clickable(login_loc["username"], 60)
if username is None:
username = constants.KUBEADMIN
username = config.RUN["username"]
username_el.send_keys(username)

password_el = wait_for_element_to_be_clickable(login_loc["password"], 60)
Expand All @@ -982,11 +982,15 @@ def login_ui(console_url=None, username=None, password=None, **kwargs):
confirm_login_el = wait_for_element_to_be_clickable(login_loc["click_login"], 60)
confirm_login_el.click()

hci_platform_conf_confirmed = (
hci_platform_conf = (
config.ENV_DATA["platform"].lower() in HCI_PROVIDER_CLIENT_PLATFORMS
)

if hci_platform_conf_confirmed:
platform_rosa_hcp = (
config.ENV_DATA["platform"].lower() == constants.ROSA_HCP_PLATFORM
)

if hci_platform_conf:
dashboard_url = console_url + "/dashboards"
# automatically proceed to load-cluster if test marked with provider decorator
if (
Expand All @@ -1009,7 +1013,11 @@ def login_ui(console_url=None, username=None, password=None, **kwargs):
if default_console is True and username is constants.KUBEADMIN:
wait_for_element_to_be_visible(page_nav_loc["page_navigator_sidebar"], 180)

if username is not constants.KUBEADMIN and not hci_platform_conf_confirmed:
if (
username is not constants.KUBEADMIN
and not hci_platform_conf
and not platform_rosa_hcp
):
# OCP 4.14 and OCP 4.15 observed default user role is an admin
skip_tour_el = wait_for_element_to_be_clickable(login_loc["skip_tour"], 180)
skip_tour_el.click()
Expand Down
7 changes: 4 additions & 3 deletions ocs_ci/ocs/ui/validation_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,12 @@ def odf_console_plugin_check(self):
if default_projects_is_checked.get_attribute("data-checked-state") == "false":
logger.info("Show default projects")
self.do_click(self.validation_loc["show-default-projects"])
logger.info("Search for 'openshift-storage' project")
logger.info("Search for '%s' project", config.ENV_DATA["cluster_namespace"])
self.do_send_keys(
self.validation_loc["project-search-bar"], text="openshift-storage"
self.validation_loc["project-search-bar"],
text=config.ENV_DATA["cluster_namespace"],
)
logger.info("Select 'openshift-storage' project")
logger.info("Select '%s' project", config.ENV_DATA["cluster_namespace"])
time.sleep(2)
self.do_click(
self.dep_loc["choose_openshift-storage_project"], enable_screenshot=True
Expand Down
8 changes: 5 additions & 3 deletions ocs_ci/ocs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from libcloud.compute.types import Provider
from paramiko.ssh_exception import SSHException

from ocs_ci.framework import config as ocsci_config
from ocs_ci.framework import config as ocsci_config, config
from ocs_ci.ocs import constants
from ocs_ci.ocs.external_ceph import RolesContainer, Ceph, CephNode
from ocs_ci.ocs.clients import WinNode
Expand Down Expand Up @@ -878,12 +878,14 @@ def setup_ceph_toolbox(force_setup=False, storage_cluster=None):
# https://github.com/openshift/ocs-operator/pull/207/
log.info("starting ceph toolbox pod")
cmd = (
f"oc patch storagecluster {storage_cluster} -n openshift-storage --type "
f"oc patch storagecluster {storage_cluster} -n {config.ENV_DATA['cluster_namespace']} --type "
'json --patch \'[{ "op": "replace", "path": '
'"/spec/enableCephTools", "value": true }]\''
)
run_cmd(cmd)
toolbox_pod = OCP(kind=constants.POD, namespace=namespace)
toolbox_pod = OCP(
kind=constants.POD, namespace=config.ENV_DATA["cluster_namespace"]
)
toolbox_pod.wait_for_resource(
condition="Running",
selector="app=rook-ceph-tools",
Expand Down
2 changes: 1 addition & 1 deletion ocs_ci/utility/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ def __init__(self, user=None, password=None, threading_lock=None):
self._password = password
self._threading_lock = threading_lock
self.refresh_connection()
# TODO: generate certificate for IBM cloud platform
if (
not config.ENV_DATA["platform"].lower() == "ibm_cloud"
and not config.ENV_DATA["platform"].lower() == constants.ROSA_HCP_PLATFORM
and config.ENV_DATA["deployment_type"] == "managed"
):
self.generate_cert()
Expand Down
Loading