Update gitops01 to deploy 2 jenkins KSUs in same namespace and remove testapp OKA... 98/14998/3
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 26 Feb 2025 10:18:33 +0000 (11:18 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 4 Mar 2025 18:07:30 +0000 (19:07 +0100)
Change-Id: I869e4bed0bd0a1e687afb13284f3cf3b6877c1e6
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
robot-systest/lib/advanced_cluster_mgmt_lib.resource
robot-systest/testsuite/gitops_01-advanced_cluster_management.robot

index de9bb5d..dc1621d 100644 (file)
@@ -29,9 +29,9 @@ ${CLUSTER_DELETE_MAX_WAIT_TIME}   12min
 ${CLUSTER_DELETE_POL_TIME}   30sec
 ${OKA_OPERATION_MAX_WAIT_TIME}   5min
 ${OKA_OPERATION_POL_TIME}   15sec
-${KSU_CREATION_MAX_WAIT_TIME}   10min
+${KSU_CREATION_MAX_WAIT_TIME}   7min
 ${KSU_CREATION_POL_TIME}   30sec
-${KSU_DELETION_MAX_WAIT_TIME}   7min
+${KSU_DELETION_MAX_WAIT_TIME}   5min
 ${KSU_DELETION_POL_TIME}   15sec
 
 
@@ -187,9 +187,14 @@ Check For OKA To Be Deleted
 
 Create KSU
     [Documentation]   Create a KSU
-    [Arguments]   ${ksu_name}   ${ksu_description}   ${profile}   ${profile_type}   ${oka_name}   ${ksu_params_file}   ${wait_flag}=True
-    ${rc}   ${stdout}=   Run And Return Rc And Output
-    ...   osm ksu-create --ksu ${ksu_name} --description ${ksu_description} --profile ${profile} --profile-type ${profile_type} --oka ${oka_name} --params ${ksu_params_file}
+    [Arguments]   ${ksu_name}   ${ksu_description}   ${profile}   ${profile_type}   ${oka_name}   ${ksu_params_file}=${EMPTY}   ${wait_flag}=True
+    IF   "${ksu_params_file}" != "${EMPTY}"
+        ${rc}   ${stdout}=   Run And Return Rc And Output
+        ...   osm ksu-create --ksu ${ksu_name} --description ${ksu_description} --profile ${profile} --profile-type ${profile_type} --oka ${oka_name} --params ${ksu_params_file}
+    ELSE
+        ${rc}   ${stdout}=   Run And Return Rc And Output
+        ...   osm ksu-create --ksu ${ksu_name} --description ${ksu_description} --profile ${profile} --profile-type ${profile_type} --oka ${oka_name}
+    END
     Log   ${rc},${stdout}
     Should Be Equal As Integers   ${rc}   ${SUCCESS_RETURN_CODE}   msg=KSU creation failed: ${stdout}
     ${ksu_id}=   Set Variable   ${stdout}
index e308a58..b5ff991 100644 (file)
@@ -30,15 +30,15 @@ Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup
 *** Variables ***
 # OKA packages
 ${OKA_FOLDER}   '%{PACKAGES_FOLDER}/oka'
-${OKA_PKG1}   apps/testapp
-${OKA_NAME1}   testapp
-${OKA_PROFILE1}   app-profile
-${OKA_PKG2}   apps/testacme
-${OKA_NAME2}   testacme
-${OKA_PROFILE2}   app-profile
-${OKA_PKG3}   apps/jenkins
-${OKA_NAME3}   jenkins
-${OKA_PROFILE3}   app-profile
+${OKA1_PKG}   apps/testacme
+${OKA1_NAME}   testacme
+${OKA1_PROFILE}   app-profile
+${OKA2_PKG}   apps/jenkins
+${OKA2_NAME}   jenkins
+${OKA2_PROFILE}   app-profile
+${OKA_NS_PKG}   apps/namespace
+${OKA_NS_NAME}   namespace
+${OKA_NS_PROFILE}   app-profile
 
 # Cluster
 ${CLUSTER_NAME}   gitops01
@@ -50,18 +50,19 @@ ${RESOURCE_GROUP}   OSM-CTIO
 ${KUBERNETES_VERSION}   "1.30"
 
 # KSUs
-${KSU_NAME1}   testapp
-${KSU_NAME2}   testacme
-${KSU_NAME3}   jenkins
+${KSU1_NAME}   testacme
+${KSU_NS_NAME}   jenkins-ns
+${KSU2_NAME}   jenkins
+${KSU3_NAME}   jenkinsbis
 
 
 *** Test Cases ***
 Add OKA Packages For The Testsuite
     [Documentation]   Add OKA packages for the testsuite.
     [Tags]   oka   create
-    Add OKA Package   ${OKA_NAME1}   '${OKA_FOLDER}/${OKA_PKG1}'   ${OKA_PROFILE1}
-    Add OKA Package   ${OKA_NAME2}   '${OKA_FOLDER}/${OKA_PKG2}'   ${OKA_PROFILE2}
-    Add OKA Package   ${OKA_NAME3}   '${OKA_FOLDER}/${OKA_PKG3}'   ${OKA_PROFILE3}
+    Add OKA Package   ${OKA_NS_NAME}   '${OKA_FOLDER}/${OKA_NS_PKG}'   ${OKA_NS_PROFILE}
+    Add OKA Package   ${OKA1_NAME}   '${OKA_FOLDER}/${OKA1_PKG}'   ${OKA1_PROFILE}
+    Add OKA Package   ${OKA2_NAME}   '${OKA_FOLDER}/${OKA2_PKG}'   ${OKA2_PROFILE}
 
 Create Cluster For Testsuite in Azure
     [Documentation]   Create K8s cluster for the testsuite.
@@ -78,17 +79,53 @@ Get Cluster Kubeconfig
     Should Be Equal As Integers   ${rc}   ${SUCCESS_RETURN_CODE}
     Log   ${stdout}
 
-Create KSU3
-    [Documentation]   Create KSU3 based on ${OKA_NAME3} with params.
-    [Tags]   ksu   create
-    ${id}=   Create KSU   ${KSU_NAME3}   ${KSU_NAME3}   ${CLUSTER_NAME}   app-profile   ${OKA_NAME3}   ${OKA_FOLDER}/apps/jenkins-params.yaml
-    Set Suite Variable   ${KSU_ID3}   ${id}
-    Log   ${KSU_ID3}
+Create KSU1 Without Params
+    [Documentation]   Create KSU based on ${OKA1_NAME} without params.
+    [Tags]   ksu   ksu1   create
+    ${id}=   Create KSU   ${KSU1_NAME}   ${KSU1_NAME}   ${CLUSTER_NAME}   app-profile   ${OKA1_NAME}
+    Set Suite Variable   ${KSU1_ID}   ${id}
+    Log   ${KSU1_ID}
+
+Create KSU Namespace For KSU2 and KSU3
+    [Documentation]   Create KSU based on ${OKA_NS_NAME} with params.
+    [Tags]   ksu   ksu-ns   create
+    ${id}=   Create KSU   ${KSU_NS_NAME}   ${KSU_NS_NAME}   ${CLUSTER_NAME}   app-profile   ${OKA_NS_NAME}   ${OKA_FOLDER}/apps/jenkins-ns-params.yaml
+    Set Suite Variable   ${KSU_NS_ID}   ${id}
+    Log   ${KSU_NS_ID}
+
+Create KSU2 With Params
+    [Documentation]   Create KSU based on ${OKA2_NAME} with params.
+    [Tags]   ksu   ksu2   create
+    ${id}=   Create KSU   ${KSU2_NAME}   ${KSU2_NAME}   ${CLUSTER_NAME}   app-profile   ${OKA2_NAME}   ${OKA_FOLDER}/apps/jenkins-params.yaml
+    Set Suite Variable   ${KSU2_ID}   ${id}
+    Log   ${KSU2_ID}
+
+Create KSU3 With Params
+    [Documentation]   Create KSU based on ${OKA2_NAME} with same params as KSU2.
+    [Tags]   ksu   ksu3   create
+    ${id}=   Create KSU   ${KSU3_NAME}   ${KSU3_NAME}   ${CLUSTER_NAME}   app-profile   ${OKA2_NAME}   ${OKA_FOLDER}/apps/jenkins-params.yaml
+    Set Suite Variable   ${KSU3_ID}   ${id}
+    Log   ${KSU3_ID}
 
 Delete KSU3
-    [Documentation]   Delete KSU3 based on ${OKA_NAME3}.
-    [Tags]   cleanup   ksu
-    Delete KSU   ${KSU_ID3}
+    [Documentation]   Delete KSU3 based on ${OKA2_NAME}.
+    [Tags]   cleanup   ksu   ksu3
+    Delete KSU   ${KSU3_ID}
+
+Delete KSU2
+    [Documentation]   Delete KSU2 based on ${OKA2_NAME}.
+    [Tags]   cleanup   ksu   ksu2
+    Delete KSU   ${KSU2_ID}
+
+Delete KSU Namespace
+    [Documentation]   Delete KSU based on ${OKA_NS_NAME}.
+    [Tags]   cleanup   ksu   ksu-ns
+    Delete KSU   ${KSU_NS_ID}
+
+Delete KSU1
+    [Documentation]   Delete KSU1 based on ${OKA1_NAME}.
+    [Tags]   cleanup   ksu   ksu1
+    Delete KSU   ${KSU1_NAME}
 
 Delete Cluster For Testsuite
     [Documentation]   Delete K8s cluster for the testsuite.
@@ -98,15 +135,15 @@ Delete Cluster For Testsuite
 Delete OKA Packages For The Testsuite
     [Documentation]   Delete OKA packages for the testsuite.
     [Tags]   cleanup   oka
-    Delete OKA Package   ${OKA_NAME1}
-    Delete OKA Package   ${OKA_NAME2}
-    Delete OKA Package   ${OKA_NAME3}
+    Delete OKA Package   ${OKA_NS_NAME}
+    Delete OKA Package   ${OKA1_NAME}
+    Delete OKA Package   ${OKA2_NAME}
 
 
 *** Keywords ***
 Suite Cleanup
     [Documentation]   Test Suit Cleanup: Deleting cluster, KSUs, OKAs
     Run Keyword If Any Tests Failed   Delete Cluster   ${CLUSTER_NAME}
-    Run Keyword If Any Tests Failed   Delete OKA Package   ${OKA_NAME1}
-    Run Keyword If Any Tests Failed   Delete OKA Package   ${OKA_NAME2}
-    Run Keyword If Any Tests Failed   Delete OKA Package   ${OKA_NAME3}
+    Run Keyword If Any Tests Failed   Delete OKA Package   ${OKA_NS_NAME}
+    Run Keyword If Any Tests Failed   Delete OKA Package   ${OKA1_NAME}
+    Run Keyword If Any Tests Failed   Delete OKA Package   ${OKA2_NAME}