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
51 ... helm repo list | grep '^${REPONAME}\\([[:blank:]]\\|[^[:print:]]\\)' | cut -f2
52 Set Suite Variable ${REPOURL}
53 Should Not Be Empty ${REPOURL}
55 Fail If Previous Test Failed
56 Run Keyword If '${PREV_TEST_STATUS}'=='FAIL' Fail Skipping because '${PREV_TEST_NAME}' failed.
58 Upload Chart To Repository
59 ${STATUS}= Execute Command curl -X PUT --data-binary "@${DESTDIR}/${CHARTARC}" ${REPOURL}/${CHARTARC}
60 Set Test Variable ${STATUS}
62 Chart Upload Should Have Succeeded
63 Should Be Empty ${STATUS}
65 Chart Upload Should Have Failed
66 Should Not Be Empty ${STATUS}
68 Update Repository Info
69 ${stdout}= Execute Command helm repo update
70 Should Contain ${stdout} Successfully got an update from the "${REPONAME}" chart repository
73 ${STATUS}= Execute Command helm inspect chart ${REPONAME}/${CHARTNAME}
74 ... return_stdout=False
76 Set Test Variable ${STATUS}
78 Find Chart In Repository
79 ${STATUS}= Execute Command helm search -r '\\v${REPONAME}/${CHARTNAME}\\v'
80 Set Test Variable ${STATUS}
82 Chart Should Be Available
83 Should Contain ${STATUS} ${REPONAME}/${CHARTNAME}
85 Chart Should Not Be Available
86 Should Contain ${STATUS} No results found
88 Chart Should Be Accessible
89 Should Be Equal As Integers ${STATUS} 0
92 ${STATUS}= Execute Command curl -X DELETE ${REPOURL}/${CHARTARC}
93 Set Test Variable ${STATUS}
95 Chart Delete Should Have Succeeded
96 Should Be Empty ${STATUS}
98 Chart Delete Should Have Failed
99 Should Not Be Empty ${STATUS}