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-13] NS Relations
18 Library OperatingSystem
21 Resource ../lib/vnfd_lib.resource
22 Resource ../lib/nsd_lib.resource
23 Resource ../lib/ns_lib.resource
24 Resource ../lib/ssh_lib.resource
26 Test Tags basic_13 cluster_ee_config cluster_relations regression azure
28 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
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
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}} ] }
45 # SSH keys and username to be used
46 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
47 ${PRIVATEKEY} %{HOME}/.ssh/id_rsa
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
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}'
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}'
68 Create Charm NS Descriptor
69 [Documentation] Upload NS package for the testsuite.
70 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
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}
77 # TODO: Check juju status for relations
80 [Documentation] Delete NS instance.
85 [Documentation] Delete NS package from OSM.
87 Delete NSD ${NSD_NAME}
89 Delete VNF Descriptor Provides
90 [Documentation] Delete first VNF package from OSM.
92 Delete VNFD ${VNFD_NAME1}
94 Delete VNF Descriptor Requires
95 [Documentation] Delete second VNF package from OSM.
97 Delete VNFD ${VNFD_NAME2}
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}