2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
16 Documentation [BASIC-01] CRUD operations on VIM targets.
17 ... All tests will be performed over an Openstack VIM, and the credentials will be loaded from clouds.yaml file.
19 Resource ../lib/vim_lib.resource
20 Resource ../lib/prometheus_lib.resource
22 Variables ../resources/basic_01-crud_operations_on_vim_targets_data.py
24 Test Tags basic_01 cluster_main daily regression
26 Suite Setup Run Keyword And Ignore Error Suite Preparation
30 Create VIM Target Basic
31 [Documentation] Create a VIM Target only with the mandatory parameters.
32 ... Checks the status of the VIM in Prometheus after it creation.
33 Pass Execution If ${VIM_ACCOUNT_TYPE} != 'openstack' Not applicable for ${VIM_ACCOUNT_TYPE} VIM
34 ${rand}= Generate Random String 6 [NUMBERS]
35 ${VIM_NAME}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand}
36 Set Suite Variable ${VIM_NAME}
37 ${CREATED_VIM_ACCOUNT_ID}= Create VIM Target ${VIM_NAME} ${VIM_USER} ${VIM_PASSWORD} ${VIM_AUTH_URL} ${VIM_TENANT} ${VIM_ACCOUNT_TYPE}
38 Set Suite Variable ${CREATED_VIM_ACCOUNT_ID}
39 Check VIM Target Operational State ${VIM_NAME}
40 ${stdout}= Check For VIM Target Metric ${VIM_NAME} ${PROMETHEUS_HOST} ${PROMETHEUS_PORT} ${PROMETHEUS_USER} ${PROMETHEUS_PASSWORD}
43 Delete VIM Target By Name
44 [Documentation] Delete the VIM Target created in previous test-case by its name.
45 ... Checks whether the VIM Target was created or not before perform the deletion.
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}
52 Create VIM Target With Extra Config
53 [Documentation] Create a VIM Target using the extra parameter 'config'.
54 ... Checks the status of the VIM in Prometheus after it creation.
55 ${rand}= Generate Random String 6 [NUMBERS]
56 ${VIM_NAME}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand}
57 Set Suite Variable ${VIM_NAME}
58 ${CREATED_VIM_ACCOUNT_ID}= Create VIM Target ${VIM_NAME} ${VIM_USER} ${VIM_PASSWORD} ${VIM_AUTH_URL} ${VIM_TENANT} ${VIM_ACCOUNT_TYPE} config=${VIM_CONFIG}
59 Set Suite Variable ${CREATED_VIM_ACCOUNT_ID}
60 Check VIM Target Operational State ${VIM_NAME}
61 Check For VIM Target Status ${VIM_NAME} ${PROMETHEUS_HOST} ${PROMETHEUS_PORT} ${PROMETHEUS_USER} ${PROMETHEUS_PASSWORD}
63 Delete VIM Target By ID
64 [Documentation] Delete the VIM Target created in previous test-case by its ID.
65 ... Checks whether the VIM Target was created or not before perform the deletion.
67 ${vim_account_id}= Get VIM Target ID ${VIM_NAME}
68 Should Be Equal As Strings ${vim_account_id} ${CREATED_VIM_ACCOUNT_ID}
69 Delete VIM Target ${vim_account_id}
74 [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
75 Set Testsuite Prometheus Variables