mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-03 14:37:44 +01:00
enable garbage colloection api test case (#11000)
Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
950eddad1e
commit
f49994d81d
@ -5699,8 +5699,10 @@ definitions:
|
||||
schedule:
|
||||
$ref: '#/definitions/AdminJobScheduleObj'
|
||||
parameters:
|
||||
type: string
|
||||
type: object
|
||||
description: The parameters of admin job
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
AdminJobScheduleObj:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -92,14 +92,20 @@ class System(base.Base):
|
||||
|
||||
def create_gc_schedule(self, schedule_type, cron = None, expect_status_code = 201, expect_response_body = None, **kwargs):
|
||||
client = self._get_client(**kwargs)
|
||||
gcscheduleschedule = swagger_client.AdminJobScheduleObj()
|
||||
gcscheduleschedule.type = schedule_type
|
||||
if cron is not None:
|
||||
gcscheduleschedule.cron = cron
|
||||
|
||||
gc_schedule = swagger_client.AdminJobSchedule(gcscheduleschedule)
|
||||
gc_parameters = {'delete_untagged':True}
|
||||
|
||||
gc_schedule = swagger_client.AdminJobScheduleObj()
|
||||
gc_schedule.type = schedule_type
|
||||
if cron is not None:
|
||||
gc_schedule.cron = cron
|
||||
|
||||
gc_job = swagger_client.AdminJobSchedule()
|
||||
gc_job.schedule = gc_schedule
|
||||
gc_job.parameters = gc_parameters
|
||||
|
||||
try:
|
||||
_, status_code, header = client.system_gc_schedule_post_with_http_info(gc_schedule)
|
||||
_, status_code, header = client.system_gc_schedule_post_with_http_info(gc_job)
|
||||
except ApiException as e:
|
||||
if e.status == expect_status_code:
|
||||
if expect_response_body is not None and e.body.strip() != expect_response_body.strip():
|
||||
|
@ -20,8 +20,8 @@ ${SERVER_API_ENDPOINT} ${SERVER_URL}/api
|
||||
|
||||
*** Test Cases ***
|
||||
# TODO uncomment this after re-implement the case
|
||||
# Test Case - Garbage Collection
|
||||
# Harbor API Test ./tests/apitests/python/test_garbage_collection.py
|
||||
Test Case - Garbage Collection
|
||||
Harbor API Test ./tests/apitests/python/test_garbage_collection.py
|
||||
Test Case - Add Private Project Member and Check User Can See It
|
||||
Harbor API Test ./tests/apitests/python/test_add_member_to_private_project.py
|
||||
Test Case - Delete a Repository of a Certain Project Created by Normal User
|
||||
|
Loading…
Reference in New Issue
Block a user