enable garbage colloection api test case (#11000)

Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
Wang Yan 2020-03-11 11:19:29 +08:00 committed by GitHub
parent 950eddad1e
commit f49994d81d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 9 deletions

View File

@ -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:

View File

@ -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():

View File

@ -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