diff --git a/tests/resources/Harbor-Pages/Replication.robot b/tests/resources/Harbor-Pages/Replication.robot index 6c3463d4a..327d0f985 100644 --- a/tests/resources/Harbor-Pages/Replication.robot +++ b/tests/resources/Harbor-Pages/Replication.robot @@ -69,7 +69,7 @@ Create A New Endpoint #input necessary info Select From List By Value ${provider_selector} ${provider} Retry Text Input xpath=${destination_name_xpath} ${name} - Run Keyword If '${provider}' == 'harbor' Run keyword Retry Text Input xpath=${destination_url_xpath} ${url} + Run Keyword If '${provider}' == 'harbor' or '${provider}' == 'gitlab' Run keyword Retry Text Input xpath=${destination_url_xpath} ${url} Run Keyword If '${provider}' == 'aws-ecr' or '${provider}' == 'google-gcr' Run keyword Select Destination URL ${url} Run Keyword If '${provider}' != 'google-gcr' and '${username}' != '${null}' Retry Text Input xpath=${destination_username_xpath} ${username} Run Keyword If '${pwd}' != '${null}' Retry Text Input xpath=${destination_password_xpath} ${pwd} diff --git a/tests/resources/TestCaseBody.robot b/tests/resources/TestCaseBody.robot index ede514c6f..8087c86cd 100644 --- a/tests/resources/TestCaseBody.robot +++ b/tests/resources/TestCaseBody.robot @@ -340,4 +340,24 @@ Body Of Replication Of Push Images to Registry Triggered By Event Switch To Replication Manage Filter Replication Rule rule${d} Select Rule rule${d} - Executions Result Count Should Be Succeeded event_based 2 \ No newline at end of file + Executions Result Count Should Be Succeeded event_based 2 + +Body Of Replication Of Pull Images from Registry To Self + [Arguments] ${provider} ${endpoint} ${username} ${pwd} ${project_name} @{target_images} + Init Chrome Driver + ${d}= Get Current Date result_format=%m%s + #login source + Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} + Create An New Project And Go Into Project project${d} + Switch To Registries + Create A New Endpoint ${provider} e${d} ${endpoint} ${username} ${pwd} Y + Switch To Replication Manage + Create A Rule With Existing Endpoint rule${d} pull ${project_name} image e${d} project${d} + Select Rule And Replicate rule${d} + #In docker-hub, under repository danfengliu, there're only 2 images: centos,mariadb. + Image Should Be Replicated To Project project${d} centos + Image Should Be Replicated To Project project${d} mariadb + FOR ${item} IN @{target_images} + Log To Console Check image replicated to Project project${d} ${item} + Image Should Be Replicated To Project project${d} ${item} times=2 + Close Browser \ No newline at end of file diff --git a/tests/robot-cases/Group1-Nightly/Replication.robot b/tests/robot-cases/Group1-Nightly/Replication.robot index e45903e6e..51d1b6601 100644 --- a/tests/robot-cases/Group1-Nightly/Replication.robot +++ b/tests/robot-cases/Group1-Nightly/Replication.robot @@ -149,20 +149,8 @@ Test Case - Replication Rule Delete Close Browser Test Case - Replication Of Pull Images from DockerHub To Self - Init Chrome Driver - ${d}= Get Current Date result_format=%m%s - #login source - Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} - Create An New Project And Go Into Project project${d} - Switch To Registries - Create A New Endpoint docker-hub e${d} https://hub.docker.com/ ${DOCKER_USER} ${DOCKER_PWD} Y - Switch To Replication Manage - Create A Rule With Existing Endpoint rule${d} pull ${DOCKER_USER}/{cent*,mariadb} image e${d} project${d} - Select Rule And Replicate rule${d} - #In docker-hub, under repository ${DOCKER_USER}, there're only 2 images: centos,mariadb. - Image Should Be Replicated To Project project${d} centos - Image Should Be Replicated To Project project${d} mariadb - Close Browser + @{target_images}= Create List mariadb centos + Body Of Replication Of Pull Images from Registry To Self docker-hub https://hub.docker.com/ ${DOCKER_USER} ${DOCKER_PWD} ${DOCKER_USER}/{cent*,mariadb} @{target_images} Test Case - Replication Of Push Images from Self To Harbor Init Chrome Driver @@ -283,4 +271,11 @@ Test Case - Replication Of Push Images to DockerHub Triggered By Event #Body Of Replication Of Push Images to Registry Triggered By Event google-gcr gcr.io ${null} ${gcr_ac_key} eminent-nation-87317/harbor-nightly-replication Test Case - Replication Of Push Images to AWS-ECR Triggered By Event - Body Of Replication Of Push Images to Registry Triggered By Event aws-ecr us-east-2 ${ecr_ac_id} ${ecr_ac_key} harbor-nightly-replication \ No newline at end of file + Body Of Replication Of Push Images to Registry Triggered By Event aws-ecr us-east-2 ${ecr_ac_id} ${ecr_ac_key} harbor-nightly-replication + +Test Case - Replication Of Pull Images from Gitlab To Self + @{target_images}= Create List photon alpine + Body Of Replication Of Pull Images from Registry To Self gitlab https://registry.gitlab.com ${gitlab_id} ${gitlab_key} dannylunsa/test_replication/{photon,alpine} @{target_images} + +Test Case - Replication Of Push Images to Gitlab Triggered By Event + Body Of Replication Of Push Images to Registry Triggered By Event gitlab https://registry.gitlab.com ${gitlab_id} ${gitlab_key} bitsf/testci/replication-ci \ No newline at end of file