Revert "Feature 11001: Robot framework linting for E2E tests"
[osm/tests.git] / robot-systest / testsuite / basic_32-volume_with_different_az.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-32] Basic NS with a volume in different availability zone
15
16 Library   OperatingSystem
17 Library   String
18 Library   Collections
19 Library   Process
20 Library   SSHLibrary
21
22 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot
23 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot
24 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
25 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
26 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
27
28 Variables   %{ROBOT_DEVOPS_FOLDER}/resources/basic_32-volume_with_different_az.py
29
30 Force Tags   basic_32
31
32 Suite Setup   Run Keyword And Ignore Error   Suite Preparation
33
34 *** Variables ***
35 # NS and VNF descriptor package folder and ids
36 ${vnfd_pkg}   several_volumes_vnf
37 ${vnfd_name}   several_volumes-vnf
38 ${nsd_pkg}   several_volumes_ns
39 ${nsd_name}   several_volumes-ns
40
41 # NS instance name and configuration
42 ${ns_name}   basic_32
43 ${ns_config}   {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
44
45 # SSH keys and username to be used
46 ${publickey}   %{HOME}/.ssh/id_rsa.pub
47 ${privatekey}   %{HOME}/.ssh/id_rsa
48
49
50 *** Test Cases ***
51 Create VIM Target Basic
52     [Documentation]   Create a VIM Target only with the az parameters.
53     ...               Checks the status of the VIM in Prometheus after it creation.
54
55     Pass Execution If   '${vim_account_type}' != 'openstack'   Not applicable for ${vim_account_type} VIM
56     ${rand}=   Generate Random String   6   [NUMBERS]
57     ${vim_name_az}=   Catenate   SEPARATOR=_   ${vim_name_prefix}   ${rand}
58     Set Suite Variable   ${vim_name_az}
59     ${created_vim_account_id}=   Create VIM Target   ${vim_name_az}   ${vim_user}   ${vim_password}   ${vim_auth_url}   ${vim_tenant}   ${vim_account_type}   config=${vim_config}
60     Set Suite Variable   ${created_vim_account_id}
61
62
63 Create VNF Descriptor
64
65     Create VNFD   '%{PACKAGES_FOLDER}/${vnfd_pkg}'
66
67
68 Create NS Descriptor
69
70     Create NSD   '%{PACKAGES_FOLDER}/${nsd_pkg}'
71
72
73 Network Service Instance Test
74     [Tags]   prepare
75     ${id}=   Create Network Service   ${nsd_name}   ${vim_name_az}   ${ns_name}   ${ns_config}   ${publickey}
76     Set Suite Variable   ${ns_id}   ${id}
77
78
79 Delete NS Instance Test
80     [Tags]   cleanup
81
82     Delete NS   ${ns_name}
83
84
85 Delete NS Descriptor Test
86     [Tags]   cleanup
87
88     Delete NSD   ${nsd_name}
89
90
91 Delete VNF Descriptor Test
92     [Tags]   cleanup
93
94     Delete VNFD   ${vnfd_name}
95
96
97 Delete VIM Target By ID
98     [Documentation]   Delete the VIM Target created in previous test-case by its ID.
99     ...               Checks whether the VIM Target was created or not before perform the deletion.
100     [Tags]   cleanup
101
102     ${vim_account_id}=   Get VIM Target ID   ${vim_name_az}
103     Should Be Equal As Strings   ${vim_account_id}   ${created_vim_account_id}
104     Delete VIM Target   ${vim_account_id}
105
106
107 *** Keywords ***
108 Suite Cleanup
109     [Documentation]   Test Suit Cleanup: Deleting Descriptor, instance and vim
110
111     Run Keyword If Any Tests Failed   Delete NS   ${ns_name}
112
113     Run Keyword If Any Tests Failed   Delete NSD   ${nsd_name}
114
115     Run Keyword If Any Tests Failed   Delete VNFD   ${vnfd_name}