From 8503957eac6486fcc4be861566426019a5ad6072 Mon Sep 17 00:00:00 2001 From: danfengliu Date: Wed, 4 Sep 2019 13:52:56 +0800 Subject: [PATCH] 1.Add CVE white list API test into API_DB.robot;2.Random data for prject name should use lower case %m%s;3.Replace from harbor to self. Signed-off-by: danfengliu --- tests/resources/Harbor-Pages/Verify.robot | 2 ++ tests/robot-cases/Group0-BAT/API_DB.robot | 4 +++ tests/robot-cases/Group1-Nightly/Clair.robot | 7 +++-- tests/robot-cases/Group1-Nightly/OIDC.robot | 2 +- .../Group1-Nightly/Replication.robot | 26 +++++++++---------- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/tests/resources/Harbor-Pages/Verify.robot b/tests/resources/Harbor-Pages/Verify.robot index f47184fbc..7fa76285b 100644 --- a/tests/resources/Harbor-Pages/Verify.robot +++ b/tests/resources/Harbor-Pages/Verify.robot @@ -27,6 +27,8 @@ Verify Project Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} :FOR ${project} IN @{project} \ Page Should Contain ${project} + #TO_DO: + #Verify project metadata. Close Browser Verify Image Tag diff --git a/tests/robot-cases/Group0-BAT/API_DB.robot b/tests/robot-cases/Group0-BAT/API_DB.robot index da35f2222..fe6b422f0 100644 --- a/tests/robot-cases/Group0-BAT/API_DB.robot +++ b/tests/robot-cases/Group0-BAT/API_DB.robot @@ -49,3 +49,7 @@ Test Case - Robot Account Harbor API Test ./tests/apitests/python/test_robot_account.py Test Case - Sign A Image Harbor API Test ./tests/apitests/python/test_sign_image.py +Test Case - System Level CVE Whitelist + Harbor API Test ./tests/apitests/python/test_sys_cve_whitelists.py +#Test Case - Project Level CVE Whitelist +# Harbor API Test ./tests/apitests/python/test_project_level_cve_whitelist.py diff --git a/tests/robot-cases/Group1-Nightly/Clair.robot b/tests/robot-cases/Group1-Nightly/Clair.robot index a6594148c..a4ffd31ee 100644 --- a/tests/robot-cases/Group1-Nightly/Clair.robot +++ b/tests/robot-cases/Group1-Nightly/Clair.robot @@ -49,7 +49,6 @@ Test Case - Scan A Tag In The Repo Test Case - Scan As An Unprivileged User Init Chrome Driver - ${d}= get current date result_format=%m%s Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library hello-world Sign In Harbor ${HARBOR_URL} user024 Test1@34 @@ -148,7 +147,7 @@ Test Case - Project Level Image Serverity Policy Test Case - Verfiy System Level CVE Whitelist [Tags] run-once Init Chrome Driver - ${d}= Get Current Date result_format=%m%S + ${d}= Get Current Date result_format=%m%s ${image}= Set Variable postgres ${sha256}= Set Variable 68b49a280d2fbe9330c0031970ebb72015e1272dfa25f0ed7557514f9e5ad7b7 ${signin_user}= Set Variable user025 @@ -177,7 +176,7 @@ Test Case - Verfiy System Level CVE Whitelist Test Case - Verfiy Project Level CVE Whitelist [Tags] run-once Init Chrome Driver - ${d}= Get Current Date result_format=%m%S + ${d}= Get Current Date result_format=%m%s ${image}= Set Variable redis ${sha256}= Set Variable 9755880356c4ced4ff7745bafe620f0b63dd17747caedba72504ef7bac882089 ${signin_user}= Set Variable user025 @@ -204,7 +203,7 @@ Test Case - Verfiy Project Level CVE Whitelist Test Case - Verfiy Project Level CVE Whitelist By Quick Way of Add System [Tags] run-once Init Chrome Driver - ${d}= Get Current Date result_format=%m%S + ${d}= Get Current Date result_format=%m%s #Image for test: haproxy:1.5 ${image}= Set Variable haproxy ${sha256}= Set Variable eca4db0f144d40554e97d000a414a0535720e5d6e559731860558676a57529f8 diff --git a/tests/robot-cases/Group1-Nightly/OIDC.robot b/tests/robot-cases/Group1-Nightly/OIDC.robot index ce791f81a..a426e65aa 100644 --- a/tests/robot-cases/Group1-Nightly/OIDC.robot +++ b/tests/robot-cases/Group1-Nightly/OIDC.robot @@ -50,7 +50,7 @@ Test Case - OIDC User Sign In Test Case - Create An New Project Sign In Harbor With OIDC User ${HARBOR_URL} - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s Create An New Project test${d} Close Browser diff --git a/tests/robot-cases/Group1-Nightly/Replication.robot b/tests/robot-cases/Group1-Nightly/Replication.robot index 71fd24ffa..997456ec6 100644 --- a/tests/robot-cases/Group1-Nightly/Replication.robot +++ b/tests/robot-cases/Group1-Nightly/Replication.robot @@ -45,7 +45,7 @@ Test Case - Pro Replication Rules Add Test Case - Harbor Endpoint Verification #This case need vailid info and selfsign cert Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Switch To Registries Create A New Endpoint harbor edp1${d} https://${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} N @@ -57,7 +57,7 @@ Test Case - Harbor Endpoint Verification Test Case - DockerHub Endpoint Add #This case need vailid info and selfsign cert Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Switch To Registries Create A New Endpoint docker-hub edp1${d} https://hub.docker.com/ danfengliu Aa123456 Y @@ -66,7 +66,7 @@ Test Case - DockerHub Endpoint Add Test Case - Harbor Endpoint Add #This case need vailid info and selfsign cert Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Switch To Registries Create A New Endpoint harbor testabc https://${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Y @@ -92,7 +92,7 @@ Test Case - Harbor Endpoint Delete Test Case - Replication Rule Edit Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s ${endpoint1}= Set Variable e1${d} ${endpoint2}= Set Variable e2${d} ${rule_name_old}= Set Variable rule_testabc${d} @@ -134,7 +134,7 @@ Test Case - Replication Rule Edit Test Case - Replication Rule Delete Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s ${endpoint1}= Set Variable e1${d} ${rule_name}= Set Variable rule_testabc${d} Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} @@ -147,7 +147,7 @@ Test Case - Replication Rule Delete Test Case - Replication Of Pull Images from DockerHub To Self Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s #login source Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Create An New Project project${d} @@ -168,7 +168,7 @@ Test Case - Replication Of Pull Images from DockerHub To Self Test Case - Replication Of Push Images from Self To Harbor Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s #login source Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Create An New Project project${d} @@ -199,7 +199,7 @@ Test Case - Replication Of Push Images from Self To Harbor Test Case - Replication Of Push Chart from Self To Harbor Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s #login source Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Create An New Project project${d} @@ -231,7 +231,7 @@ Test Case - Replication Of Push Chart from Self To Harbor Test Case - Replication Of Push Images from Self To Harbor By Push Event Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s #login source Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Create An New Project project${d} @@ -251,9 +251,9 @@ Test Case - Replication Of Push Images from Self To Harbor By Push Event Retry Wait Until Page Contains project_dest${d}/centos Close Browser -Test Case - Replication Of Pull Images from AWS-ECR To Harbor +Test Case - Replication Of Pull Images from AWS-ECR To Self Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s #login source Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Create An New Project project${d} @@ -272,9 +272,9 @@ Test Case - Replication Of Pull Images from AWS-ECR To Harbor Retry Wait Until Page Contains project${d}/tomcat Close Browser -Test Case - Replication Of Pull Images from Google-GCR To Harbor +Test Case - Replication Of Pull Images from Google-GCR To Self Init Chrome Driver - ${d}= Get Current Date result_format=%M%S + ${d}= Get Current Date result_format=%m%s #login source Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Create An New Project project${d}