diff --git a/api/v2.0/legacy_swagger.yaml b/api/v2.0/legacy_swagger.yaml index fc33c8c53..f7d0e0442 100644 --- a/api/v2.0/legacy_swagger.yaml +++ b/api/v2.0/legacy_swagger.yaml @@ -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: diff --git a/tests/apitests/python/library/system.py b/tests/apitests/python/library/system.py index c67ad5434..e86f896d6 100644 --- a/tests/apitests/python/library/system.py +++ b/tests/apitests/python/library/system.py @@ -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(): diff --git a/tests/robot-cases/Group0-BAT/API_DB.robot b/tests/robot-cases/Group0-BAT/API_DB.robot index 587814798..e4166e908 100644 --- a/tests/robot-cases/Group0-BAT/API_DB.robot +++ b/tests/robot-cases/Group0-BAT/API_DB.robot @@ -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