diff --git a/tests/resources/Docker-Util.robot b/tests/resources/Docker-Util.robot index 114eacf07..6febee4d6 100644 --- a/tests/resources/Docker-Util.robot +++ b/tests/resources/Docker-Util.robot @@ -28,7 +28,9 @@ Pull image ${image_with_tag}= Set Variable If '${tag}'=='${null}' ${image} ${image}:${tag} Run Keyword If ${is_robot}==${false} Wait Unitl Command Success docker login -u ${user} -p ${pwd} ${ip} ... ELSE Wait Unitl Command Success docker login -u robot\\\$${user} -p ${pwd} ${ip} - ${output}= Wait Unitl Command Success docker pull ${ip}/${project}/${image_with_tag} + ${output}= Docker Pull ${ip}/${project}/${image_with_tag} + Log ${output} + Log To Console ${output} Should Contain ${output} Digest: Should Contain ${output} Status: Should Not Contain ${output} No such image: @@ -38,7 +40,7 @@ Push image ${image_with_sha256}= Set Variable If '${sha256}'=='${null}' ${image} ${image}@sha256:${sha256} ${image_with_tag}= Set Variable If '${sha256}'=='${null}' ${image} ${image}:${sha256} Log To Console \nRunning docker push ${image}... - Wait Unitl Command Success docker pull ${image_with_sha256} + Docker Pull ${image_with_sha256} Run Keyword If ${is_robot}==${false} Wait Unitl Command Success docker login -u ${user} -p ${pwd} ${ip} ... ELSE Wait Unitl Command Success docker login -u robot\\\$${user} -p ${pwd} ${ip} Wait Unitl Command Success docker tag ${image_with_sha256} ${ip}/${project}/${image_with_tag} @@ -50,7 +52,7 @@ Push Image With Tag #tag1 is tag of image on docker hub,default latest,use a version existing if you do not want to use latest [Arguments] ${ip} ${user} ${pwd} ${project} ${image} ${tag} ${tag1}=latest Log To Console \nRunning docker push ${image}... - Wait Unitl Command Success docker pull ${image}:${tag1} + Docker Pull ${image}:${tag1} Wait Unitl Command Success docker login -u ${user} -p ${pwd} ${ip} Wait Unitl Command Success docker tag ${image}:${tag1} ${ip}/${project}/${image}:${tag} Wait Unitl Command Success docker push ${ip}/${project}/${image}:${tag} @@ -75,7 +77,7 @@ Cannot Pull Unsigned Image Cannot Push image [Arguments] ${ip} ${user} ${pwd} ${project} ${image} ${err_msg}=${null} Log To Console \nRunning docker push ${image}... - Wait Unitl Command Success docker pull ${image} + Docker Pull ${image} Wait Unitl Command Success docker login -u ${user} -p ${pwd} ${ip} Wait Unitl Command Success docker tag ${image} ${ip}/${project}/${image} ${output}= Command Should be Failed docker push ${ip}/${project}/${image} @@ -140,7 +142,10 @@ Docker Login Docker Pull [Arguments] ${image} - Wait Unitl Command Success docker pull ${image} + ${output}= Retry Keyword When Error Wait Unitl Command Success docker pull ${image} + Log ${output} + Log To Console Docker Pull: \n ${output} + [Return] ${output} Docker Tag [Arguments] ${src_image} ${dst_image} diff --git a/tests/resources/Harbor-Util.robot b/tests/resources/Harbor-Util.robot index 6c984ea80..12cd9ad6d 100644 --- a/tests/resources/Harbor-Util.robot +++ b/tests/resources/Harbor-Util.robot @@ -80,9 +80,7 @@ Switch To LDAP Config Harbor cfg auth=ldap_auth http_proxy=https Prepare Up Harbor - ${rc}= Run And Return Rc docker pull osixia/openldap:1.1.7 - Log ${rc} - Should Be Equal As Integers ${rc} 0 + Docker Pull osixia/openldap:1.1.7 ${rc} ${output}= Run And Return Rc And Output cd tests && ./ldapprepare.sh Log ${rc} Log ${output} diff --git a/tests/resources/TestCaseBody.robot b/tests/resources/TestCaseBody.robot index 083ae4d13..bb2eb8f6b 100644 --- a/tests/resources/TestCaseBody.robot +++ b/tests/resources/TestCaseBody.robot @@ -101,8 +101,7 @@ Body Of Admin Push Signed Image [Arguments] ${image}=tomcat ${with_remove}=${false} Enable Notary Client - ${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest - Log ${output} + Docker Pull hello-world:latest 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 ${notaryServerEndpoint} diff --git a/tests/resources/Util.robot b/tests/resources/Util.robot index 0b282a44e..d357fd784 100644 --- a/tests/resources/Util.robot +++ b/tests/resources/Util.robot @@ -233,6 +233,7 @@ Retry Keyword When Error \ Sleep 2 Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot Should Be Equal As Strings '${out[0]}' 'PASS' + [Return] ${out[1]} Retry Keyword When Return Value Mismatch [Arguments] ${keyword} ${expected_value} ${count} @{elements} diff --git a/tests/robot-cases/Group0-BAT/BAT.robot b/tests/robot-cases/Group0-BAT/BAT.robot index 473d74c65..2a4ecf838 100644 --- a/tests/robot-cases/Group0-BAT/BAT.robot +++ b/tests/robot-cases/Group0-BAT/BAT.robot @@ -26,13 +26,13 @@ ${HARBOR_URL} https://${ip} Test Case - Registry Basic Verfication Init Chrome Driver ${d}= Get Current Date result_format=%m%s - + Create An New Project With New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=tester${d} newPassword=Test1@34 comment=harbor projectname=project${d} public=true Push image ${ip} tester${d} Test1@34 project${d} busybox:latest - Pull image ${ip} tester${d} Test1@34 project${d} busybox:latest + Pull image ${ip} tester${d} Test1@34 project${d} busybox:latest Go Into Project project${d} Delete Repo project${d} - + Close Browser Test Case - Clair Basic Verfication @@ -52,7 +52,7 @@ Test Case - Notary Basic Verfication ${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest 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} ${notaryServerEndpoint} Log ${output}