Revert "Feature 11001: Robot framework linting for E2E tests"
[osm/tests.git] / robot-systest / testsuite / basic_01-crud_operations_on_vim_targets.robot
1 #   Licensed under the Apache License, Version 2.0 (the "License");
2 #   you may not use this file except in compliance with the License.
3 #   You may obtain a copy of the License at
4 #
5 #       http://www.apache.org/licenses/LICENSE-2.0
6 #
7 #   Unless required by applicable law or agreed to in writing, software
8 #   distributed under the License is distributed on an "AS IS" BASIS,
9 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 #   See the License for the specific language governing permissions and
11 #   limitations under the License.
12
13 *** Settings ***
14 Documentation   [BASIC-01] CRUD operations on VIM targets.
15 ...             All tests will be performed over an Openstack VIM, and the credentials will be loaded from clouds.yaml file.
16
17 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot
18 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot
19
20 Variables   %{ROBOT_DEVOPS_FOLDER}/resources/basic_01-crud_operations_on_vim_targets_data.py
21
22 Force Tags   basic_01   cluster_main   daily   regression
23
24 Suite Setup   Run Keyword And Ignore Error   Suite Preparation
25
26
27 *** Test Cases ***
28 Create VIM Target Basic
29     [Documentation]   Create a VIM Target only with the mandatory parameters.
30     ...               Checks the status of the VIM in Prometheus after it creation.
31
32     Pass Execution If   '${vim_account_type}' != 'openstack'   Not applicable for ${vim_account_type} VIM
33     ${rand}=   Generate Random String   6   [NUMBERS]
34     ${vim_name}=   Catenate   SEPARATOR=_   ${vim_name_prefix}   ${rand}
35     Set Suite Variable   ${vim_name}
36     ${created_vim_account_id}=   Create VIM Target   ${vim_name}   ${vim_user}   ${vim_password}   ${vim_auth_url}   ${vim_tenant}   ${vim_account_type}
37     Set Suite Variable   ${created_vim_account_id}
38     Check VIM Target Operational State   ${vim_name}
39     ${stdout}=   Check for VIM Target Metric   ${vim_name}   ${prometheus_host}   ${prometheus_port}   ${prometheus_user}   ${prometheus_password}
40
41
42 Delete VIM Target By Name
43     [Documentation]   Delete the VIM Target created in previous test-case by its name.
44     ...               Checks whether the VIM Target was created or not before perform the deletion.
45     [Tags]   cleanup
46
47     Pass Execution If   '${vim_account_type}' != 'openstack'   Not applicable for ${vim_account_type} VIM
48     ${vim_account_id}=   Get VIM Target ID   ${vim_name}
49     Should Be Equal As Strings   ${vim_account_id}   ${created_vim_account_id}
50     Delete VIM Target   ${vim_name}
51
52
53 Create VIM Target With Extra Config
54     [Documentation]   Create a VIM Target using the extra parameter 'config'.
55     ...               Checks the status of the VIM in Prometheus after it creation.
56
57     ${rand}=   Generate Random String   6   [NUMBERS]
58     ${vim_name}=   Catenate   SEPARATOR=_   ${vim_name_prefix}   ${rand}
59     Set Suite Variable   ${vim_name}
60     ${created_vim_account_id}=   Create VIM Target   ${vim_name}   ${vim_user}   ${vim_password}   ${vim_auth_url}   ${vim_tenant}   ${vim_account_type}   config=${vim_config}
61     Set Suite Variable   ${created_vim_account_id}
62     Check VIM Target Operational State   ${vim_name}
63     Check for VIM Target Status   ${vim_name}   ${prometheus_host}   ${prometheus_port}   ${prometheus_user}   ${prometheus_password}
64
65
66 Delete VIM Target By ID
67     [Documentation]   Delete the VIM Target created in previous test-case by its ID.
68     ...               Checks whether the VIM Target was created or not before perform the deletion.
69     [Tags]   cleanup
70
71     ${vim_account_id}=   Get VIM Target ID   ${vim_name}
72     Should Be Equal As Strings   ${vim_account_id}   ${created_vim_account_id}
73     Delete VIM Target   ${vim_account_id}
74
75
76 *** Keywords ***
77 Suite Preparation
78     [Documentation]   Test Suite Preparation: Setting Prometheus Testsuite Variables
79
80     Set Testsuite Prometheus Variables