mirror of
https://github.com/goharbor/harbor
synced 2025-04-21 16:42:56 +00:00
Check the vul data before running scan-on-push case
Update the automation case to wait until the vul data is ready before running the scan-on-push case Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
parent
163fc11b7f
commit
40f8f4bc5d
@ -58,3 +58,16 @@ Resource Cert-Util.robot
|
|||||||
Resource SeleniumUtil.robot
|
Resource SeleniumUtil.robot
|
||||||
Resource Nightly-Util.robot
|
Resource Nightly-Util.robot
|
||||||
Resource APITest-Util.robot
|
Resource APITest-Util.robot
|
||||||
|
|
||||||
|
*** Keywords ***
|
||||||
|
Wait Unitl Vul Data Ready
|
||||||
|
[Arguments] ${url} ${timeout} ${interval}
|
||||||
|
${n}= Evaluate ${timeout}/${interval}
|
||||||
|
:FOR ${i} IN RANGE ${n}
|
||||||
|
\ Log Checking the vul data: ${i} ... console=True
|
||||||
|
\ ${rc} ${output}= Run And Return Rc And Output curl -k ${url}/api/systeminfo
|
||||||
|
\ Should Be Equal As Integers ${rc} 0
|
||||||
|
\ ${contains}= Run Keyword And Return Status Should Contain ${output} overall_last_update
|
||||||
|
\ Exit For Loop If ${contains}
|
||||||
|
\ Sleep ${interval}
|
||||||
|
Run Keyword If ${i+1}==${n} Fail The vul data is not ready
|
||||||
|
@ -593,19 +593,6 @@ Test Case - Manual Scan All
|
|||||||
Summary Chart Should Display latest
|
Summary Chart Should Display latest
|
||||||
Close Browser
|
Close Browser
|
||||||
|
|
||||||
Test Case - Scan Image On Push
|
|
||||||
Init Chrome Driver
|
|
||||||
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
||||||
Go Into Project library
|
|
||||||
Goto Project Config
|
|
||||||
Enable Scan On Push
|
|
||||||
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library memcached
|
|
||||||
Back To Projects
|
|
||||||
Go Into Project library
|
|
||||||
Go Into Repo memcached
|
|
||||||
Summary Chart Should Display latest
|
|
||||||
Close Browser
|
|
||||||
|
|
||||||
Test Case - View Scan Results
|
Test Case - View Scan Results
|
||||||
Init Chrome Driver
|
Init Chrome Driver
|
||||||
${d}= get current date result_format=%m%s
|
${d}= get current date result_format=%m%s
|
||||||
@ -695,3 +682,17 @@ Test Case - Admin Push Signed Image
|
|||||||
Log To Console ${output}
|
Log To Console ${output}
|
||||||
Should Be Equal As Integers ${rc} 0
|
Should Be Equal As Integers ${rc} 0
|
||||||
Should Contain ${output} sha256
|
Should Contain ${output} sha256
|
||||||
|
|
||||||
|
Test Case - Admin Push Signed Image
|
||||||
|
Wait Unitl Vul Data Ready ${HARBOR_URL} 7200 30
|
||||||
|
Init Chrome Driver
|
||||||
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
||||||
|
Go Into Project library
|
||||||
|
Goto Project Config
|
||||||
|
Enable Scan On Push
|
||||||
|
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library memcached
|
||||||
|
Back To Projects
|
||||||
|
Go Into Project library
|
||||||
|
Go Into Repo memcached
|
||||||
|
Summary Chart Should Display latest
|
||||||
|
Close Browser
|
Loading…
x
Reference in New Issue
Block a user