Merge pull request #10313 from danfengliu/add-parameter-for-sign-image-case

Change parameter image to optional
This commit is contained in:
danfengliu 2019-12-19 17:57:21 +08:00 committed by GitHub
commit 3f1211ab16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 23 deletions

View File

@ -95,24 +95,9 @@ Switch To LDAP
Enable Notary Client Enable Notary Client
${rc} ${output}= Run And Return Rc And Output rm -rf ~/.docker/ ${rc} ${output}= Run And Return Rc And Output rm -rf ~/.docker/
Log ${rc} Log ${rc}
Should Be Equal As Integers ${rc} 0 ${rc} ${output}= Run And Return Rc and Output curl -o /notary_ca.crt -s -k -X GET --header 'Accept: application/json' -u 'admin:Harbor12345' 'https://${ip}/api/systeminfo/getcert'
Log ${ip}
Log To Console ${ip}
${rc}= Run And Return Rc mkdir -p /etc/docker/certs.d/${ip}/
Should Be Equal As Integers ${rc} 0
Log To Console ${notaryServerEndpointNoSubDir}
${rc}= Run And Return Rc mkdir -p ~/.docker/tls/${notaryServerEndpointNoSubDir}/
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output cp ./harbor_ca.crt /etc/docker/certs.d/${ip}/
Log ${output} Log ${output}
Should Be Equal As Integers ${rc} 0 Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output cp ./harbor_ca.crt ~/.docker/tls/${notaryServerEndpointNoSubDir}/
Log ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output ls -la /etc/docker/certs.d/${ip}/
Log ${output}
${rc} ${output}= Run And Return Rc And Output ls -la ~/.docker/tls/${notaryServerEndpointNoSubDir}/
Log ${output}
Remove Notary Signature Remove Notary Signature
[Arguments] ${ip} ${image} [Arguments] ${ip} ${image}

View File

@ -98,7 +98,7 @@ Body Of List Helm Charts
Close Browser Close Browser
Body Of Admin Push Signed Image Body Of Admin Push Signed Image
[Arguments] ${image} ${with_remove}=${false} [Arguments] ${image}=tomcat ${with_remove}=${false}
Enable Notary Client Enable Notary Client
${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest ${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest

View File

@ -10,8 +10,8 @@ echo $IP
mkdir -p /etc/docker/certs.d/$IP/ mkdir -p /etc/docker/certs.d/$IP/
mkdir -p ~/.docker/tls/$IP:4443/ mkdir -p ~/.docker/tls/$IP:4443/
cp /notary_ca/ca.crt /etc/docker/certs.d/$IP/ cp /notary_ca.crt /etc/docker/certs.d/$IP/
cp /notary_ca/ca.crt ~/.docker/tls/$IP:4443/ cp /notary_ca.crt ~/.docker/tls/$IP:4443/
export DOCKER_CONTENT_TRUST=1 export DOCKER_CONTENT_TRUST=1
export DOCKER_CONTENT_TRUST_SERVER=https://$IP:4443 export DOCKER_CONTENT_TRUST_SERVER=https://$IP:4443

View File

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

View File

@ -547,7 +547,7 @@ Test Case - Project Quotas Control Under GC
${image_a_ver}= Set Variable 6.8.3 ${image_a_ver}= Set Variable 6.8.3
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project project${d} storage_quota=${storage_quota} storage_quota_unit=${storage_quota_unit} Create An New Project project${d} storage_quota=${storage_quota} storage_quota_unit=${storage_quota_unit}
Cannot Push image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image_a}:${image_a_ver} err_msg=Quota exceeded when processing the request of adding 82.5 MiB of storage resource, which when updated to current usage of 166.6 MiB will exceed the configured upper limit of 200.0 MiB 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
GC Now ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} GC Now ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
@{param} Create List project${d} @{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} Retry Keyword When Return Value Mismatch Get Project Storage Quota Text From Project Quotas List 0Byte of ${storage_quota}${storage_quota_unit} 60 @{param}

View File

@ -40,7 +40,7 @@ Test Case - Project Level Policy Content Trust
Close Browser Close Browser
Test Case - Admin Push Signed Image Test Case - Admin Push Signed Image
Body Of Admin Push Signed Image tomcat Body Of Admin Push Signed Image
Test Case - Admin Push Signed Image And Remove Signature Test Case - Admin Push Signed Image And Remove Signature
Body Of Admin Push Signed Image mariadb with_remove=${true} Body Of Admin Push Signed Image image=mariadb with_remove=${true}