Skip to content

Commit 14cb575

Browse files
authored
remove explicit secret creation from RHOAM Interop test (#329)
* remove secrets creation Signed-off-by: bdattoma <[email protected]> * increase timeout for installation Signed-off-by: bdattoma <[email protected]> * replace fatal error with fail Signed-off-by: bdattoma <[email protected]> * remove unused lib Signed-off-by: bdattoma <[email protected]>
1 parent ac5750e commit 14cb575

File tree

5 files changed

+17
-54
lines changed

5 files changed

+17
-54
lines changed

libs/Helpers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from robot.api import logger
55
from robot.libraries.BuiltIn import BuiltIn
66

7+
78
class Helpers:
89
"""Custom keywords written in Python"""
910
def __init__(self):
@@ -47,7 +48,10 @@ def gte(self, version, target):
4748
def install_rhoam_addon(self, cluster_name):
4849
ocm_client = OpenshiftClusterManager()
4950
ocm_client.cluster_name = cluster_name
50-
ocm_client.install_rhoam_addon(exit_on_failure=False)
51+
result = ocm_client.install_rhoam_addon(exit_on_failure=False)
52+
if not result:
53+
self.BuiltIn.fail("Something got wrong while installing RHOAM. Check the logs")
54+
5155

5256
@keyword
5357
def uninstall_rhoam_using_addon_flow(self, cluster_name):

tests/Tests/600__ai_apps/640__rhoam/640__rhoam_installation.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RHOAM Install Suite Setup
3939
${CLUSTER_NAME}= Get Cluster Name By Cluster ID cluster_id=${cluster_id}
4040
Set Suite Variable ${CLUSTER_NAME}
4141
Install Rhoam Addon cluster_name=${CLUSTER_NAME}
42-
Wait Until RHOAM Installation Is Completed retries=35 retries_interval=2min
42+
Wait Until RHOAM Installation Is Completed retries=40 retries_interval=5min
4343
Verify RHOAM Is Enabled IN RHODS Dashboard
4444

4545
RHOAM Suite Teardown

utils/scripts/ocm/ocm.py

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -518,32 +518,13 @@ def install_rhoam_addon(self, exit_on_failure=True):
518518
failure_flags.append(failure)
519519
log.info("\nSetting the useClusterStorage parameter to 'false'")
520520
rhmi_found = self.is_oc_obj_existent(kind="rhmi", name="rhoam",
521-
namespace="redhat-rhoam-operato",
521+
namespace="redhat-rhoam-operator",
522522
retries=35, retry_sec_interval=3)
523523
if not rhmi_found:
524524
failure = True
525525
failure_flags.append(failure)
526526
if exit_on_failure:
527527
sys.exit(1)
528-
# rhmi_found = False
529-
# for retry in range(30):
530-
# cmd = ("""oc get rhmi rhoam -n redhat-rhoam-operator""")
531-
# log.info("CMD: {}".format(cmd))
532-
# ret = execute_command(cmd)
533-
# if ret is None or "Error" in ret:
534-
# log.info("Failed to get RHMI object. It may not be ready yet. Trying again in 3 seconds")
535-
# time.sleep(3)
536-
# continue
537-
# else:
538-
# log.info("RHMI object ready to be patched!")
539-
# rhmi_found = True
540-
# break
541-
# if not rhmi_found:
542-
# log.error("RHMI not found!")
543-
# failure = True
544-
# failure_flags.append(failure)
545-
# if exit_on_failure:
546-
# sys.exit(1)
547528

548529
cmd = ("""oc patch rhmi rhoam -n redhat-rhoam-operator \
549530
--type=merge --patch '{\"spec\":{\"useClusterStorage\": \"false\"}}'""")
@@ -557,40 +538,37 @@ def install_rhoam_addon(self, exit_on_failure=True):
557538
if exit_on_failure:
558539
sys.exit(1)
559540

560-
log.info("\nCreating a dms dummy secret...")
561-
cmd = "oc apply -f templates/dms.yaml"
562-
log.info("CMD: {}".format(cmd))
563-
ret = execute_command(cmd)
564-
log.info("\nRET: {}".format(ret))
541+
log.info("\nChecking dms secret exists...")
565542
res = self.is_secret_existent(secret_name="redhat-rhoam-deadmanssnitch",
566543
namespace="redhat-rhoam-operator")
567544
if res:
568545
failure_flags.append(False)
546+
log.info("redhat-rhoam-dms secret found!")
569547
else:
570548
failure_flags.append(True)
571-
log.info("Failed to create redhat-rhoam-deadmanssnitch secret")
549+
log.info("redhat-rhoam-deadmanssnitch secret was not created during installation")
572550
if exit_on_failure:
573551
sys.exit(1)
574552

575-
576-
log.info("\nCreating a smtp dummy secret...")
577-
cmd = "oc apply -f templates/smpt.yaml"
578-
log.info("CMD: {}".format(cmd))
579-
ret = execute_command(cmd)
580-
res = self.is_secret_existent(secret_name="redhat-rhoam-smpt",
553+
log.info("\nChecking smtp secret exists..")
554+
res = self.is_secret_existent(secret_name="redhat-rhoam-smtp",
581555
namespace="redhat-rhoam-operator")
582556
if res:
583557
failure_flags.append(False)
558+
log.info("redhat-rhoam-smpt secret found!")
584559
else:
585560
failure_flags.append(True)
586-
log.info("Failed to create redhat-rhoam-smpt secret")
561+
log.info("redhat-rhoam-smpt secret was not created during installation")
587562
if exit_on_failure:
588563
sys.exit(1)
589564

590565
if True in failure_flags:
591566
log.info("Something got wrong while installing RHOAM: "
592567
"thus system is not waiting for installation status."
593568
"\nPlease check the cluster and try again...")
569+
return False
570+
571+
return True
594572
# else:
595573
# self.wait_for_addon_installation_to_complete(addon_name="managed-api-service")
596574
else:

utils/scripts/ocm/templates/dms.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

utils/scripts/ocm/templates/smpt.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)