Library String
Library OperatingSystem
Resource ../resources/global_properties.robot
-Resource ../resources/dcae/inventory.robot
-Resource ../resources/dcae/deployment.robot
+Resource chart_museum.robot
*** Variables ***
${DCAEMOD_ONBOARDING_API_SERVER} ${GLOBAL_DCAEMOD_ONBOARDING_API_SERVER_PROTOCOL}://${GLOBAL_DCAEMOD_ONBOARDING_API_SERVER_NAME}:${GLOBAL_DCAEMOD_ONBOARDING_API_SERVER_PORT}
${DCAEMOD_DESIGNTOOL_SERVER} ${GLOBAL_DCAEMOD_DESIGNTOOL_SERVER_PROTOCOL}://${GLOBAL_DCAEMOD_DESIGNTOOL_SERVER_NAME}:${GLOBAL_DCAEMOD_DESIGNTOOL_SERVER_PORT}
${DCAEMOD_DISTRIBUTOR_API_SERVER} ${GLOBAL_DCAEMOD_DISTRIBUTOR_API_SERVER_PROTOCOL}://${GLOBAL_DCAEMOD_DISTRIBUTOR_API_SERVER_NAME}:${GLOBAL_DCAEMOD_DISTRIBUTOR_API_SERVER_PORT}
+${HELM_RELEASE} kubectl --namespace onap get pods | sed 's/ .*//' | grep robot | sed 's/-.*//'
+
*** Keywords ***
Distribute The Flow ${PROCESS_GROUP_ID}
Set Test Variable ${IS_FLOW_DISTRIBUTED} True
- ${typeId} ${blueprintName} = Deploy Blueprint From Inventory ${processGroupName} ${compSpecName}
- Set Test Variable ${IS_SERVICE_DEPLOYED} True
- Set Test Variable ${TYPE_ID} ${typeId}
- Set Test Variable ${BLUEPRINT_NAME} ${blueprintName}
+ Deploy Applictaion ${processGroupName} ${compSpecName}
+ Set Test Variable ${CHART_NAME} ${compSpecName}
+
Delete Config Map With Mounted Config File
${resp} = Post Request distributor /distributor/distribution-targets/${DISTRIBUTION_TARGET_ID}/process-groups data=${data} headers=${headers}
Should Be True ${resp.status_code} < 300
-Deploy Blueprint From Inventory
- [Arguments] ${processGroupName} ${compSpecName}
- ${blueprintName} = Set Variable ${processGroupName}_${compSpecName}
- ${resp} = Wait Until Keyword Succeeds 7 min 20s Get Blueprint From Inventory ${blueprintName}
- ${typeId} = Set Variable ${resp.json().get('items')[0].get('typeId')}
- ${data} = Set Variable {"serviceTypeId": "${typeId}"}
- Deploy Service ${data} ${blueprintName} 10 minute
-
- [Return] ${typeId} ${blueprintName}
+Deploy Applictaion
+ [Arguments] ${processGroupName} ${compSpecName}
+ ${command_output} = Run And Return Rc And Output helm repo update
+ Should Be Equal As Integers ${command_output[0]} 0
+ ${helm_install}= Set Variable helm install ${ONAP_HELM_RELEASE}-${compSpecName} chart-museum/${compSpecName} --set global.repository=${registry_ovveride}
+ ${helm_install_command_output} = Run And Return Rc And Output ${helm_install}
+ Log ${helm_install_command_output[1]}
+ Should Be Equal As Integers ${helm_install_command_output[0]} 0
+ Set Test Variable ${IS_SERVICE_DEPLOYED} True
+ ${kubectl_patch}= Set Variable kubectl patch deployment ${ONAP_HELM_RELEASE}-${compSpecName} -p '{"spec":{"template":{"spec":{"containers":[{"name": "${compSpecName}","image":"docker.io/nginx:latest"}]}}}}'
+ ${kubectl_patch_command_output}= Run And Return Rc And Output ${kubectl_patch}
+ Log ${kubectl_patch_command_output[1]}
+ Should Be Equal As Integers ${kubectl_patch_command_output[0]} 0
+ Wait Until Keyword Succeeds 4 min 15s Check NGINX Applictaion ${compSpecName}
+
+Check NGINX Applictaion
+ [Arguments] ${compSpecName}
+ ${check_command}= Set Variable kubectl get pods -n onap | grep ${compSpecName} | grep Running | grep 1/1
+ ${check_command_command_output}= Run And Return Rc And Output ${check_command}
+ Log ${check_command_command_output[1]}
+ Should Be Equal As Integers ${check_command_command_output[0]} 0
+
+Undeploy Application
+ [Arguments] ${CHART_NAME}
+ Uninstall helm charts ${ONAP_HELM_RELEASE}-${CHART_NAME}
Get Process Group Revision
[Arguments] ${processGroupId}
Should Be True ${resp.status_code} < 300
Configure Nifi Registry And Distribution Target
+ Restart Runtime API
Add Registry Client
Add Distribution Target
+ Add chart repository chart-museum http://chart-museum:80 onapinitializer demo123456!
+ ${command_output} = Run And Return Rc And Output ${HELM_RELEASE}
+ Should Be Equal As Integers ${command_output[0]} 0
+ Set Global Variable ${ONAP_HELM_RELEASE} ${command_output[1]}
+
+Restart Runtime API
+ ${restart_command}= Set Variable kubectl delete pod $(kubectl get pods -n onap | grep dcaemod-runtime-api | awk '{print $1}') -n onap
+ ${restart_command_command_output}= Run And Return Rc And Output ${restart_command}
+ Log ${restart_command_command_output[1]}
+ Should Be Equal As Integers ${restart_command_command_output[0]} 0
+ Wait Until Keyword Succeeds 2 min 5s Check Runtime API
+
+Check Runtime API
+ ${check_command}= Set Variable kubectl get pods -n onap | grep dcaemod-runtime-api | grep Running | grep 1/1
+ ${check_command_command_output}= Run And Return Rc And Output ${check_command}
+ Log ${check_command_command_output[1]}
+ Should Be Equal As Integers ${check_command_command_output[0]} 0
Delete Nifi Registry And Distribution Target
Run Keyword If '${DISTRIBUTION_TARGET_ID}' != '${EMPTY}' Wait Until Keyword Succeeds 2 min 5s Delete Distribution Target
Run Keyword If '${REGISTRY_CLIENT_ID}' != '${EMPTY}' Wait Until Keyword Succeeds 2 min 5s Delete Registry Client
-Delete Process Group And Blueprint And Deployment
+Delete Process Group And Deployment
Run Keyword If ${IS_PROCESS_GROUP_SET} Run Keywords Delete Process Group ${PROCESS_GROUP_ID}
... AND Set Suite Variable ${IS_PROCESS_GROUP_SET} False
- Run Keyword If ${IS_FLOW_DISTRIBUTED} Run Keywords Delete Blueprint From Inventory ${TYPE_ID}
- ... AND Set Suite Variable ${IS_FLOW_DISTRIBUTED} False
- Run Keyword If ${IS_SERVICE_DEPLOYED} Run Keywords Undeploy Service ${BLUEPRINT_NAME}
+ Run Keyword If ${IS_SERVICE_DEPLOYED} Run Keywords Undeploy Application ${CHART_NAME}
... AND Set Suite Variable ${IS_SERVICE_DEPLOYED} False
\ No newline at end of file
Resource ../resources/dcaemod_interface.robot
Suite Setup Configure Nifi Registry And Distribution Target
Suite Teardown Delete Nifi Registry And Distribution Target
-Test Teardown Delete Process Group And Blueprint And Deployment
+Test Teardown Delete Process Group And Deployment
*** Variables ***
${podYaml} = Get Pod Yaml ${compSpecName}
Verify If Volume Is Mounted ${podYaml} ${volumeMountPath}
Verify If Config Map Is Mounted As Volume ${podYaml} ${configMapName}
- ${mountedFolderContent} = Get Content Of Mounted Folder Inside Container ${compSpecName} ${volumeMountPath}
+ ${mountedFolderContent}= Wait Until Keyword Succeeds 1 min 10s Get Content Of Mounted Folder Inside Container ${compSpecName} ${volumeMountPath}
Verify If Mounted Folder Is Empty ${mountedFolderContent}
Deploy DCAE Simple Application With Config Map In Config Spec Json AND Present In K8s
Create File ${CONFIG_MAP_FILE} ${content}
Create Config Map From File ${configMapName} ${CONFIG_MAP_FILE}
Deploy DCAE Application ${COMPSPEC_WITH_CONFIG_VOLUME} ${dict_values} ${compSpecName} ${processGroupName}
- Verify If Mounted Folder Contains File ${compSpecName} ${configMapFile} ${volumeMountPath}
+ Wait Until Keyword Succeeds 1 min 10s Verify If Mounted Folder Contains File ${compSpecName} ${configMapFile} ${volumeMountPath}
Verify File Content ${compSpecName} ${volumeMountPath}/${CONFIG_MAP_FILE} ${content}
- [Teardown] Run Keywords Delete Process Group And Blueprint And Deployment AND Delete Config Map With Mounted Config File
+ [Teardown] Run Keywords Delete Process Group And Deployment AND Delete Config Map With Mounted Config File