1 # -*- coding: utf-8 -*-
4 # Copyright 2019 Tech Mahindra Limited
8 # Licensed under the Apache License, Version 2.0 (the "License"); you may
9 # not use this file except in compliance with the License. You may obtain
10 # a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17 # License for the specific language governing permissions and limitations
22 # 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019
30 ${success_return_code} 0
31 ${delete_max_wait_time} 1min
32 ${delete_pol_time} 15sec
37 ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-list
40 Should Be Equal As Integers ${rc} ${success_return_code}
44 [Documentation] Onboards ("creates") a NF Package into OSM.
46 ... - vnfd_pkg: Name (and location) of the NF Package
47 ... - overrides (optional): String with options to override the EPA and/or interface properties of the Package.
48 ... This is very useful to allow to deploy e.g. non-EPA packages in EPA VIMs (or vice-versa).
49 ... Valid strings are the same as in the command. E.g.:
50 ... - `--override-epa`: adds EPA attributes to all VDUs.
51 ... - `--override-nonepa`: removes all EPA attributes from all VDUs.
52 ... - `--override-paravirt`: converts all interfaces to `PARAVIRT`. This one can be combined with
53 ... the others above (e.g. '--override-nonepa --override-paravirt').
54 ... - Relevant environment variables:
55 ... - OVERRIDES: If the environment variable "OVERRIDES" exists, it prevails over the value in the argument.
56 ... This is often more convenient to enforce the same behaviour for every test run in a given VIM.
58 [Arguments] ${vnfd_pkg} ${overrides}=${EMPTY}
60 # If env variable "OVERRIDES" exists, it prevails over the value in the argument
61 ${overrides}= Get Environment Variable OVERRIDES default=${overrides}
63 # Proceedes with the onboarding with the appropriate arguments
64 ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-create ${overrides} ${vnfd_pkg}
66 Should Be Equal As Integers ${rc} ${success_return_code}
67 ${lines}= Get Line Count ${stdout}
68 ${last}= Evaluate ${lines} - 1
69 ${id}= Get Line ${stdout} ${last}
73 Create VNFD Overriding Fields
74 [Documentation] Onboards ("creates") a NF Package into OSM.
76 ... - vnfd_pkg: Name (and location) of the NF Package
77 ... - override_fields: String with options to override fields in descriptor, format: "key1.key2...=value[;key3...=value;...]"
78 ... - overrides (optional): String with options to override the EPA and/or interface properties of the Package.
79 ... This is very useful to allow to deploy e.g. non-EPA packages in EPA VIMs (or vice-versa).
80 ... Valid strings are the same as in the command. E.g.:
81 ... - `--override-epa`: adds EPA attributes to all VDUs.
82 ... - `--override-nonepa`: removes all EPA attributes from all VDUs.
83 ... - `--override-paravirt`: converts all interfaces to `PARAVIRT`. This one can be combined with
84 ... the others above (e.g. '--override-nonepa --override-paravirt').
85 ... - Relevant environment variables:
86 ... - OVERRIDES: If the environment variable "OVERRIDES" exists, it prevails over the value in the argument.
87 ... This is often more convenient to enforce the same behaviour for every test run in a given VIM.
89 [Arguments] ${vnfd_pkg} ${override_fields} ${overrides}=${EMPTY}
91 # If env variable "OVERRIDES" exists, it prevails over the value in the argument
92 ${overrides}= Get Environment Variable OVERRIDES default=${overrides}
94 # Proceedes with the onboarding with the appropriate arguments
95 ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-create ${overrides} ${vnfd_pkg} --override '${override_fields}'
97 Should Be Equal As Integers ${rc} ${success_return_code}
98 ${lines}= Get Line Count ${stdout}
99 ${last}= Evaluate ${lines} - 1
100 ${id}= Get Line ${stdout} ${last}
105 [Arguments] ${vnfd_id}
107 ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-delete ${vnfd_id}
109 Should Be Equal As Integers ${rc} ${success_return_code}
110 WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id}
114 [Arguments] ${vnfd_id}
116 ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-list | awk '{print $2}' | grep ${vnfd_id}
117 Should Not Be Equal As Strings ${stdout} ${vnfd_id}