From 1169b0513fce86a36e290ef102ff09b3bf7e5ff5 Mon Sep 17 00:00:00 2001 From: stonezdj Date: Thu, 31 Oct 2024 12:44:19 +0800 Subject: [PATCH] Update robot account e2e testcase for export-cve change update job service schedule testcase switch dockerhub to registry.goharbor.io Signed-off-by: stonezdj --- tests/apitests/python/test_system_permission.py | 8 ++++---- tests/resources/Harbor-Pages/Project_Robot_Account.robot | 4 ++-- tests/resources/TestCaseBody.robot | 4 ++-- tests/robot-cases/Group1-Nightly/Common.robot | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/apitests/python/test_system_permission.py b/tests/apitests/python/test_system_permission.py index 6db69686baa..4e5cb667bf4 100644 --- a/tests/apitests/python/test_system_permission.py +++ b/tests/apitests/python/test_system_permission.py @@ -81,8 +81,8 @@ def call(self): registry_payload = { "insecure": False, "name": "registry-{}".format(random.randint(1000, 9999)), - "type": "docker-hub", - "url": "https://hub.docker.com" + "type": "harbor", + "url": "https://registry.goharbor.io" } create_registry = Permission("{}/registries".format(harbor_base_url), "POST", 201, registry_payload, "id", id_from_header=True) list_registry = Permission("{}/registries".format(harbor_base_url), "GET", 200, registry_payload) @@ -93,8 +93,8 @@ def call(self): registry_ping_payload = { "insecure": False, "name": "registry-{}".format(random.randint(1000, 9999)), - "type": "docker-hub", - "url": "https://hub.docker.com" + "type": "harbor", + "url": "https://registry.goharbor.io" } ping_registry = Permission("{}/registries/ping".format(harbor_base_url), "POST", 200, registry_ping_payload) # registry permissions end diff --git a/tests/resources/Harbor-Pages/Project_Robot_Account.robot b/tests/resources/Harbor-Pages/Project_Robot_Account.robot index fdde3e707ef..2a463322f98 100644 --- a/tests/resources/Harbor-Pages/Project_Robot_Account.robot +++ b/tests/resources/Harbor-Pages/Project_Robot_Account.robot @@ -24,8 +24,8 @@ Create A Project Robot Account ${permission_count}= Create Dictionary ${total}= Set Variable 0 IF '${first_resource}' == 'all' - Set To Dictionary ${permission_count} all= 68 - ${total}= Set Variable 68 + Set To Dictionary ${permission_count} all= 70 + ${total}= Set Variable 70 Retry Element Click //span[text()='Select all'] ELSE FOR ${item} IN @{resources} diff --git a/tests/resources/TestCaseBody.robot b/tests/resources/TestCaseBody.robot index 7bef207c295..5fd078527ea 100644 --- a/tests/resources/TestCaseBody.robot +++ b/tests/resources/TestCaseBody.robot @@ -676,9 +676,9 @@ Create Schedules For Job Service Dashboard Schedules Create An New P2P Preheat Policy ${p2p_policy_name} ${distribution_name} ** ** Scheduled ${schedule_type} ${schedule_cron} # Create a replication policy triggered by schedule Switch to Registries - Create A New Endpoint docker-hub docker-hub${d} ${null} ${null} ${null} Y + Create A New Endpoint harbor goharbor${d} ${null} ${null} ${null} Y Switch To Replication Manage - Create A Rule With Existing Endpoint ${replication_policy_name} pull goharbor/harbor-core image docker-hub${d} ${project_name} filter_tag=dev mode=Scheduled cron=${schedule_cron} + Create A Rule With Existing Endpoint ${replication_policy_name} pull harbor-ci/goharbor/harbor-core image goharbor${d} ${project_name} filter_tag=dev mode=Scheduled cron=${schedule_cron} # Set up a schedule to scan all Switch To Vulnerability Page Set Scan Schedule Custom value=${schedule_cron} diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index 2509e10c122..c6d82d61fd4 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -723,7 +723,7 @@ Test Case - System Robot Account Cover All Projects Pull image ${ip} '${robot_account_name}' ${token} project${d} hello-world:latest Retry Action Keyword Check System Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} all Retry Action Keyword Check Project Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} ${project_id} ${project_name} hello-world latest all - Retry Wait Element Visible //clr-dg-row[.//clr-dg-cell[contains(.,'${robot_account_name}')] and .//clr-icon[contains(@class, 'color-green')] and .//button[text()=' 72 PERMISSION(S) '] and .//span[contains(.,'Never Expires')] and .//clr-dg-cell[text()='For testing'] ] + Retry Wait Element Visible //clr-dg-row[.//clr-dg-cell[contains(.,'${robot_account_name}')] and .//clr-icon[contains(@class, 'color-green')] and .//button[text()=' 70 PERMISSION(S) '] and .//span[contains(.,'Never Expires')] and .//clr-dg-cell[text()='For testing'] ] System Robot Account Exist ${robot_account_name} all Close Browser @@ -739,13 +739,13 @@ Test Case - System Robot Account ${project_id}= Set Variable ${words}[-2] Switch To Robot Account ${robot_account_name} ${token}= Create A System Robot Account sys1${d} days days=100 description=For testing cover_all_system_resources=${true} - Retry Wait Element Visible //clr-dg-row[.//clr-dg-cell[contains(.,'${robot_account_name}')] and .//clr-icon[contains(@class, 'color-green')] and .//button[text()=' 72 PERMISSION(S) '] and .//span[contains(.,'99d 23h')] and .//clr-dg-cell[text()='For testing'] and .//clr-dg-cell//span[text()=' None ']] + Retry Wait Element Visible //clr-dg-row[.//clr-dg-cell[contains(.,'${robot_account_name}')] and .//clr-icon[contains(@class, 'color-green')] and .//button[text()=' 70 PERMISSION(S) '] and .//span[contains(.,'99d 23h')] and .//clr-dg-cell[text()='For testing'] and .//clr-dg-cell//span[text()=' None ']] Retry Action Keyword Check System Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} all Retry Action Keyword Check Project Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} ${project_id} ${project_name} hello-world latest all 1 ${robot_account_name} ${token}= Create A System Robot Account sys2${d} days days=2 description=For testing cover_all_project_resources=${true} Push image ${ip} '${robot_account_name}' ${token} project${d} hello-world:latest - Retry Wait Element Visible //clr-dg-row[.//clr-dg-cell[contains(.,'${robot_account_name}')] and .//clr-icon[contains(@class, 'color-green')] and .//span[text()='All projects with'] and .//button[text()=' 68 PERMISSION(S) '] and .//span[contains(.,'1d 23h')] and .//clr-dg-cell[text()='For testing'] and .//clr-dg-cell//span[text()=' None ']] + Retry Wait Element Visible //clr-dg-row[.//clr-dg-cell[contains(.,'${robot_account_name}')] and .//clr-icon[contains(@class, 'color-green')] and .//span[text()='All projects with'] and .//button[text()=' 70 PERMISSION(S) '] and .//span[contains(.,'1d 23h')] and .//clr-dg-cell[text()='For testing'] and .//clr-dg-cell//span[text()=' None ']] Retry Action Keyword Check System Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} all 1 Retry Action Keyword Check Project Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} ${project_id} ${project_name} hello-world latest all Close Browser