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}
74 [Arguments] ${vnfd_id}
76 ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-delete ${vnfd_id}
78 Should Be Equal As Integers ${rc} ${success_return_code}
79 WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id}
83 [Arguments] ${vnfd_id}
85 ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-list | awk '{print $2}' | grep ${vnfd_id}
86 Should Not Be Equal As Strings ${stdout} ${vnfd_id}