mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +01:00
Change parameter image to optional
1. Change parameter in Keyword Body Of Admin Push Signed Image to an optional one. 2. Loose the restriction for Quotas error message verification. 3. Get cert for notary from API instead of local file. Signed-off-by: Danfeng Liu (c) <danfengl@vmware.com>
This commit is contained in:
parent
1855558739
commit
8bfc5d12c3
@ -95,24 +95,9 @@ Switch To LDAP
|
||||
Enable Notary Client
|
||||
${rc} ${output}= Run And Return Rc And Output rm -rf ~/.docker/
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
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}/
|
||||
${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 ${output}
|
||||
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
|
||||
[Arguments] ${ip} ${image}
|
||||
|
@ -98,7 +98,7 @@ Body Of List Helm Charts
|
||||
Close Browser
|
||||
|
||||
Body Of Admin Push Signed Image
|
||||
[Arguments] ${image} ${with_remove}=${false}
|
||||
[Arguments] ${image}=tomcat ${with_remove}=${false}
|
||||
Enable Notary Client
|
||||
|
||||
${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest
|
||||
|
@ -10,8 +10,8 @@ echo $IP
|
||||
mkdir -p /etc/docker/certs.d/$IP/
|
||||
mkdir -p ~/.docker/tls/$IP:4443/
|
||||
|
||||
cp /notary_ca/ca.crt /etc/docker/certs.d/$IP/
|
||||
cp /notary_ca/ca.crt ~/.docker/tls/$IP:4443/
|
||||
cp /notary_ca.crt /etc/docker/certs.d/$IP/
|
||||
cp /notary_ca.crt ~/.docker/tls/$IP:4443/
|
||||
|
||||
export DOCKER_CONTENT_TRUST=1
|
||||
export DOCKER_CONTENT_TRUST_SERVER=https://$IP:4443
|
||||
|
@ -5,7 +5,7 @@ set PROJECT [lindex $argv 1]
|
||||
set IMAGE [lindex $argv 2]
|
||||
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 {
|
||||
"Enter username:" {send "admin\r";exp_continue}
|
||||
|
@ -547,7 +547,7 @@ Test Case - Project Quotas Control Under GC
|
||||
${image_a_ver}= Set Variable 6.8.3
|
||||
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}
|
||||
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}
|
||||
@{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}
|
||||
|
@ -40,7 +40,7 @@ Test Case - Project Level Policy Content Trust
|
||||
Close Browser
|
||||
|
||||
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
|
||||
Body Of Admin Push Signed Image mariadb with_remove=${true}
|
||||
Body Of Admin Push Signed Image image=mariadb with_remove=${true}
|
Loading…
Reference in New Issue
Block a user