2 Documentation The main interface for interacting with CDS. It handles low level stuff like managing the http request library and CDS required fields
3 Library RequestsLibrary
4 Resource global_properties.robot
6 Library OperatingSystem
10 ${registry_ovveride} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO}
14 [Documentation] Add chart repository to helm in robot/xtesting pod
15 [Arguments] ${chart_repo_name} ${chart_repo_fqdn} ${chart_repo_username} ${chart_repo_password}
16 ${helm_repo_add}= Set Variable helm repo add ${chart_repo_name} ${chart_repo_fqdn} --password ${chart_repo_password} --username ${chart_repo_username}
17 ${command_output} = Run And Return Rc And Output ${helm_repo_add}
18 Should Be Equal As Integers ${command_output[0]} 0
19 ${command_output} = Run And Return Rc And Output helm repo update
20 Should Be Equal As Integers ${command_output[0]} 0
22 Remove chart repository
23 [Documentation] Remove chart repository from helm in robot/xtesting pod
24 [Arguments] ${chart_repo_name}
25 ${helm_repo_remove}= Set Variable helm repo remove ${chart_repo_name}
26 ${command_output} = Run And Return Rc And Output ${helm_repo_remove}
27 Should Be Equal As Integers ${command_output[0]} 0
29 Package and add charts to repository
30 [Documentation] Package and add charts to k8s chart repository in robot/xtesting pod
31 [Arguments] ${chart_repo_name} ${chart_directory} ${destination_directory} ${chart_version}
32 ${helm_package}= Set Variable helm package --dependency-update --destination ${destination_directory} ${chart_directory} --version ${chart_version}
33 ${command_output} = Run And Return Rc And Output ${helm_package}
34 Should Be Equal As Integers ${command_output[0]} 0
35 ${helm_chart_name}= Fetch From Right ${chart_directory} /
36 ${helm_push}= Set Variable helm push ${destination_directory}/${helm_chart_name}-${chart_version}.tgz ${chart_repo_name}
37 ${command_output} = Run And Return Rc And Output ${helm_push}
38 Should Be Equal As Integers ${command_output[0]} 0
42 [Documentation] Install DCAE Servcie using helm charts
43 [Arguments] ${chart_repo_name} ${dcae_servcie_helm_charts} ${dcae_service_helm_name} ${wait_time}=2 min ${set_values_override}=${EMPTY}
44 ${helm_install}= Set Variable helm install ${dcae_service_helm_name} ${chart_repo_name}/${dcae_servcie_helm_charts} --set global.repository=${registry_ovveride} ${set_values_override}
45 ${helm_install_command_output} = Run And Return Rc And Output ${helm_install}
46 Should Be Equal As Integers ${helm_install_command_output[0]} 0
47 Wait Until Keyword Succeeds ${wait_time} 20 sec Checking Status Of Deployed Appliction Using Helm ${dcae_servcie_helm_charts} ${dcae_service_helm_name}
49 Install helm charts from folder
50 [Documentation] Install DCAE Servcie using helm charts not in repo
51 [Arguments] ${chart_folder} ${dcae_service_helm_name} ${wait_time}=2 min ${set_values_override}=${EMPTY}
52 ${rest} ${dcae_servcie_helm_charts} = Split String From Right ${chart_folder} / 1
53 ${helm_install}= Set Variable helm install ${dcae_service_helm_name} ${chart_folder} --set global.repository=${registry_ovveride} ${set_values_override}
54 ${helm_install_command_output} = Run And Return Rc And Output ${helm_install}
55 Should Be Equal As Integers ${helm_install_command_output[0]} 0
56 Wait Until Keyword Succeeds ${wait_time} 20 sec Checking Status Of Deployed Appliction Using Helm ${dcae_servcie_helm_charts} ${dcae_service_helm_name}
58 Checking Status Of Deployed Appliction Using Helm
59 [Arguments] ${dcae_servcie_helm_charts} ${dcae_service_helm_name}
60 ${pod_status}= Set Variable kubectl get pods -n onap | grep ${ONAP_HELM_RELEASE}-${dcae_servcie_helm_charts} | awk '{print $3}'
61 ${pod_status_command_output} = Run And Return Rc And Output ${pod_status}
62 Should Be Equal As Integers ${pod_status_command_output[0]} 0
63 Should Be Equal As Strings ${pod_status_command_output[1]} Running
64 ${pod_ready}= Set Variable kubectl get pods -n onap | grep ${ONAP_HELM_RELEASE}-${dcae_servcie_helm_charts} | awk '{print $2}'
65 ${pod_ready_command_output} = Run And Return Rc And Output ${pod_ready}
66 Should Be Equal As Integers ${pod_ready_command_output[0]} 0
67 ${pre} ${post} = Split String ${pod_ready_command_output[1]} / 1
68 Should Be Equal As Strings ${pre} ${post}
71 [Documentation] Uninstall DCAE Servcie using helm charts
72 [Arguments] ${dcae_service_helm_name}
73 ${helm_uninstall}= Set Variable helm uninstall ${dcae_service_helm_name}
74 ${helm_uninstall_command_output}= Run And Return Rc And Output ${helm_uninstall}
75 Should Be Equal As Integers ${helm_uninstall_command_output[0]} 0