mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 02:35:17 +01:00
Add gc e2e test case
Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
5d251ad762
commit
3ef52cafd4
@ -276,3 +276,19 @@ Delete A Label
|
||||
Capture Page Screenshot
|
||||
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"]
|
||||
|
||||
## 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
|
||||
|
@ -22,3 +22,6 @@ ${test_ldap_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/di
|
||||
${config_save_button_xpath} //config//div/button[contains(.,'SAVE')]
|
||||
${configuration_xpath} //clr-vertical-nav-group-children/a[contains(.,'Configuration')]
|
||||
${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
|
@ -38,6 +38,35 @@ Test Case - Vulnerability Data Not Ready
|
||||
Go To Vulnerability Config
|
||||
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
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
@ -616,22 +645,6 @@ Test Case - Project Level Image Serverity Policy
|
||||
Cannot pull image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library haproxy
|
||||
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
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
@ -663,3 +676,19 @@ Test Case - List Helm Charts
|
||||
|
||||
Go Back To Versions And Delete
|
||||
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