Feature 11001: Robot framework linting for E2E tests
[osm/tests.git] / robot-systest / testsuite / basic_13-ns_relations.robot
1 *** Comments ***
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
5 #
6 #       http://www.apache.org/licenses/LICENSE-2.0
7 #
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.
13
14
15 *** Settings ***
16 Documentation   [BASIC-13] NS Relations
17
18 Library   OperatingSystem
19 Library   SSHLibrary
20
21 Resource   ../lib/vnfd_lib.resource
22 Resource   ../lib/nsd_lib.resource
23 Resource   ../lib/ns_lib.resource
24 Resource   ../lib/ssh_lib.resource
25
26 Test Tags   basic_13   cluster_ee_config   cluster_relations   regression   azure
27
28 Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup
29
30
31 *** Variables ***
32 # NS and VNF descriptor package folder and ids
33 ${VNFD_PKG1}   charm-packages/ns_relations_provides_vnf
34 ${VNFD_PKG2}   charm-packages/ns_relations_requires_vnf
35 ${VNFD_NAME1}   ns_relations_provides-vnf
36 ${VNFD_NAME2}   ns_relations_requires-vnf
37 ${NSD_PKG}   charm-packages/ns_relations_ns
38 ${NSD_NAME}   ns_relations-ns
39
40 # NS instance name and configuration
41 ${NS_NAME}   basic_13_ns_relations_test
42 ${NS_CONFIG}   {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
43 ${NS_TIMEOUT}   15min
44
45 # SSH keys and username to be used
46 ${PUBLICKEY}   %{HOME}/.ssh/id_rsa.pub
47 ${PRIVATEKEY}   %{HOME}/.ssh/id_rsa
48 ${USERNAME}   ubuntu
49 ${PASSWORD}   ${EMPTY}
50
51 ${ACTION_NAME}   touch
52 ${VNF_MEMBER_INDEX_1}   vnf1
53 ${VNF_MEMBER_INDEX_2}   vnf2
54 ${DAY_1_FILE_NAME}   /home/ubuntu/first-touch
55 ${DAY_2_FILE_NAME_1}   /home/ubuntu/mytouch1
56 ${DAY_2_FILE_NAME_2}   /home/ubuntu/mytouch2
57
58
59 *** Test Cases ***
60 Create Charm VNF Descriptor Provides
61     [Documentation]   Upload VNF package for the testsuite with a charm providing a relation.
62     Create VNFD   '%{PACKAGES_FOLDER}/${VNFD_PKG1}'
63
64 Create Charm VNF Descriptor Requires
65     [Documentation]   Upload VNF package for the testsuite with a charm requiring a relation.
66     Create VNFD   '%{PACKAGES_FOLDER}/${VNFD_PKG2}'
67
68 Create Charm NS Descriptor
69     [Documentation]   Upload NS package for the testsuite.
70     Create NSD   '%{PACKAGES_FOLDER}/${NSD_PKG}'
71
72 Instantiate Charm Network Service
73     [Documentation]   Instantiate NS for the testsuite.
74     ${id}=   Create Network Service   ${NSD_NAME}   %{VIM_TARGET}   ${NS_NAME}   ${NS_CONFIG}   ${PUBLICKEY}   ${NS_TIMEOUT}
75     Set Suite Variable   ${NS_ID}   ${id}
76
77 # TODO: Check juju status for relations
78
79 Delete NS Instance
80     [Documentation]   Delete NS instance.
81     [Tags]   cleanup
82     Delete NS   ${NS_NAME}
83
84 Delete NS Descriptor
85     [Documentation]   Delete NS package from OSM.
86     [Tags]   cleanup
87     Delete NSD   ${NSD_NAME}
88
89 Delete VNF Descriptor Provides
90     [Documentation]   Delete first VNF package from OSM.
91     [Tags]   cleanup
92     Delete VNFD   ${VNFD_NAME1}
93
94 Delete VNF Descriptor Requires
95     [Documentation]   Delete second VNF package from OSM.
96     [Tags]   cleanup
97     Delete VNFD   ${VNFD_NAME2}
98
99
100 *** Keywords ***
101 Suite Cleanup
102     [Documentation]   Test Suite Cleanup: Deleting descriptors and NS instance
103     Run Keyword If Any Tests Failed   Delete NS   ${NS_NAME}
104     Run Keyword If Any Tests Failed   Delete NSD   ${NSD_NAME}
105     Run Keyword If Any Tests Failed   Delete VNFD   ${VNFD_NAME1}
106     Run Keyword If Any Tests Failed   Delete VNFD   ${VNFD_NAME2}