1 # -*- coding: utf-8 -*-
4 # Copyright ETSI Contributors and Others.
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
23 Library OperatingSystem
27 ${success_return_code} 0
28 ${delete_max_wait_time} 1min
29 ${delete_pol_time} 15sec
34 [Documentation] Onboards ("creates") a NF Package into OSM.
36 ... - pkg: Name (and location) of the NF Package
40 # Proceedes with the onboarding with the appropriate arguments
41 ${rc} ${stdout}= Run and Return RC and Output tar -czf ${pkg}.tar.gz -C ${pkg} .
42 ${rc} ${stdout}= Run and Return RC and Output osm upload-package ${pkg}.tar.gz
44 Should Be Equal As Integers ${rc} ${success_return_code}
51 # Proceedes with the onboarding with the appropriate arguments
52 ${rc} ${stdout}= Run and Return RC and Output rm ${pkg}.tar.gz
56 [Documentation] Build the package NS, VNF given the package_folder
58 [Arguments] ${pkg_folder} ${skip_charm_build}=${EMPTY}
60 ${skip_charm} Set Variable If '${skip_charm_build}'!='${EMPTY}' --skip-charm-build \
61 ${rc} ${stdout}= Run and Return RC and Output osm package-build ${pkg_folder} ${skip_charm}
62 Should Be Equal As Integers ${rc} ${success_return_code}
63 Should Contain ${stdout} Package created
64 ${package}= Get Line ${stdout} -1
70 [Documentation] Validate descriptors given a base directory
72 [Arguments] ${pkg_folder}
73 ${rc} ${stdout}= Run and Return RC and Output osm package-validate ${pkg_folder} | awk -F\| '$2 !~ /-/ && $4 ~ /OK|ERROR/ {print $4}'
74 Should Be Equal As Integers ${rc} ${success_return_code}
75 Should Contain ${stdout} 'OK'
76 ${package}= Get Line ${stdout} -1