mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Fix issues in replication tests
Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
af3a638980
commit
e20cb51d6b
@ -181,7 +181,7 @@ Docker Push Index
|
||||
Docker Image Can Not Be Pulled
|
||||
[Arguments] ${image}
|
||||
:FOR ${idx} IN RANGE 0 30
|
||||
\ ${out} Run Keyword And Ignore Error Command Should be Failed docker pull ${image}
|
||||
\ ${out}= Run Keyword And Ignore Error Command Should be Failed docker pull ${image}
|
||||
\ Exit For Loop If '${out[0]}'=='PASS'
|
||||
\ Sleep 3
|
||||
Log To Console Cannot Pull Image From Docker - Pull Log: ${out[1]}
|
||||
@ -191,7 +191,7 @@ Docker Image Can Be Pulled
|
||||
[Arguments] ${image} ${period}=60 ${times}=10
|
||||
:For ${n} IN RANGE 1 ${times}
|
||||
\ Sleep ${period}
|
||||
\ ${out} Run Keyword And Ignore Error Docker Pull ${image}
|
||||
\ ${out}= Run Keyword And Ignore Error Docker Pull ${image}
|
||||
\ Log To Console Return value is ${out[0]}
|
||||
\ Exit For Loop If '${out[0]}'=='PASS'
|
||||
\ Sleep 5
|
||||
|
@ -225,7 +225,7 @@ Delete Endpoint
|
||||
|
||||
Select Rule And Replicate
|
||||
[Arguments] ${rule_name}
|
||||
Retry Double Keywords When Error Retry Element Click //hbr-list-replication-rule//clr-dg-cell[contains(.,'${rule_name}')] Wait Until Element Is Visible And Enabled ${replication_exec_id}
|
||||
Select Rule ${rule_name}
|
||||
Retry Element Click ${replication_exec_id}
|
||||
Retry Double Keywords When Error Retry Element Click xpath=${dialog_replicate} Retry Wait Until Page Not Contains Element xpath=${dialog_replicate}
|
||||
|
||||
@ -257,3 +257,12 @@ Image Should Be Replicated To Project
|
||||
\ Sleep 5
|
||||
Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot
|
||||
Should Be Equal As Strings '${out[0]}' 'PASS'
|
||||
|
||||
Executions Result Count Should Be
|
||||
[Arguments] ${expected_status} ${expected_trigger_type} ${expected_result_count}
|
||||
Sleep 10
|
||||
${count}= Get Element Count xpath=//clr-dg-row[contains(.,'${expected_status}') and contains(.,'${expected_trigger_type}')]
|
||||
Capture Page Screenshot
|
||||
Should Be Equal As Integers ${count} ${expected_result_count}
|
||||
Capture Page Screenshot
|
||||
|
||||
|
@ -156,7 +156,7 @@ Test Case - Replication Of Pull Images from DockerHub To Self
|
||||
Switch To Registries
|
||||
Create A New Endpoint docker-hub e${d} https://hub.docker.com/ danfengliu Aa123456 Y
|
||||
Switch To Replication Manage
|
||||
Create A Rule With Existing Endpoint rule${d} pull danfengliu/* image e${d} project${d}
|
||||
Create A Rule With Existing Endpoint rule${d} pull danfengliu/{cent*,mariadb} image e${d} project${d}
|
||||
Select Rule And Replicate rule${d}
|
||||
#In docker-hub, under repository danfengliu, there're only 2 images: centos,mariadb.
|
||||
Image Should Be Replicated To Project project${d} centos
|
||||
@ -274,7 +274,7 @@ Test Case - Replication Of Pull Images from Google-GCR To Self
|
||||
Image Should Be Replicated To Project project${d} tomcat
|
||||
Close Browser
|
||||
|
||||
Test Case - Replication Of Push Images to DockerHub
|
||||
Test Case - Replication Of Push Images to DockerHub Triggered By Event
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
${sha256}= Set Variable 0e67625224c1da47cb3270e7a861a83e332f708d3d89dde0cbed432c94824d9a
|
||||
@ -282,19 +282,19 @@ Test Case - Replication Of Push Images to DockerHub
|
||||
#login source
|
||||
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
||||
Create An New Project And Go Into Project project${d}
|
||||
${image_with_tag}= Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image} sha256=${sha256} tag_suffix=${true}
|
||||
Switch To Registries
|
||||
Create A New Endpoint docker-hub e${d} https://hub.docker.com/ dockerhubtesterforharbor Aa12344321 Y
|
||||
Create A New Endpoint docker-hub e${d} https://hub.docker.com/ danfengliu Aa123456 Y
|
||||
Switch To Replication Manage
|
||||
Create A Rule With Existing Endpoint rule${d} push project${d}/* image e${d} dockerhubtesterforharbor mode=Event Based del_remote=${true}
|
||||
Create A Rule With Existing Endpoint rule${d} push project${d}/* image e${d} danfengliu mode=Event Based del_remote=${true}
|
||||
${image_with_tag}= Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image} sha256=${sha256} tag_suffix=${true}
|
||||
Filter Replicatin Rule rule${d}
|
||||
Select Rule And Replicate rule${d}
|
||||
Sleep 20
|
||||
Docker Image Can Be Pulled dockerhubtesterforharbor/${image_with_tag} times=3
|
||||
Go Into Project project${d}
|
||||
Delete Repo project${d}
|
||||
Switch To Replication Manage
|
||||
Filter Replicatin Rule rule${d}
|
||||
Select Rule And Replicate rule${d}
|
||||
Sleep 30
|
||||
Docker Image Can Not Be Pulled dockerhubtesterforharbor/${image_with_tag}
|
||||
Select Rule rule${d}
|
||||
Docker Image Can Be Pulled danfengliu/${image_with_tag} times=3
|
||||
Executions Result Count Should Be Succeeded event_based 1
|
||||
Go Into Project project${d}
|
||||
Delete Repo project${d}
|
||||
Docker Image Can Not Be Pulled danfengliu/${image_with_tag}
|
||||
Switch To Replication Manage
|
||||
Filter Replicatin Rule rule${d}
|
||||
Select Rule rule${d}
|
||||
Executions Result Count Should Be Succeeded event_based 2
|
Loading…
Reference in New Issue
Block a user