Merge pull request #6205 from ywk253100/181102_case

Check the vul data before running scan-on-push case
This commit is contained in:
Wenkai Yin 2018-11-05 21:09:26 +08:00 committed by GitHub
commit 8c376ac55a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 15 deletions

View File

@ -58,3 +58,16 @@ Resource Cert-Util.robot
Resource SeleniumUtil.robot
Resource Nightly-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

View File

@ -593,19 +593,6 @@ Test Case - Manual Scan All
Summary Chart Should Display latest
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
Init Chrome Driver
${d}= get current date result_format=%m%s
@ -695,3 +682,17 @@ Test Case - Admin Push Signed Image
Log To Console ${output}
Should Be Equal As Integers ${rc} 0
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