[ROBOT] Clean up 5gbulkpm
[testsuite.git] / robot / resources / chart_museum.robot
1 *** Settings ***
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
5 Library           SSHLibrary
6 Library           OperatingSystem
7 Library           String
8
9 *** Variables ***
10 ${registry_ovveride}                                            ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO}
11
12 *** Keywords ***
13 Add OOM test chart repository
14     [Documentation]  Add OOM test chart repository to helm in robot/xtesting pod
15     [Arguments]                         ${chart_repo_name}                  ${chart_repo_fqdn}
16     ${helm_repo_add}=                   Set Variable                        helm repo add ${chart_repo_name} ${chart_repo_fqdn}
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
21
22 Add chart repository
23     [Documentation]  Add chart repository to helm in robot/xtesting pod
24     [Arguments]                         ${chart_repo_name}                  ${chart_repo_fqdn}      ${chart_repo_username}      ${chart_repo_password}
25     ${helm_repo_add}=                   Set Variable                        helm repo add ${chart_repo_name} ${chart_repo_fqdn} --password ${chart_repo_password} --username ${chart_repo_username}
26     ${command_output} =                 Run And Return Rc And Output        ${helm_repo_add}
27     Should Be Equal As Integers         ${command_output[0]}                0
28     ${command_output} =                 Run And Return Rc And Output        helm repo update
29     Should Be Equal As Integers         ${command_output[0]}                0
30
31 Remove chart repository
32     [Documentation]  Remove chart repository from helm in robot/xtesting pod
33     [Arguments]                         ${chart_repo_name}
34     ${helm_repo_remove}=                Set Variable                            helm repo remove ${chart_repo_name}
35     ${command_output} =                 Run And Return Rc And Output            ${helm_repo_remove}
36     Should Be Equal As Integers         ${command_output[0]}                    0
37
38 Package and add charts to repository
39     [Documentation]  Package and add charts to k8s chart repository in robot/xtesting pod
40     [Arguments]                         ${chart_repo_name}                  ${chart_directory}      ${destination_directory}    ${chart_version}
41     ${helm_package}=                    Set Variable                        helm package --dependency-update --destination ${destination_directory} ${chart_directory} --version ${chart_version}
42     ${command_output} =                 Run And Return Rc And Output        ${helm_package}
43     Should Be Equal As Integers         ${command_output[0]}                0
44     ${helm_chart_name}=                 Fetch From Right                    ${chart_directory}      /
45     ${helm_push}=                       Set Variable                        helm push  ${destination_directory}/${helm_chart_name}-${chart_version}.tgz ${chart_repo_name}
46     ${command_output} =                 Run And Return Rc And Output        ${helm_push}
47     Should Be Equal As Integers         ${command_output[0]}                0
48
49
50 Install helm charts
51     [Documentation]  Install DCAE Service using helm charts
52     [Arguments]                             ${chart_repo_name}                      ${dcae_service_helm_charts}         ${dcae_service_helm_name}       ${wait_time}=6m0s   ${set_values_override}=${EMPTY}
53     ${helm_install}=                        Set Variable                            helm -n onap install ${dcae_service_helm_name} ${chart_repo_name}/${dcae_service_helm_charts} --set global.repository=${registry_ovveride} ${set_values_override} --wait --timeout ${wait_time}
54     ${helm_install_command_output} =        Run And Return Rc And Output            ${helm_install}
55     Log                                     ${helm_install_command_output[1]}
56     Should Be Equal As Integers             ${helm_install_command_output[0]}       0
57
58 Install helm charts from folder
59     [Documentation]  Install DCAE Servcie using helm charts not in repo
60     [Arguments]                             ${chart_folder}                         ${dcae_service_helm_name}       ${wait_time}=2m0s  ${set_values_override}=${EMPTY}
61     ${helm_dependency_update}=              Set Variable                            helm dependency update ${chart_folder}
62     ${helm_dependency_update_output} =      Run And Return Rc And Output            ${helm_dependency_update}
63     Log                                     ${helm_dependency_update_output[1]}
64     Should Be Equal As Integers             ${helm_dependency_update_output[0]}     0
65     ${rest}  ${dcae_servcie_helm_charts} =      Split String From Right                     ${chart_folder}                 /           1
66     ${helm_install}=                        Set Variable                            helm -n onap install ${dcae_service_helm_name} ${chart_folder} --set global.repository=${registry_ovveride} ${set_values_override} --wait --timeout ${wait_time}
67     ${helm_install_command_output} =        Run And Return Rc And Output            ${helm_install}
68     Log                                     ${helm_install_command_output[1]}
69     Should Be Equal As Integers             ${helm_install_command_output[0]}       0
70
71 Uninstall helm charts
72     [Documentation]  Uninstall DCAE Servcie using helm charts
73     [Arguments]                             ${dcae_service_helm_name}
74     ${helm_uninstall}=                      Set Variable                                    helm -n onap uninstall ${dcae_service_helm_name} --timeout 5m0s
75     ${helm_uninstall_command_output}=       Run And Return Rc And Output                    ${helm_uninstall}
76     Should Be Equal As Integers             ${helm_uninstall_command_output[0]}             0
77     ${helm_check}=                          Set Variable                                    kubectl get pods -n onap | grep ${dcae_service_helm_name}
78     Wait Until Keyword Succeeds             5 minute                                        5 sec                            Helm charts uninstallation check       ${helm_check}
79
80 Helm charts uninstallation check
81     [Arguments]                             ${helm_check}
82     ${helm_uninstall_check_output}=         Run And Return Rc And Output                    ${helm_check}
83     Should Be Equal As Integers             ${helm_uninstall_check_output[0]}               1
84     Log                                     ${helm_uninstall_check_output[1]}
85
86
87
88
89
90
91
92