blob: a405c6441726f5a40eba747747ac7bc5225c43b3 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
Dominik Fleischmannb72faf32020-07-23 12:25:20 +02002# 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
garciadeblas7a9e0312023-12-11 22:24:46 +010014
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [BASIC-13] NS Relations
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020017
18Library OperatingSystem
19Library SSHLibrary
20
garciadeblas7a9e0312023-12-11 22:24:46 +010021Resource ../lib/vnfd_lib.resource
22Resource ../lib/nsd_lib.resource
23Resource ../lib/ns_lib.resource
24Resource ../lib/ssh_lib.resource
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020025
garciadeblas7a9e0312023-12-11 22:24:46 +010026Test Tags basic_13 cluster_ee_config cluster_relations regression azure
garciadeblas4cf45d72021-04-08 13:52:22 +020027
garciadeblasd225e552020-10-02 16:10:14 +000028Suite Teardown Run Keyword And Ignore Error Suite Cleanup
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020029
30
31*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020032# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010033${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
almagiab4697d32021-05-25 08:56:17 +020039
40# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010041${NS_NAME} basic_13_ns_relations_test
42${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
43${NS_TIMEOUT} 15min
almagiab4697d32021-05-25 08:56:17 +020044
45# SSH keys and username to be used
garciadeblas7a9e0312023-12-11 22:24:46 +010046${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
47${PRIVATEKEY} %{HOME}/.ssh/id_rsa
48${USERNAME} ubuntu
49${PASSWORD} ${EMPTY}
almagiab4697d32021-05-25 08:56:17 +020050
garciadeblas7a9e0312023-12-11 22:24:46 +010051${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
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020057
58
59*** Test Cases ***
60Create Charm VNF Descriptor Provides
garciadeblas7a9e0312023-12-11 22:24:46 +010061 [Documentation] Upload VNF package for the testsuite with a charm providing a relation.
62 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG1}'
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020063
64Create Charm VNF Descriptor Requires
garciadeblas7a9e0312023-12-11 22:24:46 +010065 [Documentation] Upload VNF package for the testsuite with a charm requiring a relation.
66 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG2}'
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020067
68Create Charm NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010069 [Documentation] Upload NS package for the testsuite.
70 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020071
72Instantiate Charm Network Service
garciadeblas7a9e0312023-12-11 22:24:46 +010073 [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}
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020076
garciadeblas7a9e0312023-12-11 22:24:46 +010077# TODO: Check juju status for relations
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020078
79Delete NS Instance
garciadeblas7a9e0312023-12-11 22:24:46 +010080 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +020081 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010082 Delete NS ${NS_NAME}
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020083
84Delete NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010085 [Documentation] Delete NS package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020086 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010087 Delete NSD ${NSD_NAME}
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020088
89Delete VNF Descriptor Provides
garciadeblas7a9e0312023-12-11 22:24:46 +010090 [Documentation] Delete first VNF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020091 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010092 Delete VNFD ${VNFD_NAME1}
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020093
94Delete VNF Descriptor Requires
garciadeblas7a9e0312023-12-11 22:24:46 +010095 [Documentation] Delete second VNF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020096 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010097 Delete VNFD ${VNFD_NAME2}
Dominik Fleischmannb72faf32020-07-23 12:25:20 +020098
99
100*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000101Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200102 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
garciadeblas7a9e0312023-12-11 22:24:46 +0100103 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}