1 # Copyright 2020 Canonical Ltd.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 Library OperatingSystem
21 ${success_return_code} 0
26 [Documentation] Build the package NS, VNF given the package_folder
28 [Arguments] ${pkg_folder} ${skip_charm_build}=${EMPTY}
30 ${skip_charm} Set Variable If '${skip_charm_build}'!='${EMPTY}' --skip-charm-build \
31 ${rc} ${stdout}= Run and Return RC and Output osm package-build ${pkg_folder} ${skip_charm}
32 Should Be Equal As Integers ${rc} ${success_return_code}
33 Should Contain ${stdout} Package created
34 ${package}= Get Line ${stdout} -1
39 [Documentation] Validate descriptors given a base directory
41 [Arguments] ${pkg_folder}
42 ${rc} ${stdout}= Run and Return RC and Output osm package-validate ${pkg_folder} | awk -F\| '$2 !~ /-/ && $4 ~ /OK|ERROR/ {print $4}'
43 Should Be Equal As Integers ${rc} ${success_return_code}
44 Should Contain ${stdout} 'OK'
45 ${package}= Get Line ${stdout} -1