Fix basic 12 and add charm tag to basic 7
[osm/tests.git] / robot-systest / testsuite / basic_12-ns_primitives.robot
1 #   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 ***
15 Library   OperatingSystem
16 Library   String
17 Library   Collections
18 Library   Process
19
20 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
21 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
22 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
23 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/packages_lib.robot
24
25 Variables   %{ROBOT_DEVOPS_FOLDER}/resources/basic_12-ns_primitives_data.py
26
27 Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup
28
29
30 *** Variables ***
31 ${ns_config}   {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
32 ${publickey}   ${EMPTY}
33
34 *** Test Cases ***
35 Change 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
41     ${nsd_yaml}=   Get File  %{PACKAGES_FOLDER}/${nsd_pkg}/${nsd_file}
42     ${changed_nsd_yaml}=   Replace String  ${nsd_yaml}  ${old_juju_password}  %{JUJU_PASSWORD}
43     Create File  %{PACKAGES_FOLDER}/${nsd_pkg}/${nsd_file}  ${changed_nsd_yaml}
44
45 Upload Vnfds
46
47     [Tags]   nsprimitives   charm   sanity   regression
48
49     Create VNFD   '%{PACKAGES_FOLDER}/${vnfd_pkg1}'
50     Create VNFD   '%{PACKAGES_FOLDER}/${vnfd_pkg2}'
51
52 Upload Nsd
53
54     [Tags]   nsprimitives   charm   sanity   regression
55
56     Create NSD  %{PACKAGES_FOLDER}/${nsd_pkg}/
57
58 Instantiate NS
59
60     [Tags]   nsprimitives   charm   sanity   regression
61
62     ${id}=  Create Network Service  ${nsd_name}  %{VIM_TARGET}  ${ns_name}  ${ns_config}  ${publickey}  ns_launch_max_wait_time=40min
63     Set Suite Variable  ${ns_id}  ${id}
64
65 # TODO: Check Initial Config Primitives Status
66
67 Delete NS 
68
69     [Tags]   nsprimitives   charm   sanity   regression   cleanup
70
71     Delete NS   ${ns_name}
72
73 Delete NS Descriptor
74
75     [Tags]   nsprimitives   charm   sanity   regression   cleanup
76
77     Delete NSD   ${nsd_name}
78
79 Delete VNF Descriptors
80
81     [Tags]   nsprimitives   charm   sanity   regression   cleanup
82
83     Delete VNFD   ${vnfd_name1}
84     Delete VNFD   ${vnfd_name2}
85
86
87 *** Keywords ***
88 Suite Cleanup
89     [Documentation]  Test Suit Cleanup: Deleting Descriptor and instance
90
91     Run Keyword If Any Tests Failed  Delete NS   ${ns_name}
92     Run Keyword If Any Tests Failed  Delete NSD   ${nsd_name}
93     Run Keyword If Any Tests Failed  Delete VNFD   ${vnfd_name1}
94     Run Keyword If Any Tests Failed  Delete VNFD   ${vnfd_name2}