Merge pull request #8904 from danfengliu/Add-ECR-And-GCR-registry-to-nightly-replication-tests

Add AWS-ECR and Google-GCR replication test into nighly tests.
This commit is contained in:
Wang Yan 2019-09-03 13:38:57 +08:00 committed by GitHub
commit 4d5e549731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 64 additions and 4 deletions

View File

@ -20,6 +20,14 @@ Resource ../../resources/Util.robot
${HARBOR_VERSION} v1.1.1
*** Keywords ***
Filter Replicatin Rule
[Arguments] ${ruleName}
${rule_name_element}= Set Variable xpath=//clr-dg-cell[contains(.,'${ruleName}')]
Retry Element Click ${filter_rules_btn}
Retry Text Input ${filter_rules_input} ${ruleName}
Retry Wait Until Page Contains Element ${rule_name_element}
Capture Page Screenshot filter_replic_${ruleName}.png
Select Dest Registry
[Arguments] ${endpoint}
Retry Element Click ${dest_registry_dropdown_list}
@ -35,6 +43,11 @@ Select Trigger
Retry Element Click ${rule_trigger_select}
Retry Element Click ${rule_trigger_select}//option[contains(.,'${mode}')]
Select Destination URL
[Arguments] ${type}
Retry Element Click ${destination_url_xpath}
Retry Element Click ${destination_url_xpath}//option[contains(.,'${type}')]
Check New Rule UI Without Endpoint
Retry Element Click ${new_replication-rule_button}
Page Should Contain Please add an endpoint first
@ -49,8 +62,9 @@ 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}' != 'docker-hub' Run keyword Retry Text Input xpath=${destination_url_xpath} ${url}
Retry Text Input xpath=${destination_username_xpath} ${username}
Run Keyword If '${provider}' == 'harbor' 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' Retry Text Input xpath=${destination_username_xpath} ${username}
Retry Text Input xpath=${destination_password_xpath} ${pwd}
#cancel verify cert since we use a selfsigned cert
Retry Element Click ${destination_insecure_xpath}

View File

@ -80,6 +80,9 @@ ${src_registry_dropdown_list} //select[@id='src_registry_id']
${dest_registry_dropdown_list} //select[@id='dest_registry']
${rule_confirm_btn} //*[@id='ruleBtnOk']
${rule_cancel_btn} //*[@id='ruleBtnCancel']
${filter_rules_btn} //*[@id='filter-rules']
${filter_rules_input} //*[@id='filter-rules']//input

View File

@ -230,11 +230,11 @@ Retry Keyword When Error
Retry Double Keywords When Error
[Arguments] ${keyword1} ${element1} ${keyword2} ${element2}
:For ${n} IN RANGE 1 6
:For ${n} IN RANGE 1 3
\ Log To Console Trying ${keyword1} and ${keyword2} ${n} times ...
\ ${out1} Run Keyword And Ignore Error ${keyword1} ${element1}
\ Capture Page Screenshot
\ Sleep 2
\ Sleep 1
\ ${out2} Run Keyword And Ignore Error ${keyword2} ${element2}
\ Capture Page Screenshot
\ Log To Console Return value is ${out1[0]} ${out2[0]}

View File

@ -250,3 +250,46 @@ Test Case - Replication Of Push Images from Self To Harbor By Push Event
Switch To Project Repo
Retry Wait Until Page Contains project_dest${d}/centos
Close Browser
Test Case - Replication Of Pull Images from AWS-ECR To Harbor
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 project${d}
Switch To Registries
Create A New Endpoint aws-ecr e${d} us-east-2 ${ecr_ac_id} ${ecr_ac_key} Y
Switch To Replication Manage
Create A Rule With Existing Endpoint rule${d} pull a/* image e${d} project${d}
Select Rule And Replicate rule${d}
Sleep 30
Go Into Project project${d}
Switch To Project Repo
#In AWS-ECR, under repository a, there're only several images: httpd,tomcat.
Retry Wait Until Page Contains project${d}/httpd
Go Into Project project${d}
Switch To Project Repo
Retry Wait Until Page Contains project${d}/tomcat
Close Browser
Test Case - Replication Of Pull Images from Google-GCR To Harbor
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 project${d}
Switch To Registries
Create A New Endpoint google-gcr e${d} asia.gcr.io ${null} ${gcr_ac_key} Y
Switch To Replication Manage
Create A Rule With Existing Endpoint rule${d} pull eminent-nation-87317/* image e${d} project${d}
Filter Replicatin Rule rule${d}
Select Rule And Replicate rule${d}
Sleep 30
Go Into Project project${d}
Switch To Project Repo
#In Google-GCR, under repository a, there're only several images: httpd,tomcat.
Retry Wait Until Page Contains project${d}/httpd
Go Into Project project${d}
Switch To Project Repo
Retry Wait Until Page Contains project${d}/tomcat
Close Browser