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}=6m0s ${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} --wait --timeout ${wait_time}
45 ${helm_install_command_output} = Run And Return Rc And Output ${helm_install}
46 Log ${helm_install_command_output[1]}
47 Should Be Equal As Integers ${helm_install_command_output[0]} 0
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}=2m0s ${set_values_override}=${EMPTY}
52 ${helm_dependency_update}= Set Variable helm dependency update ${chart_folder}
53 ${helm_dependency_update_output} = Run And Return Rc And Output ${helm_dependency_update}
54 Log ${helm_dependency_update_output[1]}
55 Should Be Equal As Integers ${helm_dependency_update_output[0]} 0
56 ${rest} ${dcae_servcie_helm_charts} = Split String From Right ${chart_folder} / 1
57 ${helm_install}= Set Variable helm install ${dcae_service_helm_name} ${chart_folder} --set global.repository=${registry_ovveride} ${set_values_override} --wait --timeout ${wait_time}
58 ${helm_install_command_output} = Run And Return Rc And Output ${helm_install}
59 Log ${helm_install_command_output[1]}
60 Should Be Equal As Integers ${helm_install_command_output[0]} 0
63 [Documentation] Uninstall DCAE Servcie using helm charts
64 [Arguments] ${dcae_service_helm_name}
65 ${helm_uninstall}= Set Variable helm uninstall ${dcae_service_helm_name} --timeout 5m0s
66 ${helm_uninstall_command_output}= Run And Return Rc And Output ${helm_uninstall}
67 Should Be Equal As Integers ${helm_uninstall_command_output[0]} 0
68 ${helm_check}= Set Variable kubectl get pods -n onap | grep ${dcae_service_helm_name}
69 Wait Until Keyword Succeeds 5 minute 5 sec Helm charts uninstallation check ${helm_check}
71 Helm charts uninstallation check
72 [Arguments] ${helm_check}
73 ${helm_uninstall_check_output}= Run And Return Rc And Output ${helm_check}
74 Should Be Equal As Integers ${helm_uninstall_check_output[0]} 1
75 Log ${helm_uninstall_check_output[1]}