From 7217ed5358e21ffd163b5ae847f5cbffca11eacc Mon Sep 17 00:00:00 2001 From: danfengliu Date: Wed, 21 Aug 2019 14:12:12 +0800 Subject: [PATCH] Add CVE Whitelist test cases into nightly test, first test case is system CVE Whitelist test. Signed-off-by: danfengliu --- tests/resources/Docker-Util.robot | 5 +- .../Harbor-Pages/Configuration.robot | 141 ++++++++++-------- .../Harbor-Pages/Configuration_Elements.robot | 7 +- .../Project-Config-Elements.robot | 6 + .../Harbor-Pages/Project-Config.robot | 39 ++++- .../Harbor-Pages/Project_Elements.robot | 6 + .../Harbor-Pages/Vulnerability.robot | 6 +- tests/resources/Util.robot | 1 + tests/robot-cases/Group1-Nightly/Clair.robot | 86 +++++++++++ 9 files changed, 225 insertions(+), 72 deletions(-) create mode 100644 tests/resources/Harbor-Pages/Project-Config-Elements.robot diff --git a/tests/resources/Docker-Util.robot b/tests/resources/Docker-Util.robot index f7c2e50c9..42fe29f33 100644 --- a/tests/resources/Docker-Util.robot +++ b/tests/resources/Docker-Util.robot @@ -23,10 +23,11 @@ Run Docker Info Wait Unitl Command Success docker ${docker-params} info Pull image - [Arguments] ${ip} ${user} ${pwd} ${project} ${image} + [Arguments] ${ip} ${user} ${pwd} ${project} ${image} ${tag}=${null} Log To Console \nRunning docker pull ${image}... + ${image_with_tag}= Set Variable If '${tag}'=='${null}' ${image} ${image}:${tag} Wait Unitl Command Success docker login -u ${user} -p ${pwd} ${ip} - ${output}= Wait Unitl Command Success docker pull ${ip}/${project}/${image} + ${output}= Wait Unitl Command Success docker pull ${ip}/${project}/${image_with_tag} Should Contain ${output} Digest: Should Contain ${output} Status: Should Not Contain ${output} No such image: diff --git a/tests/resources/Harbor-Pages/Configuration.robot b/tests/resources/Harbor-Pages/Configuration.robot index 2d6042296..76bc1bd73 100644 --- a/tests/resources/Harbor-Pages/Configuration.robot +++ b/tests/resources/Harbor-Pages/Configuration.robot @@ -38,14 +38,14 @@ Init LDAP Sleep 1 Capture Page Screenshot Disable Ldap Verify Cert Checkbox - Click Element xpath=${config_auth_save_button_xpath} + Retry Element Click xpath=${config_auth_save_button_xpath} Sleep 2 - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[3] + Retry Element Click xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[3] Sleep 1 Capture Page Screenshot Switch To Configure - Click Element xpath=${configuration_xpath} + Retry Element Click xpath=${configuration_xpath} Sleep 2 Test Ldap Connection @@ -64,7 +64,7 @@ Test Ldap Connection Sleep 1 # default is checked, click test connection to verify fail as no cert. - Click Element xpath=${test_ldap_xpath} + Retry Element Click xpath=${test_ldap_xpath} Sleep 1 Wait Until Page Contains Failed to verify LDAP server with error Sleep 5 @@ -72,12 +72,12 @@ Test Ldap Connection Disable Ldap Verify Cert Checkbox # ldap checkbox unchecked, click test connection to verify success. Sleep 1 - Click Element xpath=${test_ldap_xpath} + Retry Element Click xpath=${test_ldap_xpath} Capture Page Screenshot Wait Until Page Contains Connection to LDAP server is verified timeout=15 Test LDAP Server Success - Click Element xpath=${test_ldap_xpath} + Retry Element Click xpath=${test_ldap_xpath} Wait Until Page Contains Connection to LDAP server is verified timeout=15 Disable Ldap Verify Cert Checkbox @@ -90,47 +90,47 @@ Disable Ldap Verify Cert Checkbox Ldap Verify Cert Checkbox Should Be Disabled Checkbox Should Not Be Selected xpath=//*[@id='clr-checkbox-ldapVerifyCert'] -Set Pro Create Admin Only +Set Pro Create Admin Only #set limit to admin only - Click Element xpath=${configuration_xpath} + Retry Element Click xpath=${configuration_xpath} Sleep 2 - Click Element xpath=${system_config_xpath} + Retry Element Click xpath=${system_config_xpath} Sleep 1 - Click Element xpath=//select[@id='proCreation'] - Click Element xpath=//select[@id='proCreation']//option[@value='adminonly'] + Retry Element Click xpath=//select[@id='proCreation'] + Retry Element Click xpath=//select[@id='proCreation']//option[@value='adminonly'] Sleep 1 - Click Element xpath=${config_system_save_button_xpath} + Retry Element Click xpath=${config_system_save_button_xpath} Capture Page Screenshot AdminCreateOnly.png Set Pro Create Every One - Click Element xpath=${configuration_xpath} + Retry Element Click xpath=${configuration_xpath} sleep 1 #set limit to Every One - Click Element xpath=${system_config_xpath} + Retry Element Click xpath=${system_config_xpath} Sleep 1 - Click Element xpath=//select[@id='proCreation'] - Click Element xpath=//select[@id='proCreation']//option[@value='everyone'] - Sleep 1 - Click Element xpath=${config_system_save_button_xpath} + Retry Element Click xpath=//select[@id='proCreation'] + Retry Element Click xpath=//select[@id='proCreation']//option[@value='everyone'] + Sleep 1 + Retry Element Click xpath=${config_system_save_button_xpath} Sleep 2 Capture Page Screenshot EveryoneCreate.png Disable Self Reg - Click Element xpath=${configuration_xpath} + Retry Element Click xpath=${configuration_xpath} Mouse Down xpath=${self_reg_xpath} Mouse Up xpath=${self_reg_xpath} Sleep 1 Self Reg Should Be Disabled - Click Element xpath=${config_auth_save_button_xpath} + Retry Element Click xpath=${config_auth_save_button_xpath} Capture Page Screenshot DisableSelfReg.png Sleep 1 -Enable Self Reg +Enable Self Reg Mouse Down xpath=${self_reg_xpath} Mouse Up xpath=${self_reg_xpath} Sleep 1 Self Reg Should Be Enabled - Click Element xpath=${config_auth_save_button_xpath} + Retry Element Click xpath=${config_auth_save_button_xpath} Capture Page Screenshot EnableSelfReg.png Sleep 1 @@ -146,56 +146,56 @@ Project Creation Should Display Project Creation Should Not Display Page Should Not Contain Element xpath=${project_create_xpath} -## System settings +## System settings Switch To System Settings Sleep 1 - Click Element xpath=${configuration_xpath} - Click Element xpath=${system_config_xpath} + Retry Element Click xpath=${configuration_xpath} + Retry Element Click xpath=${system_config_xpath} Modify Token Expiration [Arguments] ${minutes} Input Text xpath=//*[@id='tokenExpiration'] ${minutes} - Click Button xpath=${config_system_save_button_xpath} + Click Button xpath=${config_system_save_button_xpath} Sleep 1 Token Must Be Match [Arguments] ${minutes} Textfield Value Should Be xpath=//*[@id='tokenExpiration'] ${minutes} -## Replication -Check Verify Remote Cert - Mouse Down xpath=//*[@id='clr-checkbox-verifyRemoteCert'] +## Replication +Check Verify Remote Cert + Mouse Down xpath=//*[@id='clr-checkbox-verifyRemoteCert'] Mouse Up xpath=//*[@id='clr-checkbox-verifyRemoteCert'] - Click Element xpath=${config_save_button_xpath} + Retry Element Click xpath=${config_save_button_xpath} Capture Page Screenshot RemoteCert.png Sleep 1 Switch To System Replication Sleep 1 Switch To Configure - Click Element xpath=//*[@id='config-replication'] + Retry Element Click xpath=//*[@id='config-replication'] Sleep 1 Should Verify Remote Cert Be Enabled Checkbox Should Not Be Selected xpath=//*[@id='clr-checkbox-verifyRemoteCert'] -## Email +## Email Switch To Email Switch To Configure - Click Element xpath=//*[@id='config-email'] + Retry Element Click xpath=//*[@id='config-email'] Sleep 1 Config Email Input Text xpath=//*[@id='mailServer'] smtp.vmware.com Input Text xpath=//*[@id='emailPort'] 25 - Input Text xpath=//*[@id='emailUsername'] example@vmware.com + Input Text xpath=//*[@id='emailUsername'] example@vmware.com Input Text xpath=//*[@id='emailPassword'] example Input Text xpath=//*[@id='emailFrom'] example - Sleep 1 - Click Element xpath=//clr-checkbox-wrapper[@id='emailSSL-wrapper']//label Sleep 1 - Click Element xpath=//clr-checkbox-wrapper[@id='emailInsecure-wrapper']//label + Retry Element Click xpath=//clr-checkbox-wrapper[@id='emailSSL-wrapper']//label Sleep 1 - Click Element xpath=${config_email_save_button_xpath} + Retry Element Click xpath=//clr-checkbox-wrapper[@id='emailInsecure-wrapper']//label + Sleep 1 + Retry Element Click xpath=${config_email_save_button_xpath} Sleep 6 Verify Email @@ -207,19 +207,19 @@ Verify Email Checkbox Should Not Be Selected xpath=//*[@id='emailInsecure'] Set Scan All To None - click element //vulnerability-config//select - click element //vulnerability-config//select/option[@value='none'] + Retry Element Click //vulnerability-config//select + Retry Element Click //vulnerability-config//select/option[@value='none'] sleep 1 - click element ${vulnerbility_save_button_xpath} + Retry Element Click ${vulnerbility_save_button_xpath} Set Scan All To Daily - click element //vulnerability-config//select - click element //vulnerability-config//select/option[@value='daily'] + Retry Element Click //vulnerability-config//select + Retry Element Click //vulnerability-config//select/option[@value='daily'] sleep 1 - click element ${vulnerbility_save_button_xpath} + Retry Element Click ${vulnerbility_save_button_xpath} Click Scan Now - click element //vulnerability-config//button[contains(.,'SCAN')] + Retry Element Click //vulnerability-config//button[contains(.,'SCAN')] Enable Read Only @@ -235,63 +235,80 @@ Disable Read Only ## System labels Switch To System Labels Sleep 1 - Click Element xpath=${configuration_xpath} - Click Element xpath=//*[@id='config-label'] + Retry Element Click xpath=${configuration_xpath} + Retry Element Click xpath=//*[@id='config-label'] + +## System labels +Switch To Configuration System Setting + Sleep 1 + Retry Element Click xpath=${configuration_xpath} + Retry Element Click xpath=${configuration_system_xpath} Create New Labels [Arguments] ${labelname} - Click Element xpath=//button[contains(.,'New Label')] + Retry Element Click xpath=//button[contains(.,'New Label')] Sleep 1 Input Text xpath=//*[@id='name'] ${labelname} Sleep 1 - Click Element xpath=//hbr-create-edit-label//clr-dropdown/clr-icon + Retry Element Click xpath=//hbr-create-edit-label//clr-dropdown/clr-icon Sleep 1 - Click Element xpath=//hbr-create-edit-label//clr-dropdown-menu/label[1] + Retry Element Click xpath=//hbr-create-edit-label//clr-dropdown-menu/label[1] Sleep 1 Input Text xpath=//*[@id='description'] global - Click Element xpath=//div/form/section/label[4]/button[2] + Retry Element Click xpath=//div/form/section/label[4]/button[2] Capture Page Screenshot Wait Until Page Contains ${labelname} Update A Label [Arguments] ${labelname} - Click Element xpath=//clr-dg-row[contains(.,'${labelname}')]//clr-checkbox-wrapper + Retry Element Click xpath=//clr-dg-row[contains(.,'${labelname}')]//clr-checkbox-wrapper Sleep 1 - Click Element xpath=//button[contains(.,'Edit')] + Retry Element Click xpath=//button[contains(.,'Edit')] Sleep 1 Input Text xpath=//*[@id='name'] ${labelname}1 Sleep 1 - Click Element xpath=//hbr-create-edit-label//form/section//button[2] + Retry Element Click xpath=//hbr-create-edit-label//form/section//button[2] Capture Page Screenshot Wait Until Page Contains ${labelname}1 Delete A Label [Arguments] ${labelname} - Click Element xpath=//clr-dg-row[contains(.,'${labelname}')]//clr-checkbox-wrapper + Retry Element Click xpath=//clr-dg-row[contains(.,'${labelname}')]//clr-checkbox-wrapper Sleep 1 - Click ELement xpath=//button[contains(.,'Delete')] + Retry Element Click xpath=//button[contains(.,'Delete')] Sleep 3 Capture Page Screenshot - Click Element xpath=//clr-modal//div//button[contains(.,'DELETE')] + Retry Element Click 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 +## Garbage Collection Switch To Garbage Collection Sleep 1 Retry Element Click xpath=${gc_config_page} - Wait Until Page Contains Element ${garbage_collection_xpath} - Click Element xpath=${garbage_collection_xpath} + Wait Until Page Contains Element ${garbage_collection_xpath} + Retry Element Click xpath=${garbage_collection_xpath} Click GC Now Sleep 1 - Click Element xpath=${gc_now_xpath} + Retry Element Click xpath=${gc_now_xpath} Sleep 2 View GC Details - Click Element xpath=${gc_log_details_xpath} + Retry Element Click xpath=${gc_log_details_xpath} Sleep 2 Switch To GC History Retry Element Click xpath=${gc_log_xpath} Retry Wait Until Page Contains Job +Add Items To System CVE Whitelist + [Arguments] ${cve_id} + Retry Element Click ${configuration_system_wl_add_btn} + Retry Text Input ${configuration_system_wl_textarea} ${cve_id} + Retry Element Click ${configuration_system_wl_add_confirm_btn} + Retry Element Click ${config_system_save_button_xpath} + +Delete Top Item In System CVE Whitelist + [Arguments] + Retry Element Click ${configuration_system_wl_delete_a_cve_id_icon} + Retry Element Click ${config_system_save_button_xpath} \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/Configuration_Elements.robot b/tests/resources/Harbor-Pages/Configuration_Elements.robot index 47eccd4c5..28fe46888 100644 --- a/tests/resources/Harbor-Pages/Configuration_Elements.robot +++ b/tests/resources/Harbor-Pages/Configuration_Elements.robot @@ -30,4 +30,9 @@ ${garbage_collection_xpath} //*[@id='config-gc'] ${gc_log_xpath} //*[@id='gc-log'] ${gc_config_page} //clr-vertical-nav-group-children/a[contains(.,'Garbage')] ${gc_now_xpath} //*[@id='gc']/gc-config//button[contains(.,'GC')] -${gc_log_details_xpath} //*[@id='clr-dg-row26']/clr-dg-cell[6]/a \ No newline at end of file +${gc_log_details_xpath} //*[@id='clr-dg-row26']/clr-dg-cell[6]/a +${configuration_system_xpath} //*[@id='config-system'] +${configuration_system_wl_add_btn} //*[@id='show-add-modal-button'] +${configuration_system_wl_textarea} //*[@id='whitelist-textarea'] +${configuration_system_wl_add_confirm_btn} //*[@id='add-to-system'] +${configuration_system_wl_delete_a_cve_id_icon} //system-settings/form/section//ul/li[1]/clr-icon \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/Project-Config-Elements.robot b/tests/resources/Harbor-Pages/Project-Config-Elements.robot new file mode 100644 index 000000000..d67317b8f --- /dev/null +++ b/tests/resources/Harbor-Pages/Project-Config-Elements.robot @@ -0,0 +1,6 @@ +*** Settings *** +Documentation This resource provides any keywords related to the Harbor private registry appliance + +*** Variables *** +${project_configuration_wl_delete_a_cve_id_icon} //hbr-project-policy-config/form/section//ul/li[1]/clr-icon +${project_configuration_wl_project_add_system_btn} //button[@id='add-system'] \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/Project-Config.robot b/tests/resources/Harbor-Pages/Project-Config.robot index 4d5467a7b..24f19e0fe 100644 --- a/tests/resources/Harbor-Pages/Project-Config.robot +++ b/tests/resources/Harbor-Pages/Project-Config.robot @@ -9,7 +9,7 @@ ${HARBOR_VERSION} V1.1.1 Goto Project Config Sleep 3 - Click Element //project-detail//ul/li[contains(.,'Configuration')] + Retry Element Click //project-detail//ul/li[contains(.,'Configuration')] Sleep 2 Click Project Public @@ -27,8 +27,8 @@ Click Prevent Running Select Prevent Level #value NEGLIGIBLE LOW MEDIUM HIGH [Arguments] ${level} - Click Element //hbr-project-policy-config//select - Click Element //hbr-project-policy-config//select/option[contains(.,'${level}')] + Retry Element Click //hbr-project-policy-config//select + Retry Element Click //hbr-project-policy-config//select/option[contains(.,'${level}')] Click Auto Scan Mouse Down //hbr-project-policy-config//input[@name='scan-image-on-push'] @@ -36,7 +36,7 @@ Click Auto Scan Save Project Config Sleep 1 - Click Element //hbr-project-policy-config//button[contains(.,'SAVE')] + Retry Element Click //hbr-project-policy-config//button[contains(.,'SAVE')] Public Should Be Selected Checkbox Should Be Selected //hbr-project-policy-config//input[@name='public'] @@ -54,3 +54,34 @@ Prevent Running Should Be Selected Auto Scan Should Be Selected Checkbox Should Be Selected //hbr-project-policy-config//input[@name='scan-image-on-push'] +Select System CVE Whitelist + Retry Element Click ${project_config_system_wl_radio_input} + +Select Prject CVE Whitelist + Retry Element Click ${project_config_project_wl_radio_input} + +Add System CVE Whitelist to Project CVE Whitelist By Add System Button Click + Goto Project Config + Select Prject CVE Whitelist + Retry Element Click ${project_configuration_wl_project_add_system_btn} + Retry Element Click ${project_config_save_btn} + +Set Project To Project Level CVE Whitelist + Goto Project Config + Select Prject CVE Whitelist + Retry Element Click ${project_config_save_btn} + +Add Items to Project CVE Whitelist + [Arguments] ${cve_id} + Goto Project Config + Select Prject CVE Whitelist + Retry Element Click ${project_config_project_wl_add_btn} + Retry Text Input ${configuration_system_wl_textarea} ${cve_id} + Retry Element Click ${project_config_project_wl_add_confirm_btn} + Retry Element Click ${project_config_save_btn} + +Delete Top Item In Project CVE Whitelist + [Arguments] + Goto Project Config + Retry Element Click ${project_configuration_wl_delete_a_cve_id_icon} + Retry Element Click ${project_config_save_btn} diff --git a/tests/resources/Harbor-Pages/Project_Elements.robot b/tests/resources/Harbor-Pages/Project_Elements.robot index 0b7baa24d..e2aad34aa 100644 --- a/tests/resources/Harbor-Pages/Project_Elements.robot +++ b/tests/resources/Harbor-Pages/Project_Elements.robot @@ -51,3 +51,9 @@ ${project_member_action_xpath} xpath=//*[@id='member-action'] ${project_member_set_role_xpath} xpath=//clr-dropdown-menu//label[contains(.,'SET ROLE')] ${project_config_public_checkbox} xpath=//input[@name='public'] ${project_config_public_checkbox_label} xpath=//div[@id='clr-wrapper-public']//label[contains(.,'Public')] +${project_config_prevent_vulenrability_checkbox_label} xpath=//div[@id='prevent-vulenrability-image']//clr-checkbox-wrapper//label +${project_config_system_wl_radio_input} xpath=//clr-radio-wrapper//label[contains(.,'System whitelist')] +${project_config_project_wl_radio_input} xpath=//clr-radio-wrapper//label[contains(.,'Project whitelist')] +${project_config_project_wl_add_btn} xpath=//*[@id='show-add-modal'] +${project_config_project_wl_add_confirm_btn} xpath=//*[@id='add-to-whitelist'] +${project_config_save_btn} xpath=//hbr-project-policy-config//button[contains(.,'SAVE')] diff --git a/tests/resources/Harbor-Pages/Vulnerability.robot b/tests/resources/Harbor-Pages/Vulnerability.robot index ba42a5631..809cb4668 100644 --- a/tests/resources/Harbor-Pages/Vulnerability.robot +++ b/tests/resources/Harbor-Pages/Vulnerability.robot @@ -27,13 +27,13 @@ Set Vulnerabilty Serverity [Arguments] ${level} Goto Project Config #enable first - Retry Element Click //project-detail//div[@id='prevent-vulenrability-image']//label + Retry Element Click ${project_config_prevent_vulenrability_checkbox_label} Checkbox Should Be Selected //project-detail//clr-checkbox-wrapper//input[@name='prevent-vulenrability-image-input'] Retry Element Click //project-detail//select #wait for dropdown popup Sleep 1 Select From List By Index //project-detail//select ${level} - Retry Element Click //hbr-project-policy-config//button[contains(.,'SAVE')] + Retry Element Click ${project_config_save_btn} Scan Is Disabled Retry Wait Until Page Contains Element //button[contains(.,'Scan') and @disabled=''] @@ -62,7 +62,7 @@ Enable Scan On Push Checkbox Should Not Be Selected //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//input Retry Element Click //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//label Checkbox Should Be Selected //clr-checkbox-wrapper[@id='scan-image-on-push-wrapper']//input - Retry Element Click //hbr-project-policy-config//button[contains(.,'SAVE')] + Retry Element Click ${project_config_save_btn} Sleep 10 Vulnerability Not Ready Project Hint diff --git a/tests/resources/Util.robot b/tests/resources/Util.robot index 7e69ac4bc..4a35bddaf 100644 --- a/tests/resources/Util.robot +++ b/tests/resources/Util.robot @@ -38,6 +38,7 @@ Resource Harbor-Pages/Project-Members_Elements.robot Resource Harbor-Pages/Project-Repository.robot Resource Harbor-Pages/Project-Repository_Elements.robot Resource Harbor-Pages/Project-Config.robot +Resource Harbor-Pages/Project-Config-Elements.robot Resource Harbor-Pages/Project-Helmcharts.robot Resource Harbor-Pages/Project-Helmcharts_Elements.robot Resource Harbor-Pages/Project-Retag.robot diff --git a/tests/robot-cases/Group1-Nightly/Clair.robot b/tests/robot-cases/Group1-Nightly/Clair.robot index b98bf2451..8843ab5b4 100644 --- a/tests/robot-cases/Group1-Nightly/Clair.robot +++ b/tests/robot-cases/Group1-Nightly/Clair.robot @@ -143,3 +143,89 @@ Test Case - Project Level Image Serverity Policy Set Vulnerabilty Serverity 0 Cannot pull image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image} tag=${sha256} Close Browser + +#Important Note: All CVE IDs in CVE Whitelist cases must unique! +Test Case - Verfiy System Level CVE Whitelist + [Tags] run-once + Init Chrome Driver + ${d}= Get Current Date result_format=%m%S + ${image}= Set Variable postgres + ${sha256}= Set Variable 68b49a280d2fbe9330c0031970ebb72015e1272dfa25f0ed7557514f9e5ad7b7 + ${signin_user}= Set Variable user025 + ${signin_pwd}= Set Variable Test1@34 + Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd} + Create An New Project project${d} + Push Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} sha256=${sha256} tag=${sha256} + Go Into Project project${d} + Set Vulnerabilty Serverity 0 + Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Go Into Project project${d} + Go Into Repo project${d}/${image} + Scan Repo ${sha256} Succeed + Logout Harbor + Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} + Switch To Configure + Switch To Configuration System Setting + Add Items To System CVE Whitelist CVE-2019-12900\nCVE-2017-14062\nCVE-2019-11068\nCVE-2016-9427\nCVE-2018-6551\nCVE-2018-1000001\nCVE-2018-6485\nCVE-2019-9169\nCVE-2016-2779\nCVE-2019-13917\nCVE-2017-12424 + Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Add Items To System CVE Whitelist CVE-2019-8457 + Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Delete Top Item In System CVE Whitelist + Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Close Browser + +Test Case - Verfiy Project Level CVE Whitelist + [Tags] run-once + Init Chrome Driver + ${d}= Get Current Date result_format=%m%S + ${image}= Set Variable redis + ${sha256}= Set Variable 9755880356c4ced4ff7745bafe620f0b63dd17747caedba72504ef7bac882089 + ${signin_user}= Set Variable user025 + ${signin_pwd}= Set Variable Test1@34 + Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd} + Create An New Project project${d} + Push Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} sha256=${sha256} tag=${sha256} + Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Go Into Project project${d} + Set Vulnerabilty Serverity 1 + Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Go Into Project project${d} + Go Into Repo project${d}/${image} + Scan Repo ${sha256} Succeed + Go Into Project project${d} + Add Items to Project CVE Whitelist CVE-2019-12904\nCVE-2011-3389\nCVE-2018-12886\nCVE-2019-3843\nCVE-2018-20839 + Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Add Items to Project CVE Whitelist CVE-2019-3844 + Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Delete Top Item In Project CVE Whitelist + Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Close Browser + +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 + ${image}= Set Variable httpd + ${sha256}= Set Variable 98caed3e3a90ed9db8d25dcbb98eebe0ce56358a9dbbc940d7eb66a8e2b88252 + ${signin_user}= Set Variable user025 + ${signin_pwd}= Set Variable Test1@34 + Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} + Switch To Configure + Switch To Configuration System Setting + Add Items To System CVE Whitelist CVE-2013-7445\nCVE-2019-15099\nCVE-2019-15504\nCVE-2019-15505\nCVE-2019-9511\nCVE-2019-9513 + Logout Harbor + Sign In Harbor ${HARBOR_URL} ${signin_user} ${signin_pwd} + Create An New Project project${d} + Push Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} sha256=${sha256} tag=${sha256} + Go Into Project project${d} + Set Vulnerabilty Serverity 0 + Go Into Project project${d} + Go Into Repo project${d}/${image} + Scan Repo ${sha256} Succeed + Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Go Into Project project${d} + Set Project To Project Level CVE Whitelist + Cannot Pull image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Add System CVE Whitelist to Project CVE Whitelist By Add System Button Click + Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} + Close Browser \ No newline at end of file