Skip to content

Commit

Permalink
Add replication by chunk testcase (#18904)
Browse files Browse the repository at this point in the history
Fix #17951

Signed-off-by: Yang Jiao <jiaoya@vmware.com>
  • Loading branch information
YangJiao0817 authored Jul 7, 2023
1 parent fb52fdb commit adf80e9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
24 changes: 17 additions & 7 deletions tests/resources/Harbor-Pages/Replication.robot
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ Create A New Endpoint
Create A Rule With Existing Endpoint
[Arguments] ${name} ${replication_mode} ${filter_project_name} ${resource_type} ${endpoint} ${dest_namespace}
... ${mode}=Manual ${cron}="* */59 * * * *" ${del_remote}=${false} ${filter_tag}=${false} ${filter_tag_model}=matching ${filter_label}=${false} ${filter_label_model}=matching
... ${flattening}=Flatten 1 Level ${bandwidth}=-1 ${bandwidth_unit}=Kbps
#click new
... ${flattening}=Flatten 1 Level ${bandwidth}=-1 ${bandwidth_unit}=Kbps ${copy_by_chunk}=${false}
# Click new
Retry Double Keywords When Error Retry Element Click ${new_name_xpath} Wait Until Element Is Enabled ${rule_name}
#input name
# Input name
Retry Text Input ${rule_name} ${name}
Run Keyword If '${replication_mode}' == 'push' Run Keywords Retry Element Click ${replication_mode_radio_push} AND Select Dest Registry ${endpoint}
... ELSE Run Keywords Retry Element Click ${replication_mode_radio_pull} AND Select Source Registry ${endpoint}
#set filter
# Set filter
Retry Password Input ${filter_name_id} ${filter_project_name}
Run Keyword If '${filter_tag_model}' != 'matching' Select Filter Tag Model ${filter_tag_model}
Run Keyword If '${filter_tag}' != '${false}' Retry Text Input ${filter_tag_id} ${filter_tag}
Expand All @@ -127,14 +127,16 @@ Create A Rule With Existing Endpoint
Run Keyword And Ignore Error Select From List By Value ${rule_resource_selector} ${resource_type}
Retry Text Input ${dest_namespace_xpath} ${dest_namespace}
Select flattening ${flattening}
#set trigger
# Set trigger
Select Trigger ${mode}
Run Keyword If '${mode}' == 'Scheduled' Retry Text Input ${targetCron_id} ${cron}
Run Keyword If '${mode}' == 'Event Based' and '${del_remote}' == '${true}' Retry Element Click ${del_remote_checkbox}
#set bandwidth
# Set bandwidth
Run Keyword If '${bandwidth}' != '-1' Retry Text Input ${bandwidth_input} ${bandwidth}
Run Keyword If '${bandwidth_unit}' != 'Kbps' Select Bandwidth Unit ${bandwidth_unit}
#click save
# Set copy by chunk
Run Keyword If '${copy_by_chunk}' == '${true}' Retry Element Click ${copy_by_chunk_checkbox}
# Click save
Retry Double Keywords When Error Retry Element Click ${rule_save_button} Retry Wait Until Page Not Contains Element ${rule_save_button}

Endpoint Is Unpingable
Expand Down Expand Up @@ -261,6 +263,7 @@ Image Should Be Replicated To Project
Log To Console Return value is ${out[0]}
Continue For Loop If '${out[0]}'=='FAIL'
Go Into Repo ${project} ${image}
Wait Until Page Contains Element //clr-dg-row[contains(., '${tag}')]//clr-dg-cell[4]/div
${size}= Run Keyword If '${tag}'!='${EMPTY}' and '${expected_image_size_in_regexp}'!='${null}' Get Text //clr-dg-row[contains(., '${tag}')]//clr-dg-cell[4]/div
Run Keyword If '${tag}'!='${EMPTY}' and '${expected_image_size_in_regexp}'!='${null}' Should Match Regexp '${size}' '${expected_image_size_in_regexp}'
${index_out} Go Into Index And Contain Artifacts ${tag} total_artifact_count=${total_artifact_count} archive_count=${archive_count} return_immediately=${true}
Expand All @@ -281,3 +284,10 @@ Executions Result Count Should Be
Check Latest Replication Job Status
[Arguments] ${expected_status}
Retry Wait Element //hbr-replication//div[contains(@class,'datagrid')]//clr-dg-row[1][contains(.,'${expected_status}')]

Check Latest Replication Enabled Copy By Chunk
Retry Link Click //hbr-replication//div[contains(@class,'datagrid')]//clr-dg-row[1]//a
Retry Link Click //clr-dg-row[1]//a
Switch Window locator=NEW
Retry Wait Until Page Contains chunk completed
Switch Window locator=MAIN
1 change: 1 addition & 0 deletions tests/resources/Harbor-Pages/Replication_Elements.robot
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ ${del_remote_checkbox} //label[@for='ruleDeletion']
${filter_registry_btn} //hbr-filter
${filter_registry_input} //input[contains(@class,'filter-input')]
${flattening_select} //select[@id='dest_namespace_replace_count']
${copy_by_chunk_checkbox} //label[@for='by-chunk']
6 changes: 4 additions & 2 deletions tests/robot-cases/Group1-Nightly/Replication.robot
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,10 @@ Test Case - Robot Account Do Replication
Switch To Registries
Create A New Endpoint harbor e${d} https://${ip1} ${robot_account_name} ${robot_account_secret}
Switch To Replication Manage
Create A Rule With Existing Endpoint rule_push_${d} push project${d}/* image e${d} project_dest${d}
Create A Rule With Existing Endpoint rule_push_${d} push project${d}/* image e${d} project_dest${d} copy_by_chunk=${true}
Select Rule And Replicate rule_push_${d}
Check Latest Replication Job Status Succeeded
Check Latest Replication Enabled Copy By Chunk
Logout Harbor
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Image Should Be Replicated To Project project_dest${d} ${image1}
Expand All @@ -403,9 +404,10 @@ Test Case - Robot Account Do Replication
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project And Go Into Project project_dest${d}
Switch To Replication Manage
Create A Rule With Existing Endpoint rule_pull_${d} pull project_dest${d}/* image e${d} project_dest${d}
Create A Rule With Existing Endpoint rule_pull_${d} pull project_dest${d}/* image e${d} project_dest${d} copy_by_chunk=${true}
Select Rule And Replicate rule_pull_${d}
Check Latest Replication Job Status Succeeded
Check Latest Replication Enabled Copy By Chunk
Image Should Be Replicated To Project project_dest${d} ${image1}
Should Be Signed By Cosign ${tag1}
Image Should Be Replicated To Project project_dest${d} ${image2}
Expand Down

0 comments on commit adf80e9

Please sign in to comment.