1 ##############################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property. #
3 # Copyright (c) 2019 Nokia. #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you maynot use this file except in compliance with the License. #
8 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ##############################################################################
20 Library OperatingSystem
27 ${REPORTDIR} ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}
28 ${DESTDIR} /tmp/helm-repo
30 ${REPOURL} Actual value set dynamically at suite setup
31 ${CHARTARC} Actual value set dynamically at suite setup
32 ${CHARTNAME} bluval-test-alpine
36 Open Connection And Log In
37 Open Connection ${HOST}
38 Login With Public Key ${USERNAME} ${SSH_KEYFILE}
41 Run Process sed -i s/name: alpine/name: ${CHARTNAME}/ /opt/akraino/${CHARTNAME}/Chart.yaml
42 Execute Command rm -r ${DESTDIR}
43 Put Directory /opt/akraino/${CHARTNAME} ${DESTDIR}/${CHARTNAME} recursive=True
44 ${stdout}= Execute Command helm package ${DESTDIR}/${CHARTNAME} -d ${DESTDIR}
45 Should Contain ${stdout} Successfully packaged chart and saved it to:
46 ${CHARTARC}= Fetch From Right ${stdout} /
47 Set Suite Variable ${CHARTARC}
49 Get Default Repository
50 ${REPOURL}= Execute Command helm repo list | grep '^${REPONAME} ' | cut -f2
51 Set Suite Variable ${REPOURL}
52 Should Not Be Empty ${REPOURL}
54 Fail If Previous Test Failed
55 Run Keyword If '${PREV_TEST_STATUS}'=='FAIL' Fail Skipping because '${PREV_TEST_NAME}' failed.
57 Upload Chart To Repository
58 ${STATUS}= Execute Command curl -X PUT --data-binary "@${DESTDIR}/${CHARTARC}" ${REPOURL}/${CHARTARC}
59 Set Test Variable ${STATUS}
61 Chart Upload Should Have Succeeded
62 Should Be Empty ${STATUS}
64 Chart Upload Should Have Failed
65 Should Not Be Empty ${STATUS}
67 Update Repository Info
68 ${stdout}= Execute Command helm repo update
69 Should Contain ${stdout} Successfully got an update from the "${REPONAME}" chart repository
72 ${STATUS}= Execute Command helm inspect chart ${REPONAME}/${CHARTNAME}
73 ... return_stdout=False
75 Set Test Variable ${STATUS}
77 Find Chart In Repository
78 ${STATUS}= Execute Command helm search -r '\\v${REPONAME}/${CHARTNAME}\\v'
79 Set Test Variable ${STATUS}
81 Chart Should Be Available
82 Should Contain ${STATUS} ${REPONAME}/${CHARTNAME}
84 Chart Should Not Be Available
85 Should Contain ${STATUS} No results found
87 Chart Should Be Accessible
88 Should Be Equal As Integers ${STATUS} 0
91 ${STATUS}= Execute Command curl -X DELETE ${REPOURL}/${CHARTARC}
92 Set Test Variable ${STATUS}
94 Chart Delete Should Have Succeeded
95 Should Be Empty ${STATUS}
97 Chart Delete Should Have Failed
98 Should Not Be Empty ${STATUS}