Skip to content

Commit

Permalink
Added support to install rhods on PSI with git repo (#474)
Browse files Browse the repository at this point in the history
* revert

Signed-off-by: Tarun Kumar <[email protected]>

* global_var

Signed-off-by: Tarun Kumar <[email protected]>

* added teardonw and url support

Signed-off-by: Tarun Kumar <[email protected]>

* fix typo

Signed-off-by: Tarun Kumar <[email protected]>

* added rc verfication

Signed-off-by: Tarun Kumar <[email protected]>

* remove OSd install

Signed-off-by: Tarun Kumar <[email protected]>

* remove redirected output

Signed-off-by: Tarun Kumar <[email protected]>
  • Loading branch information
tarukumar authored Jul 28, 2022
1 parent 3863473 commit f83152a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 33 deletions.
13 changes: 10 additions & 3 deletions tasks/Resources/RHODS_OLM/install/install.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ Installing RHODS Operator ${operator_version}
Run Keyword Unless ${is_operator_installed} Run Keywords
... Log Installing RHODS operator in ${cluster_type} console=yes AND
... Set Suite Variable ${operator_version} AND
... Install RHODS ${operator_version}

... Set Test Variable ${RHODS_INSTALL_REPO} AND
... Install RHODS ${operator_version} ${cluster_type}

RHODS Operator Should Be installed
Verify RHODS Installation
${version} = Get RHODS Version
Set Global Variable ${RHODS_VERSION} ${version}
Log RHODS has been installed console=yes
Log RHODS has been installed console=yes

Install Teardown
[Documentation] Remove cloned git repository
[Arguments] ${folder_name}= ${filename}
${return_code} Run And Return Rc rm -rf ${EXECDIR}/${filename}
Should Be Equal As Integers ${return_code} 0
58 changes: 36 additions & 22 deletions tasks/Resources/RHODS_OLM/install/oc_install.robot
Original file line number Diff line number Diff line change
@@ -1,33 +1,46 @@
*** Settings ***
Library String
*** Keywords ***
Install RHODS
[Arguments] ${operator_version}
New Project redhat-ods-monitoring
New Project redhat-ods-applications
New Project redhat-ods-operator
Oc Apply kind=Secret src=${RHODS_BUILD.PULL_SECRET} namespace=openshift-marketplace
Oc Apply kind=Secret src=${RHODS_BUILD.SECRET_FILE}
&{image}= Create Dictionary image=quay.io/modh/qe-catalog-source:${operator_version}
Oc Create kind=List src=tasks/Resources/RHODS_OLM/install/catalogsource.yaml
... template_data=${image}
Install RHODS
[Arguments] ${operator_version} ${cluster_type} ${operator_url}=${EMPTY}
IF "${cluster_type}" == "PSI" or "${cluster_type}" == "OSD"
${status} Run Keyword And Return Status Should Start With ${operator_version} v
IF ${status}==True
Set Local Variable ${operator_url} quay.io/modh/qe-catalog-source:${operator_version}
ELSE
Should Start With ${operator_version} quay.io msg=you should provide the full build link
Set Local Variable ${operator_url} ${operator_version}
END
${data} Split String ${RHODS_INSTALL_REPO} /
${filename} Split String ${data}[-1] .
Set Test Variable ${filename} ${filename}[0]
${return_code} Run And Return Rc git clone ${RHODS_INSTALL_REPO}
Should Be Equal As Integers ${return_code} 0
${return_code} ${output} Run And Return Rc And Output cd ${EXECDIR}/${filename} && ./setup.sh ${operator_url} #robocop:disable
Should Be Equal As Integers ${return_code} 0
Log ${output}
ELSE
FAIL Provided cluster type is not supported, Kindly check and provide correct cluster type.
END

Verify RHODS Installation
Log Verifying RHODS installation console=yes
Wait For Pods Number 1
... namespace=redhat-ods-operator
... label_selector=name=rhods-operator
... label_selector=name=rhods-operator
... timeout=2000
Log pod operator created
Wait For Pods Number 2
Wait For Pods Number 2
... namespace=redhat-ods-applications
... label_selector=app=rhods-dashboard
... timeout=1200
... label_selector=app=rhods-dashboard
... timeout=1200
Log pods rhods-dashboard created
Wait For Pods Number 3
Wait For Pods Number 3
... namespace=redhat-ods-applications
... label_selector=app=jupyterhub
... timeout=1200
Wait For Pods Number 4
... namespace=redhat-ods-monitoring
... label_selector=app=jupyterhub
... timeout=1200
Wait For Pods Number 4
... namespace=redhat-ods-monitoring
... timeout=1200
Verify Builds In redhat-ods-applications
Wait For Pods Status namespace=redhat-ods-applications timeout=60
Expand All @@ -52,12 +65,13 @@ Verify Builds Number
Should Be Equal As Integers ${build_length} ${expected_builds}
[Return] ${builds}

Verify Builds Status
Verify Builds Status
[Arguments] ${build_status}
@{builds}= Oc Get kind=Build namespace=redhat-ods-applications
FOR ${build} IN @{builds}
Should Be Equal As Strings ${build}[status][phase] ${build_status}
Should Be Equal As Strings ${build}[status][phase] ${build_status}
Should Not Be Equal As Strings ${build}[status][phase] Cancelled
Should Not Be Equal As Strings ${build}[status][phase] Failed
Should Not Be Equal As Strings ${build}[status][phase] Error
END
END

17 changes: 9 additions & 8 deletions tasks/Tasks/rhods_olm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@
Documentation Perform and verify RHODS OLM tasks
Metadata RHODS OLM Version 1.0.0
Resource ../Resources/RHODS_OLM/RHODS_OLM.resource
Library OpenShiftCLI

Library OpenShiftLibrary
Library OperatingSystem
***Variables***
${cluster_type} OSD
${operator_version} latest

${RHODS_INSTALL_REPO} None
*** Tasks ***
Can Install RHODS Operator
[Tags] install
Given Selected Cluster Type ${cluster_type}
Given Selected Cluster Type ${cluster_type}
When Installing RHODS Operator ${operator_version}
Then RHODS Operator Should Be Installed

[Teardown] Install Teardown

Can Uninstall RHODS Operator
[Tags] uninstall
Given Selected Cluster Type ${cluster_type}
When Uninstalling RHODS Operator
Then RHODS Operator Should Be Uninstalled

Can Upgrade RHODS Operator
[Tags] upgrade
... ODS-543
Given Selected Cluster Type ${cluster_type}
Given Selected Cluster Type ${cluster_type}
When Upgrading RHODS Operator ${operator_version}
Then RHODS Operator Should Be Upgraded
Then RHODS Operator Should Be Upgraded

0 comments on commit f83152a

Please sign in to comment.