From 101e7b7e5160b02321a4d1bc87e1bb6174d08de6 Mon Sep 17 00:00:00 2001 From: Yang Jiao Date: Wed, 5 Jul 2023 14:00:37 +0000 Subject: [PATCH] Add replication by chunk testcase Fix #17951 Signed-off-by: Yang Jiao --- .../resources/Harbor-Pages/Replication.robot | 23 +++++++++++++------ .../Harbor-Pages/Replication_Elements.robot | 1 + .../Group1-Nightly/Replication.robot | 12 ++++++---- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/tests/resources/Harbor-Pages/Replication.robot b/tests/resources/Harbor-Pages/Replication.robot index e57b0b2116c..050ef7c16c9 100644 --- a/tests/resources/Harbor-Pages/Replication.robot +++ b/tests/resources/Harbor-Pages/Replication.robot @@ -113,14 +113,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} @@ -129,14 +129,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} Sleep 2 @@ -293,3 +295,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 diff --git a/tests/resources/Harbor-Pages/Replication_Elements.robot b/tests/resources/Harbor-Pages/Replication_Elements.robot index 57574d170d6..3ad520220f8 100644 --- a/tests/resources/Harbor-Pages/Replication_Elements.robot +++ b/tests/resources/Harbor-Pages/Replication_Elements.robot @@ -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'] diff --git a/tests/robot-cases/Group1-Nightly/Replication.robot b/tests/robot-cases/Group1-Nightly/Replication.robot index 015d5e1fcec..3aed8c4f68e 100644 --- a/tests/robot-cases/Group1-Nightly/Replication.robot +++ b/tests/robot-cases/Group1-Nightly/Replication.robot @@ -384,9 +384,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} - Retry Wait Until Page Contains Succeeded + 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} period=0 @@ -406,10 +407,11 @@ 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} - Retry Wait Until Page Contains Succeeded - Image Should Be Replicated To Project project_dest${d} ${image1} period=0 + 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} period=0 Should Be Signed By Cosign ${tag2}