blob: e4113e7e32b6e405876fd50bfa2ada352c20e3ae [file] [log] [blame]
calvinosanc1a352a932020-07-21 16:03:46 +02001# Copyright 2020 Canonical Ltd.
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*** Settings ***
garciadeblas4cf45d72021-04-08 13:52:22 +020015Documentation [BASIC-12] NS Primitives
16
calvinosanc1a352a932020-07-21 16:03:46 +020017Library OperatingSystem
18Library String
19Library Collections
20Library Process
21
22Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
23Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
24Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
25Resource %{ROBOT_DEVOPS_FOLDER}/lib/packages_lib.robot
26
27Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_12-ns_primitives_data.py
28
garciadeblas4cf45d72021-04-08 13:52:22 +020029Force Tags basic_12 cluster_ee_config daily regression
30
garciadeblasd225e552020-10-02 16:10:14 +000031Suite Teardown Run Keyword And Ignore Error Suite Cleanup
calvinosanc1a352a932020-07-21 16:03:46 +020032
33
34*** Variables ***
35${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
36${publickey} ${EMPTY}
37
38*** Test Cases ***
39Change Juju Password
40
41 [Documentation] NS package needs to be updated with the Juju credentials for your OSM installation
42
garciadeblas55a5ec22020-10-07 15:33:05 +000043 ${nsd_yaml}= Get File %{PACKAGES_FOLDER}/${nsd_pkg}/${nsd_file}
calvinosanc1a352a932020-07-21 16:03:46 +020044 ${changed_nsd_yaml}= Replace String ${nsd_yaml} ${old_juju_password} %{JUJU_PASSWORD}
garciadeblas55a5ec22020-10-07 15:33:05 +000045 Create File %{PACKAGES_FOLDER}/${nsd_pkg}/${nsd_file} ${changed_nsd_yaml}
calvinosanc1a352a932020-07-21 16:03:46 +020046
calvinosanc1a352a932020-07-21 16:03:46 +020047Upload Vnfds
48
garciadeblas55a5ec22020-10-07 15:33:05 +000049 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg1}'
50 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg2}'
calvinosanc1a352a932020-07-21 16:03:46 +020051
52Upload Nsd
53
David Garcia930c39d2020-12-15 16:51:05 +010054 Create NSD %{PACKAGES_FOLDER}/${nsd_pkg}/
calvinosanc1a352a932020-07-21 16:03:46 +020055
56Instantiate NS
57
calvinosanc1a352a932020-07-21 16:03:46 +020058 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ns_launch_max_wait_time=40min
59 Set Suite Variable ${ns_id} ${id}
60
61# TODO: Check Initial Config Primitives Status
62
63Delete NS
64
garciadeblas4cf45d72021-04-08 13:52:22 +020065 [Tags] cleanup
calvinosanc1a352a932020-07-21 16:03:46 +020066
67 Delete NS ${ns_name}
68
69Delete NS Descriptor
70
garciadeblas4cf45d72021-04-08 13:52:22 +020071 [Tags] cleanup
calvinosanc1a352a932020-07-21 16:03:46 +020072
73 Delete NSD ${nsd_name}
74
75Delete VNF Descriptors
76
garciadeblas4cf45d72021-04-08 13:52:22 +020077 [Tags] cleanup
calvinosanc1a352a932020-07-21 16:03:46 +020078
79 Delete VNFD ${vnfd_name1}
80 Delete VNFD ${vnfd_name2}
81
82
83*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +000084Suite Cleanup
calvinosanc1a352a932020-07-21 16:03:46 +020085 [Documentation] Test Suit Cleanup: Deleting Descriptor and instance
86
garciadeblasd225e552020-10-02 16:10:14 +000087 Run Keyword If Any Tests Failed Delete NS ${ns_name}
88 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
89 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name1}
90 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name2}