Fix basic01 and vim_lib: success if any metric is registered in Prometheus
[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
19 Variables   %{ROBOT_DEVOPS_FOLDER}/resources/basic_01-crud_operations_on_vim_targets_data.py
20
21
22 *** Test Cases ***
23 Create VIM Target Basic
24     [Documentation]     Create a VIM Target only with the mandatory parameters.
25     ...                 Checks the status of the VIM in Prometheus after it creation.
26     [Tags]  vim  sanity   regression
27
28     ${rand}=  Generate Random String  8  [NUMBERS]
29     ${vim_name}=  Catenate  SEPARATOR=_  ${vim_name_prefix}  ${rand}
30     Set Suite Variable  ${vim_name}
31     ${created_vim_account_id}=  Create VIM Target  ${vim_name}  ${vim_user}  ${vim_password}  ${vim_auth_url}  ${vim_tenant}  ${vim_account_type}
32     Set Suite Variable  ${created_vim_account_id}
33     Check for VIM Target Metric  ${vim_name}  ${prometheus_host}  ${prometheus_port}
34
35
36 Delete VIM Target By Name
37     [Documentation]     Delete the VIM Target created in previous test-case by its name.
38     ...                 Checks whether the VIM Target was created or not before perform the deletion.
39     [Tags]  vim  sanity   regression  cleanup
40
41     ${vim_account_id}=  Get VIM Target ID  ${vim_name}
42     Should Be Equal As Strings  ${vim_account_id}  ${created_vim_account_id}
43     Delete VIM Target  ${vim_name}
44
45
46 Create VIM Target With Extra Config
47     [Documentation]     Create a VIM Target using the extra parameter 'config'.
48     ...                 Checks the status of the VIM in Prometheus after it creation.
49     [Tags]  vim  sanity   regression
50
51     ${rand}=  Generate Random String  8  [NUMBERS]
52     ${vim_name}=  Catenate  SEPARATOR=_  ${vim_name_prefix}  ${rand}
53     Set Suite Variable  ${vim_name}
54     ${created_vim_account_id}=  Create VIM Target  ${vim_name}  ${vim_user}  ${vim_password}  ${vim_auth_url}  ${vim_tenant}  ${vim_account_type}  config=${vim_config}
55     Set Suite Variable  ${created_vim_account_id}
56     Check for VIM Target Status  ${vim_name}  ${prometheus_host}  ${prometheus_port}
57
58
59 Delete VIM Target By ID
60     [Documentation]     Delete the VIM Target created in previous test-case by its ID.
61     ...                 Checks whether the VIM Target was created or not before perform the deletion.
62     [Tags]  vim  sanity   regression  cleanup
63
64     ${vim_account_id}=  Get VIM Target ID  ${vim_name}
65     Should Be Equal As Strings  ${vim_account_id}  ${created_vim_account_id}
66     Delete VIM Target  ${vim_account_id}
67