Merge pull request #11379 from danfengliu/add-nightly-test-of-push-helm-chart

Add nightly test of push helm chart
This commit is contained in:
danfengliu 2020-04-02 10:29:21 +08:00 committed by GitHub
commit aa26e624b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 87 additions and 28 deletions

View File

@ -162,6 +162,6 @@ Docker Push
Docker Push Index
[Arguments] ${ip} ${user} ${pwd} ${index} ${image1} ${image2}
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/docker_push_manifest_list.sh ${ip} ${user} ${pwd} ${index} ${image1} ${image2}
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/docker_push_manifest_list.sh ${ip} ${user} ${pwd} ${index} ${image1} ${image2}
Log ${output}
Should Be Equal As Integers ${rc} 0

View File

@ -1,24 +1,24 @@
# Copyright Project Harbor Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
*** Settings ***
Documentation This resource provides any keywords related to the Harbor private registry appliance
*** Variables ***
${artifact_action_xpath} //clr-dg-action-bar/clr-dropdown/span[contains(@class,'dropdown-toggle')]
${artifact_action_delete_xpath} //clr-dropdown-menu//div[contains(.,'Delete')]
${artifact_action_copy_xpath} //clr-dropdown-menu//div[contains(.,'Copy') and @aria-label='retag']
${artifact_achieve_icon} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')]//clr-dg-cell[1]//clr-tooltip//clr-icon
${artifact_rows} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')]
# Copyright Project Harbor Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
*** Settings ***
Documentation This resource provides any keywords related to the Harbor private registry appliance
*** Variables ***
${artifact_action_xpath} //clr-dg-action-bar/clr-dropdown/span[contains(@class,'dropdown-toggle')]
${artifact_action_delete_xpath} //clr-dropdown-menu//div[contains(.,'Delete')]
${artifact_action_copy_xpath} //clr-dropdown-menu//div[contains(.,'Copy') and @aria-label='retag']
${artifact_achieve_icon} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')]//clr-dg-cell[1]//clr-tooltip//a
${artifact_rows} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')]

View File

@ -211,7 +211,8 @@ Go Into Repo
Capture Page Screenshot gointo_${repoName}.png
Go Into Index
Retry Wait Element ${artifact_achieve_icon}
[Arguments] ${index_name}=${null}
Retry Element Click ${artifact_achieve_icon}
Switch To CardView
Retry Element Click xpath=//hbr-repository-gridview//span[@class='card-btn']/clr-icon

View File

@ -51,6 +51,7 @@ ${repo_list_spinner} xpath=//clr-datagrid//clr-spinner
${repo_tag_1st_checkbox} xpath=//clr-datagrid//clr-dg-row//clr-checkbox-wrapper
${tag_table_column_pull_command} xpath=//clr-dg-column//span[contains(.,'Pull Command')]
${tag_table_column_vulnerabilities} xpath=//clr-dg-column//span[contains(.,'Vulnerabilities')]
${tag_table_column_os_arch} xpath=//clr-dg-column//span[contains(.,'OS/ARCH')]
${tag_table_column_tag} xpath=//clr-dg-column//span[contains(.,'Tag')]
${tag_table_column_size} xpath=//clr-dg-column//span[contains(.,'Size')]
${tag_table_column_vulnerability} xpath=//clr-dg-column//span[contains(.,'Vulnerability')]

View File

@ -32,4 +32,10 @@ Helm Repo Push
${current_dir}= Run pwd
Run cd ${current_dir}
Run wget ${harbor_chart_file_url}
Wait Unitl Command Success ${helm_cmd} push --ca-file=/helm_ca/server.crt --username=${user} --password=${pwd} ${chart_filename} ${helm_repo_name}
Wait Unitl Command Success ${helm_cmd} push --ca-file=/helm_ca/server.crt --username=${user} --password=${pwd} ${chart_filename} ${helm_repo_name}
Helm Chart Push
[Arguments] ${ip} ${user} ${pwd} ${chart_file} ${archive} ${project} ${repo_name} ${verion}
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/helm_push_chart.sh ${ip} ${user} ${pwd} ${chart_file} ${archive} ${project} ${repo_name} ${verion}
Log ${output}
Should Be Equal As Integers ${rc} 0

View File

@ -0,0 +1,24 @@
#!/bin/bash
IP=$1
USER=$2
PWD=$3
CHART_FILE=$4
ARCHIVE=$5
PROJECT=$6
REPOSITORY=$7
VERSION=$8
echo $IP
export HELM_EXPERIMENTAL_OCI=1
wget $CHART_FILE
echo "========================"
echo ${CHART_FILE##*/}
echo "========================"
tar xvf ${CHART_FILE##*/}
helm3 registry login $IP -u $USER -p $PWD
helm3 chart save $ARCHIVE $IP/$PROJECT/$REPOSITORY
helm3 chart push $IP/$PROJECT/$REPOSITORY:$VERSION

View File

@ -693,7 +693,7 @@ Test Case - Push Docker Manifest Index and Display
Go Into Project test${d}
Wait Until Page Contains test${d}/index${d}
Go Into Repo test${d}/index${d}
Go Into Index
Retry Double Keywords When Error Go Into Index index_name=${null} Page Should Contain Element ${tag_table_column_os_arch}
Page Should Contain Element ${artifact_rows} limit=2
Test Case - Push CNAB Bundle and Display
@ -711,3 +711,30 @@ Test Case - Push CNAB Bundle and Display
Go Into Repo test${d}/cnab${d}
Wait Until Page Contains cnab_tag${d}
Go Into Project test${d}
Wait Until Page Contains test${d}/cnab${d}
Go Into Repo test${d}/cnab${d}
Retry Double Keywords When Error Go Into Index index_name=${null} Page Should Contain Element ${tag_table_column_os_arch}
Page Should Contain Element ${artifact_rows} limit=3
Test Case - Push Helm Chart and Display
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
${chart_file}= Set Variable https://storage.googleapis.com/harbor-builds/helm-chart-test-files/harbor-0.2.0.tgz
${archive}= Set Variable harbor/
${verion}= Set Variable 0.2.0
${repo_name}= Set Variable harbor_chart_test
Sign In Harbor ${HARBOR_URL} user010 Test1@34
Create An New Project test${d}
Helm Chart Push ${ip} user010 Test1@34 ${chart_file} ${archive} test${d} ${repo_name} ${verion}
Go Into Project test${d}
Wait Until Page Contains test${d}/${repo_name}
Go Into Repo test${d}/${repo_name}
Wait Until Page Contains ${repo_name}
Go Into Project test${d}
Wait Until Page Contains test${d}/${repo_name}
Retry Double Keywords When Error Go Into Repo test${d}/${repo_name} Page Should Contain Element ${tag_table_column_vulnerabilities}