mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-28 09:42:05 +01:00
Add nightly test case for tag immutability
Signed-off-by: Danfeng Liu (c) <danfengl@vmware.com>
This commit is contained in:
parent
9b51123bd3
commit
cf605e430e
@ -27,11 +27,27 @@ Add A Tag Retention Rule
|
||||
Retry Element Click xpath=${project_tag_retention_save_add_button_xpath}
|
||||
Retry Wait Until Page Contains Element xpath=${project_tag_retention_rule_name_xpath}
|
||||
|
||||
Add A Tag Immutability Rule
|
||||
[Arguments] ${scope} ${tag}
|
||||
Retry Double Keywords When Error Retry Element Click xpath=${project_tag_retention_add_rule_xpath} Retry Wait Until Page Contains Element xpath=${project_tag_immutability_save_add_button_xpath}
|
||||
Retry Clear Element Text ${project_tag_immutability_scope_input_xpath}
|
||||
Retry Text Input ${project_tag_immutability_scope_input_xpath} ${scope}
|
||||
Retry Clear Element Text ${project_tag_immutability_tag_input_xpath}
|
||||
Retry Text Input ${project_tag_immutability_tag_input_xpath} ${tag}
|
||||
Retry Double Keywords When Error Retry Element Click xpath=${project_tag_immutability_save_add_button_xpath} Retry Wait Until Page Contains Element xpath=${project_tag_retention_rule_name_xpath}
|
||||
Retry Wait Until Page Contains ${scope}
|
||||
Retry Wait Until Page Contains ${tag}
|
||||
|
||||
Delete A Tag Retention Rule
|
||||
Retry Element Click xpath=${project_tag_retention_action_button_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_delete_button_xpath}
|
||||
Retry Wait Until Page Not Contains Element xpath=${project_tag_retention_rule_name_xpath}
|
||||
|
||||
Delete A Tag Immutability Rule
|
||||
Retry Element Click xpath=${project_tag_retention_action_button_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_delete_button_xpath}
|
||||
Retry Wait Until Page Not Contains Element xpath=${project_tag_retention_rule_name_xpath}
|
||||
|
||||
Edit A Tag Retention Rule
|
||||
[Arguments] ${repos} ${tags}
|
||||
Retry Element Click xpath=${project_tag_retention_action_button_xpath}
|
||||
@ -42,6 +58,18 @@ Edit A Tag Retention Rule
|
||||
Retry Element Click xpath=${project_tag_retention_save_add_button_xpath}
|
||||
Retry Wait Until Page Contains Element xpath=//span[contains(@class, 'rule-name')]//span[contains(.,'${tags}')]
|
||||
|
||||
Edit A Tag Immutability Rule
|
||||
[Arguments] ${scope} ${tag}
|
||||
Retry Element Click xpath=${project_tag_retention_action_button_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_edit_button_xpath}
|
||||
Retry Clear Element Text ${project_tag_immutability_scope_input_xpath}
|
||||
Retry Text Input ${project_tag_immutability_scope_input_xpath} ${scope}
|
||||
Retry Clear Element Text ${project_tag_immutability_tag_input_xpath}
|
||||
Retry Text Input ${project_tag_immutability_tag_input_xpath} ${tag}
|
||||
Retry Double Keywords When Error Retry Element Click xpath=${project_tag_immutability_save_add_button_xpath} Retry Wait Until Page Contains Element xpath=${project_tag_retention_rule_name_xpath}
|
||||
Retry Wait Until Page Contains ${scope}
|
||||
Retry Wait Until Page Contains ${tag}
|
||||
|
||||
Set Daily Schedule
|
||||
Retry Element Click xpath=${project_tag_retention_edit_schedule_xpath}
|
||||
Retry Element Click xpath=${project_tag_retention_select_policy_xpath}
|
||||
|
@ -39,3 +39,7 @@ ${project_tag_retention_action_button_xpath} //button[contains(.,'ACTION')]
|
||||
${project_tag_retention_delete_button_xpath} //div[contains(@class,'dropdown-menu')]//button[contains(.,'Delete')]
|
||||
${project_tag_retention_edit_button_xpath} //div[contains(@class,'dropdown-menu')]//button[contains(.,'Edit')]
|
||||
${project_tag_retention_modal_title_edit_xpath} //h3[contains(.,'Edit Tag Retention Rule')]
|
||||
|
||||
${project_tag_immutability_scope_input_xpath} //*[@id='scope-input']
|
||||
${project_tag_immutability_tag_input_xpath} //*[@id='tag-input']
|
||||
${project_tag_immutability_save_add_button_xpath} //*[@id='add-edit-btn']
|
||||
|
@ -66,7 +66,18 @@ Switch To Project Configuration
|
||||
Sleep 1
|
||||
|
||||
Switch To Tag Retention
|
||||
Retry Element Click xpath=${project_tag_retention_xpath}
|
||||
#Switch To Project Tab Overflow
|
||||
Retry Element Click xpath=${project_tag_strategy_xpath}
|
||||
Sleep 1
|
||||
|
||||
Switch To Tag Immutability
|
||||
#Switch To Project Tab Overflow
|
||||
Retry Double Keywords When Error Retry Element Click xpath=${project_tag_strategy_xpath} Retry Wait Until Page Contains Element ${project_tag_immutability_switch}
|
||||
Retry Double Keywords When Error Retry Element Click xpath=${project_tag_immutability_switch} Retry Wait Until Page Contains Immutability rules
|
||||
Sleep 1
|
||||
|
||||
Switch To Project Tab Overflow
|
||||
Retry Element Click xpath=${project_tab_overflow_btn}
|
||||
Sleep 1
|
||||
|
||||
Navigate To Projects
|
||||
|
@ -26,7 +26,10 @@ ${project_replication_xpath} //project-detail//a[contains(.,'Replication')]
|
||||
${project_log_xpath} //project-detail//li[contains(.,'Logs')]
|
||||
${project_member_xpath} //project-detail//li[contains(.,'Members')]
|
||||
${project_config_tabsheet} xpath=//project-detail//a[contains(.,'Configuration')]
|
||||
${project_tag_retention_xpath} //nav//li//a[contains(.,'Tag')]
|
||||
${project_tag_strategy_xpath} //clr-tabs//a[contains(.,'Tag')]
|
||||
${project_tab_overflow_btn} //clr-tabs//li//button[contains(@class,"dropdown-toggle")]
|
||||
|
||||
${project_tag_immutability_switch} //project-detail/app-tag-feature-integration//label/a[contains(.,'Tag Immutability')]
|
||||
|
||||
${create_project_CANCEL_button_xpath} xpath=//button[contains(.,'CANCEL')]
|
||||
${create_project_OK_button_xpath} xpath=//button[contains(.,'OK')]
|
||||
@ -40,11 +43,11 @@ ${repo_delete_btn} xpath=//repository//button[contains(.,'Delete')]
|
||||
${project_delete_btn} xpath=//list-project//clr-datagrid//button[contains(.,'Delete')]
|
||||
${tag_delete_btn} xpath=//tag-repository//clr-datagrid//button[contains(.,'Delete')]
|
||||
${user_delete_btn} xpath=/clr-dropdown-menu//button[contains(.,'Delete')]
|
||||
#${repo_search_icon} xpath=//hbr-filter//clr-icon
|
||||
#${repo_search_input} xpath=//hbr-filter//input
|
||||
${repo_search_icon} xpath=//hbr-filter//clr-icon
|
||||
${repo_search_input} xpath=//hbr-filter//input
|
||||
${repo_list_spinner} xpath=//clr-datagrid//clr-spinner
|
||||
${repo_search_icon} xpath=//hbr-repository-gridview//clr-datagrid//clr-dg-column[contains(.,'Name')]//clr-dg-string-filter//button//clr-icon
|
||||
${repo_search_input} xpath=//div[@class[contains(.,'datagrid-filter')]]//input
|
||||
#${repo_search_icon} xpath=//hbr-repository-gridview//clr-datagrid//clr-dg-column[contains(.,'Name')]//clr-dg-string-filter//button//clr-icon
|
||||
#${repo_search_input} xpath=//div[@class[contains(.,'datagrid-filter')]]//input
|
||||
${repo_tag_1st_checkbox} xpath=//clr-datagrid//clr-dg-row//clr-checkbox-wrapper
|
||||
${tag_table_column_pull_command} xpath=//clr-dg-column//span[contains(.,'Pull Command')]
|
||||
${tag_table_column_tag} xpath=//clr-dg-column//span[contains(.,'Tag')]
|
||||
|
@ -6,7 +6,7 @@ Resource ../../resources/Util.robot
|
||||
|
||||
*** Keywords ***
|
||||
Switch To Project Robot Account
|
||||
Switch To Project Tab Overflow
|
||||
#Switch To Project Tab Overflow
|
||||
Retry Element Click ${project_robot_account_tabpage}
|
||||
Retry Wait Until Page Contains Element ${project_robot_account_create_btn}
|
||||
|
||||
|
@ -80,9 +80,7 @@ Switch To LDAP
|
||||
Config Harbor cfg auth=ldap_auth http_proxy=https
|
||||
Prepare
|
||||
Up Harbor
|
||||
${rc}= Run And Return Rc docker pull osixia/openldap:1.1.7
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Docker Pull osixia/openldap:1.1.7
|
||||
${rc} ${output}= Run And Return Rc And Output cd tests && ./ldapprepare.sh
|
||||
Log ${rc}
|
||||
Log ${output}
|
||||
@ -95,28 +93,13 @@ Switch To LDAP
|
||||
Enable Notary Client
|
||||
${rc} ${output}= Run And Return Rc And Output rm -rf ~/.docker/
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log ${ip}
|
||||
Log To Console ${ip}
|
||||
${rc}= Run And Return Rc mkdir -p /etc/docker/certs.d/${ip}/
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log To Console ${notaryServerEndpointNoSubDir}
|
||||
${rc}= Run And Return Rc mkdir -p ~/.docker/tls/${notaryServerEndpointNoSubDir}/
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output cp ./harbor_ca.crt /etc/docker/certs.d/${ip}/
|
||||
${rc} ${output}= Run And Return Rc and Output curl -o /notary_ca.crt -s -k -X GET --header 'Accept: application/json' -u 'admin:Harbor12345' 'https://${ip}/api/systeminfo/getcert'
|
||||
Log ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output cp ./harbor_ca.crt ~/.docker/tls/${notaryServerEndpointNoSubDir}/
|
||||
Log ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output ls -la /etc/docker/certs.d/${ip}/
|
||||
Log ${output}
|
||||
${rc} ${output}= Run And Return Rc And Output ls -la ~/.docker/tls/${notaryServerEndpointNoSubDir}/
|
||||
Log ${output}
|
||||
|
||||
Remove Notary Signature
|
||||
[Arguments] ${ip} ${image}
|
||||
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-remove-image-signature.expect ${ip} library ${image}
|
||||
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-remove-image-signature.expect ${ip} library ${image} ${notaryServerEndpoint}
|
||||
Log To Console ${output}
|
||||
Log ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
@ -98,7 +98,7 @@ Body Of List Helm Charts
|
||||
Close Browser
|
||||
|
||||
Body Of Admin Push Signed Image
|
||||
[Arguments] ${image} ${with_remove}=${false}
|
||||
[Arguments] ${image}=tomcat ${with_remove}=${false}
|
||||
Enable Notary Client
|
||||
|
||||
Docker Pull ${LOCAL_REGISTRY}/${LOCAL_REGISTRY_NAMESPACE}/${image}
|
||||
|
@ -487,8 +487,8 @@ Test Case - Project Storage Quotas Dispaly And Control
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
${storage_quota}= Set Variable 330
|
||||
${storage_quota_unit}= Set Variable MB
|
||||
${image_a}= Set Variable ${LOCAL_REGISTRY}/harbor-ci/redis
|
||||
${image_b}= Set Variable ${LOCAL_REGISTRY}/harbor-ci/logstash
|
||||
${image_a}= Set Variable redis
|
||||
${image_b}= Set Variable logstash
|
||||
${image_a_size}= Set Variable 34.15MB
|
||||
${image_b_size}= Set Variable 321.03MB
|
||||
${image_a_ver}= Set Variable donotremove5.0
|
||||
@ -609,6 +609,28 @@ Test Case - Tag Retention
|
||||
Execute Run
|
||||
Close Browser
|
||||
|
||||
Test Case - Tag Immutability
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New Project project${d}
|
||||
Go Into Project project${d} has_image=${false}
|
||||
Switch To Tag Immutability
|
||||
Add A Tag Immutability Rule 1212 3434
|
||||
Delete A Tag Immutability Rule
|
||||
Add A Tag Immutability Rule 5566 7788
|
||||
Edit A Tag Immutability Rule hello-world latest
|
||||
Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world latest
|
||||
Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} busybox latest
|
||||
Go Into Project project${d}
|
||||
@{repo_list} Create List hello-world busybox
|
||||
Multi-delete Object ${repo_delete_btn} @{repo_list}
|
||||
# Verify
|
||||
Delete Fail hello-world
|
||||
Delete Success busybox
|
||||
Close Browser
|
||||
|
||||
|
||||
Test Case - Robot Account
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
|
Loading…
Reference in New Issue
Block a user