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-22] Cross-model 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
25 Resource ../lib/k8scluster_lib.resource
27 Test Tags basic_22 cluster_ee_config cluster_relations regression
29 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
33 # K8s cluster name and version
34 ${K8SCLUSTER_NAME} k8sbasic_22
35 ${K8SCLUSTER_VERSION} v1
37 # NS and VNF descriptor package folder and ids
38 ${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
45 # NS instance name and configuration
47 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
50 # SSH keys and username to be used
51 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
52 ${PRIVATEKEY} %{HOME}/.ssh/id_rsa
58 Create Charm VNF Descriptor 1
59 [Documentation] Upload first VNF package for the testsuite.
60 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG1}'
62 Create Charm VNF Descriptor 2
63 [Documentation] Upload second VNF package for the testsuite.
64 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG2}'
66 Create Charm NS Descriptor
67 [Documentation] Upload NS package for the testsuite.
68 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
70 Add K8s Cluster To OSM
71 [Documentation] Register K8s cluster in OSM.
72 Create K8s Cluster %{K8S_CREDENTIALS} ${K8SCLUSTER_VERSION} %{VIM_TARGET} %{VIM_MGMT_NET} ${K8SCLUSTER_NAME}
74 Instantiate Charm Network Service
75 [Documentation] Instantiate NS for the testsuite.
76 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} ${NS_TIMEOUT}
77 Set Suite Variable ${NS_ID} ${id}
79 # TODO: Check juju status for relations
82 [Documentation] Delete NS instance.
86 Remove K8s Cluster from OSM
87 [Documentation] Unregister K8s cluster from OSM.
89 Delete K8s Cluster ${K8SCLUSTER_NAME}
92 [Documentation] Delete NS package from OSM.
94 Delete NSD ${NSD_NAME}
96 Delete VNF Descriptor 1
97 [Documentation] Delete first VNF package from OSM.
99 Delete VNFD ${VNFD_NAME1}
101 Delete VNF Descriptor 2
102 [Documentation] Delete second VNF package from OSM.
104 Delete VNFD ${VNFD_NAME2}
109 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
110 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
111 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
112 Run Keyword If Any Tests Failed Delete VNFD 1 ${VNFD_NAME1}
113 Run Keyword If Any Tests Failed Delete VNFD 2 ${VNFD_NAME2}