Skip to content

Commit

Permalink
Add notation pull policy test case
Browse files Browse the repository at this point in the history
Fix #19547

Signed-off-by: Yang Jiao <jiaoya@vmware.com>
  • Loading branch information
Yang Jiao committed Nov 27, 2023
1 parent 5e77048 commit 764ab8e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/resources/Harbor-Pages/Project-Config.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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']

Expand Down
29 changes: 29 additions & 0 deletions tests/robot-cases/Group1-Nightly/Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 764ab8e

Please sign in to comment.