blob: 2feeb846dc9b2d1a18f6ef12d2c42e2739384944 [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 ***
15Library OperatingSystem
16Library String
17Library Collections
18Library Process
19
20Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
21Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
22Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
23Resource %{ROBOT_DEVOPS_FOLDER}/lib/packages_lib.robot
24
25Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_12-ns_primitives_data.py
26
garciadeblasd225e552020-10-02 16:10:14 +000027Suite Teardown Run Keyword And Ignore Error Suite Cleanup
calvinosanc1a352a932020-07-21 16:03:46 +020028
29
30*** Variables ***
31${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
32${publickey} ${EMPTY}
33
34*** Test Cases ***
35Change Juju Password
36
37 [Documentation] NS package needs to be updated with the Juju credentials for your OSM installation
38
39 [Tags] nsprimitives charm sanity regression
40
garciadeblas55a5ec22020-10-07 15:33:05 +000041 ${nsd_yaml}= Get File %{PACKAGES_FOLDER}/${nsd_pkg}/${nsd_file}
calvinosanc1a352a932020-07-21 16:03:46 +020042 ${changed_nsd_yaml}= Replace String ${nsd_yaml} ${old_juju_password} %{JUJU_PASSWORD}
garciadeblas55a5ec22020-10-07 15:33:05 +000043 Create File %{PACKAGES_FOLDER}/${nsd_pkg}/${nsd_file} ${changed_nsd_yaml}
calvinosanc1a352a932020-07-21 16:03:46 +020044
45Create NS Package
46
47 [Tags] nsprimitives charm sanity regression
48
garciadeblas55a5ec22020-10-07 15:33:05 +000049 ${pkg}= Package Build '%{PACKAGES_FOLDER}/${nsd_pkg}'
calvinosanc1a352a932020-07-21 16:03:46 +020050 Log ${pkg}
51 Set Suite Variable ${ns_pkg} ${pkg}
52
53
54Upload Vnfds
55
56 [Tags] nsprimitives charm sanity regression
57
garciadeblas55a5ec22020-10-07 15:33:05 +000058 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg1}'
59 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg2}'
calvinosanc1a352a932020-07-21 16:03:46 +020060
61Upload Nsd
62
63 [Tags] nsprimitives charm sanity regression
64
65 Create NSD '${ns_pkg}'
66
67Instantiate NS
68
69 [Tags] nsprimitives charm sanity regression
70
71 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ns_launch_max_wait_time=40min
72 Set Suite Variable ${ns_id} ${id}
73
74# TODO: Check Initial Config Primitives Status
75
76Delete NS
77
78 [Tags] nsprimitives charm sanity regression cleanup
79
80 Delete NS ${ns_name}
81
82Delete NS Descriptor
83
84 [Tags] nsprimitives charm sanity regression cleanup
85
86 Delete NSD ${nsd_name}
87
88Delete VNF Descriptors
89
90 [Tags] nsprimitives charm sanity regression cleanup
91
92 Delete VNFD ${vnfd_name1}
93 Delete VNFD ${vnfd_name2}
94
95
96*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +000097Suite Cleanup
calvinosanc1a352a932020-07-21 16:03:46 +020098 [Documentation] Test Suit Cleanup: Deleting Descriptor and instance
99
garciadeblasd225e552020-10-02 16:10:14 +0000100 Run Keyword If Any Tests Failed Delete NS ${ns_name}
101 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
102 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name1}
103 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name2}