diff --git a/tests/resources/Harbor-Pages/Project-Config.robot b/tests/resources/Harbor-Pages/Project-Config.robot index aaec6cc20ae..dcf2ebea07e 100644 --- a/tests/resources/Harbor-Pages/Project-Config.robot +++ b/tests/resources/Harbor-Pages/Project-Config.robot @@ -18,6 +18,10 @@ Click Cosign Deployment Security Mouse Down //input[@id='content-trust-cosign'] Mouse Up //input[@id='content-trust-cosign'] +Click Notation Deployment Security + Mouse Down //input[@id='content-trust'] + Mouse Up //input[@id='content-trust'] + Click Prevent Running Mouse Down //hbr-project-policy-config//input[@name='prevent-vulnerability-image'] Mouse Up //hbr-project-policy-config//input[@name='prevent-vulnerability-image'] @@ -45,6 +49,9 @@ Project Should Be Public Content Cosign Deployment security Be Selected Checkbox Should Be Selected //input[@id='content-trust-cosign'] +Content Notation Deployment security Be Selected + Checkbox Should Be Selected //input[@id='content-trust'] + Prevent Running Should Be Selected Checkbox Should Be Selected //hbr-project-policy-config//input[@name='prevent-vulnerability-image'] diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index 63e1c9e516e..9fdcd2b5e1b 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -794,6 +794,35 @@ Test Case - Cosign And Cosign Deployment Security Policy Retry Double Keywords When Error Delete Accessory ${tag} Should be Accessory deleted ${tag} Close Browser +Test Case - Notation And Notation Deployment Security Policy + [Tags] notation + Init Chrome Driver + ${user}= Set Variable user007 + ${pwd}= Set Variable Test1@34 + ${d}= Get Current Date result_format=%m%s + ${image}= Set Variable hello-world + ${tag}= Set Variable latest + Sign In Harbor ${HARBOR_URL} ${user} ${pwd} + Create An New Project And Go Into Project project${d} + Goto Project Config + Click Notation Deployment Security + Save Project Config + Content Notation Deployment security Be Selected + + Push Image With Tag ${ip} ${user} ${pwd} project${d} ${image} ${tag} + Go Into Project project${d} + Go Into Repo project${d} ${image} + Should Not Be Signed ${tag} + Cannot Pull Image ${ip} ${user} ${pwd} project${d} ${image}:${tag} err_msg=The image is not signed by notation. + + Notation Generate Cert + Notation Sign ${ip}/project${d}/${image}:${tag} + + Retry Double Keywords When Error Retry Element Click ${artifact_list_refresh_btn} Should Be Signed ${tag} + Pull image ${ip} ${user} ${pwd} project${d} ${image}:${tag} + Retry Double Keywords When Error Delete Accessory ${tag} Should be Accessory deleted ${tag} + Close Browser + Test Case - Audit Log And Purge [Tags] audit_log_and_purge Init Chrome Driver