def export_domain(self): """This runs the entire export domain sequence: 1. POST /zones/ID/tasks/export 2. GET /zones/tasks/exports/ID (poll for COMPLETED) 3. GET /zones/tasks/export (Accept: text/dns) """ gevent.spawn( GreenletManager.get().tracked_greenlet, lambda: self._do_export_domain(), )
def create_record(self): """POST /zones/ID/recordsets""" gevent.spawn( GreenletManager.get().tracked_greenlet, lambda: self._do_create_record(), )
def remove_record(self): """DELETE /zones/ID/recordsets/ID""" gevent.spawn( GreenletManager.get().tracked_greenlet, lambda: self._do_remove_record(), )
def modify_record(self): gevent.spawn( GreenletManager.get().tracked_greenlet, lambda: self._do_modify_record(), )
def modify_domain(self): """PATCH /zones/ID""" gevent.spawn( GreenletManager.get().tracked_greenlet, lambda: self._do_modify_domain(), )
def import_zone(self): """POST /zones/tasks/import, Content-type: text/dns""" gevent.spawn( GreenletManager.get().tracked_greenlet, lambda: self._do_import_zone(), )
def create_domain(self): """POST /zones""" gevent.spawn( GreenletManager.get().tracked_greenlet, lambda: self._do_create_domain(), )
def remove_domain(self): """DELETE /zones/ID""" gevent.spawn( GreenletManager.get().tracked_greenlet, lambda: self._do_remove_domain(), )
if not insight.is_master(): # TODO: the tenant id is actually the username. it should be named so. SMALL_TENANTS = [Tenant(id=id, api_key=api_key, type=Tenant.SMALL) for id, api_key in CONFIG.small_tenants] LARGE_TENANTS = [Tenant(id=id, api_key=api_key, type=Tenant.LARGE) for id, api_key in CONFIG.large_tenants] ALL_TENANTS = SMALL_TENANTS + LARGE_TENANTS # the greenlet_manager keeps track of greenlets spawned for polling # todo: it's hard to ensure cleanup_greenlets gets run before the stats # are persisted to a file... # ensure cleanup when the test is stopped locust.events.locust_stop_hatching += \ lambda: GreenletManager.get().cleanup_greenlets() # ensure cleanup on interrupts locust.events.quitting += \ lambda: GreenletManager.get().cleanup_greenlets() class LargeTasks(ZoneTasks, RecordsetTasks): tasks = { ZoneTasks.get_domain_by_id: CONFIG.large_weights.get_domain_by_id, ZoneTasks.get_domain_by_name: CONFIG.large_weights.get_domain_by_name, ZoneTasks.list_domains: CONFIG.large_weights.list_domain, ZoneTasks.import_zone: CONFIG.large_weights.import_zone, ZoneTasks.export_domain: CONFIG.large_weights.export_domain, ZoneTasks.create_domain: CONFIG.large_weights.create_domain, ZoneTasks.modify_domain: CONFIG.large_weights.modify_domain, ZoneTasks.remove_domain: CONFIG.large_weights.remove_domain,
Tenant(id=id, api_key=api_key, type=Tenant.SMALL) for id, api_key in CONFIG.small_tenants ] LARGE_TENANTS = [ Tenant(id=id, api_key=api_key, type=Tenant.LARGE) for id, api_key in CONFIG.large_tenants ] ALL_TENANTS = SMALL_TENANTS + LARGE_TENANTS # the greenlet_manager keeps track of greenlets spawned for polling # todo: it's hard to ensure cleanup_greenlets gets run before the stats # are persisted to a file... # ensure cleanup when the test is stopped locust.events.locust_stop_hatching += \ lambda: GreenletManager.get().cleanup_greenlets() # ensure cleanup on interrupts locust.events.quitting += \ lambda: GreenletManager.get().cleanup_greenlets() class LargeTasks(ZoneTasks, RecordsetTasks): tasks = { ZoneTasks.get_domain_by_id: CONFIG.large_weights.get_domain_by_id, ZoneTasks.get_domain_by_name: CONFIG.large_weights.get_domain_by_name, ZoneTasks.list_domains: CONFIG.large_weights.list_domain, ZoneTasks.import_zone: CONFIG.large_weights.import_zone, ZoneTasks.export_domain: CONFIG.large_weights.export_domain, ZoneTasks.create_domain: CONFIG.large_weights.create_domain, ZoneTasks.modify_domain: CONFIG.large_weights.modify_domain,