blob: 625278d665b0778e265d5e336286eb3051f0693d [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
David Garcia006f5842021-11-11 18:05:52 +01002# 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
David Garcia006f5842021-11-11 18:05:52 +010015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [BASIC-22] Cross-model relations
David Garcia006f5842021-11-11 18:05:52 +010017
garciadeblasf4ebaa82022-06-23 13:33:26 +020018Library OperatingSystem
19Library SSHLibrary
David Garcia006f5842021-11-11 18:05:52 +010020
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
25Resource ../lib/k8scluster_lib.resource
David Garcia006f5842021-11-11 18:05:52 +010026
garciadeblas7a9e0312023-12-11 22:24:46 +010027Test Tags basic_22 cluster_ee_config cluster_relations regression
David Garcia006f5842021-11-11 18:05:52 +010028
garciadeblasf4ebaa82022-06-23 13:33:26 +020029Suite Teardown Run Keyword And Ignore Error Suite Cleanup
David Garcia006f5842021-11-11 18:05:52 +010030
31
32*** Variables ***
33# K8s cluster name and version
garciadeblas7a9e0312023-12-11 22:24:46 +010034${K8SCLUSTER_NAME} k8sbasic_22
35${K8SCLUSTER_VERSION} v1
David Garcia006f5842021-11-11 18:05:52 +010036
37# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010038${VNFD_PKG1} charm-packages/cmr_relation_vnf
39${VNFD_PKG2} charm-packages/cmr_no_relation_vnf
40${NSD_PKG} charm-packages/cmr_relation_ns
41${VNFD_NAME1} cross_model_relation-vnf
42${VNFD_NAME2} cross_model_no_relation-vnf
43${NSD_NAME} cross_model_relation-ns
David Garcia006f5842021-11-11 18:05:52 +010044
45# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010046${NS_NAME} basic_22
47${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
48${NS_TIMEOUT} 15min
David Garcia006f5842021-11-11 18:05:52 +010049
50# SSH keys and username to be used
garciadeblas7a9e0312023-12-11 22:24:46 +010051${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
52${PRIVATEKEY} %{HOME}/.ssh/id_rsa
53${USERNAME} ubuntu
54${PASSWORD} ${EMPTY}
David Garcia006f5842021-11-11 18:05:52 +010055
56
57*** Test Cases ***
58Create Charm VNF Descriptor 1
garciadeblas7a9e0312023-12-11 22:24:46 +010059 [Documentation] Upload first VNF package for the testsuite.
60 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG1}'
David Garcia006f5842021-11-11 18:05:52 +010061
62Create Charm VNF Descriptor 2
garciadeblas7a9e0312023-12-11 22:24:46 +010063 [Documentation] Upload second VNF package for the testsuite.
64 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG2}'
David Garcia006f5842021-11-11 18:05:52 +010065
66Create Charm NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010067 [Documentation] Upload NS package for the testsuite.
68 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
David Garcia006f5842021-11-11 18:05:52 +010069
70Add K8s Cluster To OSM
garciadeblas7a9e0312023-12-11 22:24:46 +010071 [Documentation] Register K8s cluster in OSM.
72 Create K8s Cluster %{K8S_CREDENTIALS} ${K8SCLUSTER_VERSION} %{VIM_TARGET} %{VIM_MGMT_NET} ${K8SCLUSTER_NAME}
garciadeblas93e5cc22023-12-17 01:40:23 +010073 Check For K8s Cluster To Be Enabled ${K8SCLUSTER_NAME}
David Garcia006f5842021-11-11 18:05:52 +010074
75Instantiate Charm Network Service
garciadeblas7a9e0312023-12-11 22:24:46 +010076 [Documentation] Instantiate NS for the testsuite.
77 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} ${NS_TIMEOUT}
78 Set Suite Variable ${NS_ID} ${id}
David Garcia006f5842021-11-11 18:05:52 +010079
garciadeblas7a9e0312023-12-11 22:24:46 +010080# TODO: Check juju status for relations
David Garcia006f5842021-11-11 18:05:52 +010081
82Delete NS Instance
garciadeblas7a9e0312023-12-11 22:24:46 +010083 [Documentation] Delete NS instance.
garciadeblasf4ebaa82022-06-23 13:33:26 +020084 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010085 Delete NS ${NS_NAME}
David Garcia006f5842021-11-11 18:05:52 +010086
87Remove K8s Cluster from OSM
garciadeblas7a9e0312023-12-11 22:24:46 +010088 [Documentation] Unregister K8s cluster from OSM.
David Garcia006f5842021-11-11 18:05:52 +010089 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010090 Delete K8s Cluster ${K8SCLUSTER_NAME}
David Garcia006f5842021-11-11 18:05:52 +010091
92Delete NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010093 [Documentation] Delete NS package from OSM.
garciadeblasf4ebaa82022-06-23 13:33:26 +020094 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010095 Delete NSD ${NSD_NAME}
David Garcia006f5842021-11-11 18:05:52 +010096
97Delete VNF Descriptor 1
garciadeblas7a9e0312023-12-11 22:24:46 +010098 [Documentation] Delete first VNF package from OSM.
garciadeblasf4ebaa82022-06-23 13:33:26 +020099 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100100 Delete VNFD ${VNFD_NAME1}
David Garcia006f5842021-11-11 18:05:52 +0100101
102Delete VNF Descriptor 2
garciadeblas7a9e0312023-12-11 22:24:46 +0100103 [Documentation] Delete second VNF package from OSM.
garciadeblasf4ebaa82022-06-23 13:33:26 +0200104 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100105 Delete VNFD ${VNFD_NAME2}
David Garcia006f5842021-11-11 18:05:52 +0100106
107
108*** Keywords ***
109Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200110 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
garciadeblas7a9e0312023-12-11 22:24:46 +0100111 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
112 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
113 Run Keyword If Any Tests Failed Delete VNFD 1 ${VNFD_NAME1}
114 Run Keyword If Any Tests Failed Delete VNFD 2 ${VNFD_NAME2}