Merge pull request #10361 from danfengliu/modify-notary-scritp

Notary test failed in Helm Pipeline
This commit is contained in:
danfengliu 2019-12-27 18:02:58 +08:00 committed by GitHub
commit 69740fc396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 5 deletions

View File

@ -101,7 +101,7 @@ Enable Notary Client
Remove Notary Signature
[Arguments] ${ip} ${image}
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-remove-image-signature.expect ${ip} library ${image}
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-remove-image-signature.expect ${ip} library ${image} ${notaryServerEndpoint}
Log To Console ${output}
Log ${output}
Should Be Equal As Integers ${rc} 0

View File

@ -105,7 +105,7 @@ Body Of Admin Push Signed Image
Log ${output}
Push image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library hello-world:latest
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-push-image.sh ${ip} library ${image} latest
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-push-image.sh ${ip} library ${image} latest ${notaryServerEndpoint}
Log ${output}
Should Be Equal As Integers ${rc} 0

View File

@ -4,7 +4,7 @@ docker pull $3:$4
IP=$1
PASSHRASE='Harbor12345'
notaryServerEndpoint=$5
echo $IP
mkdir -p /etc/docker/certs.d/$IP/
@ -13,8 +13,11 @@ mkdir -p ~/.docker/tls/$IP:4443/
cp /notary_ca.crt /etc/docker/certs.d/$IP/
cp /notary_ca.crt ~/.docker/tls/$IP:4443/
mkdir -p ~/.docker/tls/$notaryServerEndpoint/
cp /notary_ca.crt ~/.docker/tls/$notaryServerEndpoint/
export DOCKER_CONTENT_TRUST=1
export DOCKER_CONTENT_TRUST_SERVER=https://$IP:4443
export DOCKER_CONTENT_TRUST_SERVER=https://$notaryServerEndpoint
export NOTARY_ROOT_PASSPHRASE=$PASSHRASE
export NOTARY_TARGETS_PASSPHRASE=$PASSHRASE

View File

@ -3,9 +3,10 @@
set HOST [lindex $argv 0]
set PROJECT [lindex $argv 1]
set IMAGE [lindex $argv 2]
set notaryServerEndpoint [lindex $argv 3]
set timeout 30
spawn notary -s https://$HOST:4443 --tlscacert /notary_ca.crt -d /root/.docker/trust remove -p $HOST/$PROJECT/$IMAGE latest
spawn notary -s https://$notaryServerEndpoint --tlscacert /notary_ca.crt -d /root/.docker/trust remove -p $HOST/$PROJECT/$IMAGE latest
expect {
"Enter username:" {send "admin\r";exp_continue}

View File

@ -546,8 +546,11 @@ Test Case - Project Quotas Control Under GC
${image_a_size}= Set Variable 321.03MB
${image_a_ver}= Set Variable 6.8.3
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Capture Page Screenshot
Create An New Project project${d} storage_quota=${storage_quota} storage_quota_unit=${storage_quota_unit}
Capture Page Screenshot
Cannot Push image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image_a}:${image_a_ver} err_msg=will exceed the configured upper limit of 200.0 MiB
Capture Page Screenshot
GC Now ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
@{param} Create List project${d}
Retry Keyword When Return Value Mismatch Get Project Storage Quota Text From Project Quotas List 0Byte of ${storage_quota}${storage_quota_unit} 60 @{param}