Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CSAN
Csan
Commits
fc5743b3
Unverified
Commit
fc5743b3
authored
Sep 28, 2020
by
danfengliu
Committed by
GitHub
Sep 28, 2020
Browse files
Merge pull request #13128 from danfengliu/fix-a-typo-in-upgrade-prepare-script
Fix typo in upgrade prepare script
parents
b2a53a7e
e4894017
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
715 additions
and
621 deletions
+715
-621
tests/resources/Harbor-Pages/Verify.robot
tests/resources/Harbor-Pages/Verify.robot
+59
-26
tests/robot-cases/Group3-Upgrade/data.json
tests/robot-cases/Group3-Upgrade/data.json
+3
-3
tests/robot-cases/Group3-Upgrade/feature_map.json
tests/robot-cases/Group3-Upgrade/feature_map.json
+494
-456
tests/robot-cases/Group3-Upgrade/prepare.py
tests/robot-cases/Group3-Upgrade/prepare.py
+43
-30
tests/robot-cases/Group3-Upgrade/verify.robot
tests/robot-cases/Group3-Upgrade/verify.robot
+116
-106
No files found.
tests/resources/Harbor-Pages/Verify.robot
View file @
fc5743b3
...
...
@@ -24,50 +24,59 @@ Verify User
Close Browser
Verify Project
[
Arguments
]
${json}
${
check_content_trust}
=
${tru
e}
[
Arguments
]
${json}
${
verify_registry_name}
=
${fals
e}
Log To Console
"Verify Project..."
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
Retry Wait Until Page Contains
${project}
END
Verify Project Metadata
${json}
${check_content_trust}
Close Browser
Verify Image Tag
[
Arguments
]
${json}
Log To Console
"Verify Image Tag..."
Verify Project Metadata
# check_content_trust has been removed from Harbor since v2.0
# verify_registry_name is for proxy cache project, this feature developed since 2.1
[
Arguments
]
${json}
${check_content_trust}
=
${true}
${verify_registry_name}
=
${false}
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
@{out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
${has_image}
Set Variable If
${out_has_image}
[0] ==
${true}
${true}
${false}
Go Into Project
${project}
has_image=
${has_image}
@{repo}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)]..repo..name
Run Keyword If
${has_image}
=
=
${true}
Loop Image Repo
@{repo}
Switch To Project Configuration
Verify Checkbox
${json}
$.projects[?(@.name=
${project}
)].configuration.public
${project_config_public_checkbox}
Run Keyword If
'
${check_content_trust}
' == '
${true}
'
Verify Checkbox
${json}
$.projects[?(@.name=
${project}
)].configuration.enable_content_trust
${project_config_content_trust_checkbox}
Verify Checkbox
${json}
$.projects[?(@.name=
${project}
)].configuration.auto_scan
${project_config_scan_images_on_push_checkbox}
Verify Checkbox
${json}
$.projects[?(@.name=
${project}
)].configuration.prevent_vul
${project_config_prevent_vulnerable_images_from_running_checkbox}
${ret}
Get Selected List Value
${project_config_severity_select}
@{severity}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].configuration.severity
Should Contain
${ret}
@{severity}
[0]
Navigate To Projects
END
Close Browser
Verify Project Metadata
[
Arguments
]
${json}
${check_content_trust}
Verify Image Tag
[
Arguments
]
${json}
${verify_registry_name}
=
${false}
Log To Console
"Verify Image Tag..."
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
@{out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
${has_image}
Set Variable If
${out_has_image}
[0] ==
${true}
${true}
${false}
Go Into Project
${project}
has_image=
${has_image}
Switch To Project Configuration
Verify Checkbox
${json}
$.projects[?(@.name=
${project}
)].configuration.public
${project_config_public_checkbox}
Run Keyword If
'
${check_content_trust}
' == '
${true}
'
Verify Checkbox
${json}
$.projects[?(@.name=
${project}
)].configuration.enable_content_trust
${project_config_content_trust_checkbox}
Verify Checkbox
${json}
$.projects[?(@.name=
${project}
)].configuration.auto_scan
${project_config_scan_images_on_push_checkbox}
Verify Checkbox
${json}
$.projects[?(@.name=
${project}
)].configuration.prevent_vul
${project_config_prevent_vulnerable_images_from_running_checkbox}
${ret}
Get Selected List Value
${project_config_severity_select}
@{severity}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].configuration.severity
Should Contain
${ret}
@{severity}
[0]
@{repo}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)]..repo..name
Run Keyword If
${has_image}
=
=
${true}
Loop Image Repo
@{repo}
Navigate To Projects
END
Close Browser
...
...
@@ -87,12 +96,15 @@ Loop Image Repo
END
Verify Member Exist
[
Arguments
]
${json}
[
Arguments
]
${json}
${verify_registry_name}
=
${false}
Log To Console
"Verify Member Exist..."
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
@{out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
${has_image}
Set Variable If
${out_has_image}
[0] ==
${true}
${true}
${false}
Go Into Project
${project}
has_image=
${has_image}
...
...
@@ -104,12 +116,15 @@ Verify Member Exist
Close Browser
Verify Webhook
[
Arguments
]
${json}
[
Arguments
]
${json}
${verify_registry_name}
=
${false}
Log To Console
"Verify Webhook..."
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
@{out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
${has_image}
Set Variable If
${out_has_image}
[0] ==
${true}
${true}
${false}
Go Into Project
${project}
has_image=
${has_image}
...
...
@@ -131,12 +146,15 @@ Verify Webhook
Close Browser
Verify Webhook For 2.0
[
Arguments
]
${json}
[
Arguments
]
${json}
${verify_registry_name}
=
${false}
Log To Console
"Verify Webhook..."
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
@{out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
${has_image}
Set Variable If
${out_has_image}
[0] ==
${true}
${true}
${false}
Go Into Project
${project}
has_image=
${has_image}
...
...
@@ -162,12 +180,15 @@ Verify Webhook For 2.0
Close Browser
Verify Tag Retention Rule
[
Arguments
]
${json}
[
Arguments
]
${json}
${verify_registry_name}
=
${false}
Log To Console
"Verify Tag Retention Rule..."
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
${tag_retention_rule}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].tag_retention_rule
Run Keyword If
${tag_retention_rule}
[0] ==
${null}
Continue For Loop
${out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
...
...
@@ -189,12 +210,15 @@ Verify Tag Retention Rule
Close Browser
Verify Tag Immutability Rule
[
Arguments
]
${json}
[
Arguments
]
${json}
${verify_registry_name}
=
${false}
Log To Console
"Verify Tag Immutability Rule..."
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
@{out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
${has_image}
Set Variable If
${out_has_image}
[0] ==
${true}
${true}
${false}
Go Into Project
${project}
has_image=
${has_image}
...
...
@@ -219,12 +243,15 @@ Loop Member
END
Verify Robot Account Exist
[
Arguments
]
${json}
[
Arguments
]
${json}
${verify_registry_name}
=
${false}
Log To Console
"Verify Robot Account Exist..."
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
@{out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
${has_image}
Set Variable If
${out_has_image}
[0] ==
${true}
${true}
${false}
Go Into Project
${project}
has_image=
${has_image}
...
...
@@ -267,12 +294,15 @@ Verify System Label
Close Browser
Verify Project Label
[
Arguments
]
${json}
[
Arguments
]
${json}
${verify_registry_name}
=
${false}
Log To Console
"Verify Project Label..."
@{project}
= Get Value From Json
${json}
$.p
e
oject.[*].name
@{project}
=
Get Value From Json
${json}
$.p
r
oject
s
.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
@{out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
${has_image}
Set Variable If
${out_has_image}
[0] ==
${true}
${true}
${false}
Go Into Project
${project}
has_image=
${has_image}
...
...
@@ -381,12 +411,15 @@ Verify System Setting
Close Browser
Verify Project-level Allowlist
[
Arguments
]
${json}
[
Arguments
]
${json}
${verify_registry_name}
=
${false}
Log To Console
"Verify Project-level Allowlist..."
@{project}
=
Get Value From Json
${json}
$.projects.[*].name
Init Chrome Driver
Sign In Harbor
${HARBOR_URL}
${HARBOR_ADMIN}
${HARBOR_PASSWORD}
FOR
${project}
IN
@{project}
@{registry_name}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].registry_name
Run Keyword If
'
${registry_name}
[0]' != '
${null}
' and '
${verify_registry_name}
' == '
${false}
'
Continue For Loop
@{out_has_image}
=
Get Value From Json
${json}
$.projects[?(@.name=
${project}
)].has_image
${has_image}
Set Variable If
${out_has_image}
[0] ==
${true}
${true}
${false}
Go Into Project
${project}
has_image=
${has_image}
...
...
tests/robot-cases/Group3-Upgrade/data.json
View file @
fc5743b3
...
...
@@ -514,13 +514,13 @@
"auth_header"
:
"bbb"
,
"enabled"
:
true
,
"notify_type"
:
"slack"
,
"name"
:
"webhook
28
"
"name"
:
"webhook
3.3
"
},
"configuration"
:{
"public"
:
"true"
,
"enable_content_trust"
:
"
tru
e"
,
"enable_content_trust"
:
"
fals
e"
,
"auto_scan"
:
"true"
,
"prevent_vul"
:
"
tru
e"
,
"prevent_vul"
:
"
fals
e"
,
"severity"
:
"high"
,
"reuse_sys_cve_allowlist"
:
"false"
,
"deployment_security"
:{
...
...
tests/robot-cases/Group3-Upgrade/feature_map.json
View file @
fc5743b3
{
"create_project"
:[
{
"branch"
:
1
,
"version"
:
"1.4"
},
{
"branch"
:
1
,
"version"
:
"1.6"
},
{
"branch"
:
1
,
"version"
:
"1.7"
},
{
"branch"
:
1
,
"version"
:
"1.8"
},
{
"branch"
:
2
,
"version"
:
"1.9"
},
{
"branch"
:
2
,
"version"
:
"1.10"
},
{
"branch"
:
2
,
"version"
:
"2.0"
},
{
"branch"
:
3
,
"version"
:
"2.1"
},
{
"branch"
:
3
,
"version"
:
"2.2"
}
],
"add_member"
:[
{
"branch"
:
1
,
"version"
:
"1.4"
},
{
"branch"
:
2
,
"version"
:
"1.6"
},
{
"branch"
:
2
,
"version"
:
"1.7"
},
{
"branch"
:
2
,
"version"
:
"1.8"
},
{
"branch"
:
2
,
"version"
:
"1.9"
},
{
"branch"
:
2
,
"version"
:
"1.10"
},
{
"branch"
:
2
,
"version"
:
"2.0"
},
{
"branch"
:
2
,
"version"
:
"2.1"
},
{
"branch"
:
2
,
"version"
:
"2.2"
}
],
"set_user_admin"
:[
{
"branch"
:
1
,
"version"
:
"1.4"
},
{
"branch"
:
2
,
"version"
:
"1.6"
},
{
"branch"
:
2
,
"version"
:
"1.7"
},
{
"branch"
:
2
,
"version"
:
"1.8"
},
{
"branch"
:
2
,
"version"
:
"1.9"
},
{
"branch"
:
2
,
"version"
:
"1.10"
},
{
"branch"
:
3
,
"version"
:
"2.0"
},
{
"branch"
:
3
,
"version"
:
"2.1"
},
{
"branch"
:
3
,
"version"
:
"2.2"
}
],
"add_endpoint"
:[
{
"branch"
:
1
,
"version"
:
"1.4"
},
{
"branch"
:
1
,
"version"
:
"1.6"
},
{
"branch"
:
1
,
"version"
:
"1.7"
},
{
"branch"
:
2
,
"version"
:
"1.8"
},
{
"branch"
:
2
,
"version"
:
"1.9"
},
{
"branch"
:
2
,
"version"
:
"1.10"
},
{
"branch"
:
2
,
"version"
:
"2.0"
},
{
"branch"
:
2
,
"version"
:
"2.1"
},
{
"branch"
:
2
,
"version"
:
"2.2"
}
],
"add_replication_rule"
:[
{
"branch"
:
1
,
"version"
:
"1.4"
},
{
"branch"
:
1
,
"version"
:
"1.6"
},
{
"branch"
:
1
,
"version"
:
"1.7"
},
{
"branch"
:
2
,
"version"
:
"1.8"
},
{
"branch"
:
2
,
"version"
:
"1.9"
},
{
"branch"
:
2
,
"version"
:
"1.10"
},
{
"branch"
:
2
,
"version"
:
"2.0"
},
{
"branch"
:
2
,
"version"
:
"2.1"
},
{
"branch"
:
2
,
"version"
:
"2.2"
}
],
"add_sys_allowlist"
:[
{
"branch"
:
1
,
"version"
:
"1.9"
},
{
"branch"
:
1
,
"version"
:
"1.10"
},
{
"branch"
:
1
,
"version"
:
"2.0"
},
{
"branch"
:
2
,
"version"
:
"2.1"
},
{
"branch"
:
2
,
"version"
:
"2.2"
}
],
"update_project_setting_allowlist"
:[
{
"branch"
:
1
,
"version"
:
"1.9"
},
{
"branch"
:
1
,
"version"
:
"1.10"
},
{
"branch"
:
1
,
"version"
:
"2.0"
},
{
"branch"
:
2
,
"version"
:
"2.1"
},
{
"branch"
:
2
,
"version"
:
"2.2"
}
],
"add_project_robot_account"
:[
{
"branch"
:
1
,
"version"
:
"1.8"
},
{
"branch"
:
1
,
"version"
:
"1.9"
},
{
"branch"
:
1
,
"version"
:
"1.10"
},
{
"branch"
:
1
,
"version"
:
"2.0"
},
{
"branch"
:
1
,
"version"
:
"2.1"
},
{
"branch"
:
1
,
"version"
:
"2.2"
}
],
"add_tag_retention_rule"
:[
{
"branch"
:
1
,
"version"
:
"1.9"
},
{
"branch"
:
1
,
"version"
:
"1.10"
},
{
"branch"
:
1
,
"version"
:
"2.0"
},
{
"branch"
:
1
,
"version"
:
"2.1"
},
{
"branch"
:
1
,
"version"
:
"2.2"
}
],
"add_tag_immutability_rule"
:[
{
"branch"
:
1
,
"version"
:
"1.10"
},
{
"branch"
:
1
,
"version"
:
"2.0"
},
{
"branch"
:
1
,
"version"
:
"2.1"
},
{
"branch"
:
1
,
"version"
:
"2.2"
}
],
"add_webhook"
:[
{
"branch"
:
1
,
"version"
:
"1.9"
},
{
"branch"
:
1
,
"version"
:
"1.10"
},
{
"branch"
:
2
,
"version"
:
"2.0"
},
{
"branch"
:
2
,
"version"
:
"2.1"
},
{
"branch"
:
2
,
"version"
:
"2.2"
}
],
"update_interrogation_services"
:[
{
"branch"
:
1
,
"version"
:
"1.9"
},
{
"branch"
:
1
,
"version"
:
"1.10"
},
{
"branch"
:
1
,
"version"
:
"2.0"
},
{
"branch"
:
1
,
"version"
:
"2.1"
},
{
"branch"
:
1
,
"version"
:
"2.2"
}
],
"push_artifact_index"
:[
{
"branch"
:
1
,
"version"
:
"2.0"
},
{
"branch"
:
1
,
"version"
:
"2.1"
},
{
"branch"
:
1
,
"version"
:
"2.2"
}
],
"add_distribution"
:[
{
"branch"
:
1
,
"version"
:
"2.1"
},
{
"branch"
:
1
,
"version"
:
"2.2"
}
],