mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-02 13:01:23 +01:00
Merge pull request #6030 from wy65701436/add-gc-e2e
add gc e2e test case
This commit is contained in:
commit
20a6a8738e
@ -276,3 +276,19 @@ Delete A Label
|
|||||||
Capture Page Screenshot
|
Capture Page Screenshot
|
||||||
Click Element xpath=//clr-modal//div//button[contains(.,'DELETE')]
|
Click Element xpath=//clr-modal//div//button[contains(.,'DELETE')]
|
||||||
Wait Until Page Contains Element //clr-tab-content//div[contains(.,'${labelname}')]/../div/clr-icon[@shape="success-standard"]
|
Wait Until Page Contains Element //clr-tab-content//div[contains(.,'${labelname}')]/../div/clr-icon[@shape="success-standard"]
|
||||||
|
|
||||||
|
## Garbage Collection
|
||||||
|
Switch To Garbage Collection
|
||||||
|
Sleep 1
|
||||||
|
Click Element xpath=${configuration_xpath}
|
||||||
|
Wait Until Page Contains Element ${garbage_collection_xpath}
|
||||||
|
Click Element xpath=${garbage_collection_xpath}
|
||||||
|
|
||||||
|
Click GC Now
|
||||||
|
Sleep 1
|
||||||
|
Click Element xpath=${gc_now_xpath}
|
||||||
|
Sleep 2
|
||||||
|
|
||||||
|
View GC Details
|
||||||
|
Click Element xpath=${gc_log_details_xpath}
|
||||||
|
Sleep 2
|
||||||
|
@ -21,4 +21,7 @@ ${self_reg_xpath} //input[@id="clr-checkbox-selfReg"]
|
|||||||
${test_ldap_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[3]
|
${test_ldap_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[3]
|
||||||
${config_save_button_xpath} //config//div/button[contains(.,'SAVE')]
|
${config_save_button_xpath} //config//div/button[contains(.,'SAVE')]
|
||||||
${configuration_xpath} //clr-vertical-nav-group-children/a[contains(.,'Configuration')]
|
${configuration_xpath} //clr-vertical-nav-group-children/a[contains(.,'Configuration')]
|
||||||
${system_config_xpath} //*[@id="config-system"]
|
${system_config_xpath} //*[@id="config-system"]
|
||||||
|
${garbage_collection_xpath} //*[@id="config-gc"]
|
||||||
|
${gc_now_xpath} //*[@id="gc"]/gc-config/button
|
||||||
|
${gc_log_details_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/section[6]/gc-config/clr-datagrid/div/div/div/clr-dg-table-wrapper/div[2]/clr-dg-row/div/clr-dg-cell[6]/a
|
@ -37,6 +37,35 @@ Test Case - Vulnerability Data Not Ready
|
|||||||
Switch To Configure
|
Switch To Configure
|
||||||
Go To Vulnerability Config
|
Go To Vulnerability Config
|
||||||
Vulnerability Not Ready Config Hint
|
Vulnerability Not Ready Config Hint
|
||||||
|
|
||||||
|
Test Case - Garbage Collection
|
||||||
|
Init Chrome Driver
|
||||||
|
${d}= Get Current Date result_format=%m%s
|
||||||
|
|
||||||
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
||||||
|
Create An New Project project${d}
|
||||||
|
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world
|
||||||
|
Sleep 2
|
||||||
|
Go Into Project project${d}
|
||||||
|
Delete Repo project${d}
|
||||||
|
|
||||||
|
Switch To Garbage Collection
|
||||||
|
Click GC Now
|
||||||
|
Logout Harbor
|
||||||
|
Sleep 2
|
||||||
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
||||||
|
Switch To Garbage Collection
|
||||||
|
Sleep 1
|
||||||
|
Wait Until Page Contains Finished
|
||||||
|
|
||||||
|
${rc} ${output}= Run And Return Rc And Output curl -u ${HARBOR_ADMIN}:${HARBOR_PASSWORD} -s --insecure -H "Content-Type: application/json" -X GET "https://${ip}/api/system/gc/2/log"
|
||||||
|
Log To Console ${output}
|
||||||
|
Should Be Equal As Integers ${rc} 0
|
||||||
|
Should Contain ${output} 3 blobs eligible for deletion
|
||||||
|
Should Contain ${output} Deleting blob:
|
||||||
|
Should Contain ${output} success to run gc in job.
|
||||||
|
|
||||||
|
Close Browser
|
||||||
|
|
||||||
Test Case - Create An New Project
|
Test Case - Create An New Project
|
||||||
Init Chrome Driver
|
Init Chrome Driver
|
||||||
@ -618,22 +647,6 @@ Test Case - Project Level Image Serverity Policy
|
|||||||
Cannot pull image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} haproxy
|
Cannot pull image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} haproxy
|
||||||
Close Browser
|
Close Browser
|
||||||
|
|
||||||
Test Case - Admin Push Signed Image
|
|
||||||
Enable Notary Client
|
|
||||||
|
|
||||||
${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest
|
|
||||||
Log ${output}
|
|
||||||
|
|
||||||
Push image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library hello-world:latest
|
|
||||||
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-push-image.sh ${ip} ${notaryServerEndpoint}
|
|
||||||
Log ${output}
|
|
||||||
Should Be Equal As Integers ${rc} 0
|
|
||||||
|
|
||||||
${rc} ${output}= Run And Return Rc And Output curl -u admin:Harbor12345 -s --insecure -H "Content-Type: application/json" -X GET "https://${ip}/api/repositories/library/tomcat/signatures"
|
|
||||||
Log To Console ${output}
|
|
||||||
Should Be Equal As Integers ${rc} 0
|
|
||||||
Should Contain ${output} sha256
|
|
||||||
|
|
||||||
Test Case - List Helm Charts
|
Test Case - List Helm Charts
|
||||||
Init Chrome Driver
|
Init Chrome Driver
|
||||||
${d}= Get Current Date result_format=%m%s
|
${d}= Get Current Date result_format=%m%s
|
||||||
@ -665,3 +678,19 @@ Test Case - List Helm Charts
|
|||||||
|
|
||||||
Go Back To Versions And Delete
|
Go Back To Versions And Delete
|
||||||
Close Browser
|
Close Browser
|
||||||
|
|
||||||
|
Test Case - Admin Push Signed Image
|
||||||
|
Enable Notary Client
|
||||||
|
|
||||||
|
${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest
|
||||||
|
Log ${output}
|
||||||
|
|
||||||
|
Push image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library hello-world:latest
|
||||||
|
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-push-image.sh ${ip} ${notaryServerEndpoint}
|
||||||
|
Log ${output}
|
||||||
|
Should Be Equal As Integers ${rc} 0
|
||||||
|
|
||||||
|
${rc} ${output}= Run And Return Rc And Output curl -u admin:Harbor12345 -s --insecure -H "Content-Type: application/json" -X GET "https://${ip}/api/repositories/library/tomcat/signatures"
|
||||||
|
Log To Console ${output}
|
||||||
|
Should Be Equal As Integers ${rc} 0
|
||||||
|
Should Contain ${output} sha256
|
Loading…
Reference in New Issue
Block a user