blob: 911154437e5fa4181b244efb65320a6b59b5399c [file] [log] [blame]
calvinosanc1a352a932020-07-21 16:03:46 +02001# Copyright 2020 Canonical Ltd.
2#
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
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
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.
14
15*** Settings ***
16Library String
17Library OperatingSystem
18
19
20*** Variables ***
21${success_return_code} 0
22
23
24*** Keywords ***
garciadeblas3da5a9c2022-06-25 18:12:53 +020025Package Build
calvinosanc1a352a932020-07-21 16:03:46 +020026 [Documentation] Build the package NS, VNF given the package_folder
27
28 [Arguments] ${pkg_folder} ${skip_charm_build}=${EMPTY}
29
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
garciadeblasf4ebaa82022-06-23 13:33:26 +020034 ${package}= Get Line ${stdout} -1
calvinosanc1a352a932020-07-21 16:03:46 +020035
garciadeblasf4ebaa82022-06-23 13:33:26 +020036 [Return] ${package}
calvinosanc1a352a932020-07-21 16:03:46 +020037
38Package Validate
39 [Documentation] Validate descriptors given a base directory
40
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'
garciadeblasf4ebaa82022-06-23 13:33:26 +020045 ${package}= Get Line ${stdout} -1
calvinosanc1a352a932020-07-21 16:03:46 +020046
garciadeblasf4ebaa82022-06-23 13:33:26 +020047 [Return] ${package}
calvinosanc1a352a932020-07-21 16:03:46 +020048