${rc} ${output}= Run And Return Rc And Output make package_online GOBUILDTAGS="include_oss include_gcs" VERSIONTAG=%{Harbor_Assets_Version} PKGVERSIONTAG=%{Harbor_Package_Version} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} CHARTFLAG=${with_chartmuseum} TRIVYFLAG=${with_trivy} HTTPPROXY=
Log ${rc}
Log ${output}
Should Be Equal As Integers ${rc} 0
Switch To LDAP
Down Harbor
${rc} ${output}= Run And Return Rc And Output rm -rf /data
Log ${rc}
Should Be Equal As Integers ${rc} 0
Prepare Cert
Config Harbor cfg auth=ldap_auth http_proxy=https
Prepare
Up Harbor
Docker Pull osixia/openldap:1.1.7
${rc} ${output}= Run And Return Rc And Output cd tests && ./ldapprepare.sh
Log ${rc}
Log ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker ps
Log ${output}
Should Be Equal As Integers ${rc} 0
Generate Certificate Authority For Chrome
Enable Notary Client
${rc} ${output}= Run And Return Rc And Output rm -rf ~/.docker/
Log ${rc}
${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/v2.0/systeminfo/getcert'
Log ${output}
Should Be Equal As Integers ${rc} 0
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} ${notaryServerEndpoint}
${rc} ${output}= Run And Return Rc And Output make install swagger_client NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} CHARTFLAG=${with_chartmuseum} HTTPPROXY=
Log ${output}
Should Be Equal As Integers ${rc} 0
Sleep 20
Wait for Harbor Ready
[Arguments] ${protocol} ${HARBOR_IP}
Log To Console Waiting for Harbor to Come Up...
FOR ${i} IN RANGE 20
${out}= Run curl -k ${protocol}://${HARBOR_IP}
Log ${out}
${status}= Run Keyword And Return Status Should Not Contain ${out} 502 Bad Gateway
${status}= Run Keyword If ${status} Run Keyword And Return Status Should Not Contain ${out} Connection refused
${status}= Run Keyword If ${status} Run Keyword And Return Status Should Contain ${out} <title>Harbor</title>
Return From Keyword If ${status} ${HARBOR_IP}
Sleep 30s
END
Fail Harbor failed to come up properly!
Get Harbor Version
${rc} ${output}= Run And Return Rc And Output curl -k -X GET --header 'Accept: application/json' 'https://${ip}/api/v2.0/systeminfo'|grep -i harbor_version