Beispiel #1
0
    def test_purge_flow_normal(self, mock_creds, mock_dns_client):
        service_id = str(uuid.uuid4())
        domains_old = domain.Domain(domain='cdn.poppy.org')
        current_origin = origin.Origin(origin='poppy.org')
        service_obj = service.Service(service_id=service_id,
                                      name='poppy cdn service',
                                      domains=[domains_old],
                                      origins=[current_origin],
                                      flavor_id='cdn')

        kwargs = {
            'project_id': json.dumps(str(uuid.uuid4())),
            'service_id': json.dumps(service_id),
            'provider_details': json.dumps(
                dict([(k, v.to_dict())
                      for k, v in service_obj.provider_details.items()])),
            'purge_url': 'cdn.poppy.org',
            'hard': json.dumps(True),
            'service_obj': json.dumps(service_obj.to_dict()),
            'context_dict': context_utils.RequestContext().to_dict()
        }

        service_controller, storage_controller, dns_controller = \
            self.all_controllers()

        with MonkeyPatchControllers(service_controller,
                                    dns_controller,
                                    storage_controller,
                                    memoized_controllers.task_controllers):

            self.patch_purge_flow(service_controller, storage_controller,
                                  dns_controller)
            engines.run(purge_service.purge_service(), store=kwargs)
Beispiel #2
0
    def test_purge_flow_normal(self, mock_creds):
        service_id = str(uuid.uuid4())
        domains_old = domain.Domain(domain="cdn.poppy.org")
        current_origin = origin.Origin(origin="poppy.org")
        service_obj = service.Service(
            service_id=service_id,
            name="poppy cdn service",
            domains=[domains_old],
            origins=[current_origin],
            flavor_id="cdn",
        )

        kwargs = {
            "project_id": json.dumps(str(uuid.uuid4())),
            "service_id": json.dumps(service_id),
            "provider_details": json.dumps(dict([(k, v.to_dict()) for k, v in service_obj.provider_details.items()])),
            "purge_url": "cdn.poppy.org",
            "hard": json.dumps(True),
            "service_obj": json.dumps(service_obj.to_dict()),
        }

        service_controller, storage_controller, dns_controller = self.all_controllers()

        with MonkeyPatchControllers(
            service_controller, dns_controller, storage_controller, memoized_controllers.task_controllers
        ):

            self.patch_purge_flow(service_controller, storage_controller, dns_controller)
            engines.run(purge_service.purge_service(), store=kwargs)
Beispiel #3
0
    def test_purge_flow_normal(self):
        service_id = str(uuid.uuid4())
        domains_old = domain.Domain(domain='cdn.poppy.org')
        current_origin = origin.Origin(origin='poppy.org')
        service_obj = service.Service(service_id=service_id,
                                      name='poppy cdn service',
                                      domains=[domains_old],
                                      origins=[current_origin],
                                      flavor_id='cdn')

        kwargs = {
            'project_id':
            json.dumps(str(uuid.uuid4())),
            'service_id':
            json.dumps(service_id),
            'provider_details':
            json.dumps(
                dict([(k, v.to_dict())
                      for k, v in service_obj.provider_details.items()])),
            'purge_url':
            'cdn.poppy.org',
            'hard':
            json.dumps(True),
            'service_obj':
            json.dumps(service_obj.to_dict()),
            'context_dict':
            context_utils.RequestContext().to_dict()
        }

        (service_controller, storage_controller, dns_controller,
         ssl_cert_controller) = self.all_controllers()

        with MonkeyPatchControllers(service_controller, dns_controller,
                                    storage_controller, ssl_cert_controller,
                                    memoized_controllers.task_controllers):

            self.patch_purge_flow(service_controller, storage_controller,
                                  dns_controller)
            engines.run(purge_service.purge_service(), store=kwargs)