From 4882def74f03bb8ba9b1496077188e5a3c6e1cf5 Mon Sep 17 00:00:00 2001 From: Yang Jiao Date: Thu, 20 Jan 2022 09:26:05 +0000 Subject: [PATCH] Add copy accessory test case Signed-off-by: Yang Jiao --- tests/resources/Docker-Util.robot | 4 +++ tests/robot-cases/Group1-Nightly/Common.robot | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/tests/resources/Docker-Util.robot b/tests/resources/Docker-Util.robot index 818a66929..c68b3e4d1 100644 --- a/tests/resources/Docker-Util.robot +++ b/tests/resources/Docker-Util.robot @@ -220,6 +220,10 @@ Docker Login [Arguments] ${server} ${username} ${password} Wait Unitl Command Success docker login -u ${username} -p ${password} ${server} +Docker Logout + [Arguments] ${server} + Wait Unitl Command Success docker logout ${server} + Docker Pull [Arguments] ${image} ${output}= Retry Keyword N Times When Error 6 Wait Unitl Command Success docker pull ${image} diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index 3f0a7ab91..a809cf6e9 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -518,6 +518,36 @@ Test Case - Copy A Image Retry Wait Until Page Contains Element xpath=${tag_value_xpath} Close Browser +Test Case - Copy A Image And Accessory + [Tags] copy_image_and_accessory + Init Chrome Driver + ${d}= Get Current Date result_format=%m%s + ${source_project}= Set Variable source_project${d} + ${target_project}= Set Variable target_project${d} + ${user}= Set Variable user006 + ${pwd}= Set Variable Test1@34 + ${image}= Set Variable redis + ${tag}= Set Variable latest + + Sign In Harbor ${HARBOR_URL} ${user} ${pwd} + Create An New Project And Go Into Project ${target_project} + Create An New Project And Go Into Project ${source_project} + + Push Image With Tag ${ip} ${user} ${pwd} ${source_project} ${image} ${tag} + Cosign Generate Key Pair + Docker Login ${ip} ${user} ${pwd} + Cosign Sign ${ip}/${source_project}/${image}:${tag} + Docker Logout ${ip} + Retry Double Keywords When Error Go Into Repo ${source_project}/${image} Should Be Signed By Cosign ${tag} + + Copy Image ${tag} ${target_project} ${image} + Retry Wait Until Page Contains Copy artifact successfully + + Retry Double Keywords When Error Go Into Project ${target_project} Retry Wait Until Page Contains ${image} + Retry Double Keywords When Error Go Into Repo ${target_project}/${image} Retry Wait Until Page Contains Element //clr-dg-row[contains(.,${tag})] + Should Be Signed By Cosign ${tag} + Close Browser + Test Case - Create An New Project With Quotas Set Init Chrome Driver ${d}= Get Current Date result_format=%m%s