Ejemplo n.º 1
0
 def setUp(self):
     self.helper = TestHelper(self)
     self.rcs = TestResources()
     self.identity = get_identity(self.helper.pool)
     return self.identity.authenticate_user(
         self.rcs,
         resources=get_resource_mapping(),
         region=region
     )
Ejemplo n.º 2
0
 def setUp(self):
     """
     Establish resources used for each test, such as the auth token
     and a load balancer.
     """
     self.helper = TestHelper(self, num_clbs=1)
     self.rcs = TestResources()
     self.identity = get_identity(pool=self.helper.pool)
     return self.identity.authenticate_user(self.rcs, resources=get_resource_mapping(), region=region).addCallback(
         lambda _: gatherResults(
             [
                 clb.start(self.rcs, self).addCallback(clb.wait_for_state, "ACTIVE", timeout_default)
                 for clb in self.helper.clbs
             ]
         )
     )
Ejemplo n.º 3
0
 def setUp(self):
     """
     Establish resources used for each test, such as the auth token
     and a load balancer.
     """
     self.helper = TestHelper(self, num_clbs=1)
     self.rcs = TestResources()
     self.identity = get_identity(pool=self.helper.pool)
     return self.identity.authenticate_user(
         self.rcs,
         resources=get_resource_mapping(),
         region=region,
     ).addCallback(lambda _: gatherResults([
         clb.start(self.rcs, self).addCallback(clb.wait_for_state, "ACTIVE",
                                               timeout_default)
         for clb in self.helper.clbs
     ]))
Ejemplo n.º 4
0
    def setUp(self):
        """
        Establish an HTTP connection pool and commonly used resources for each
        test. The HTTP connection pool is important for maintaining a clean
        Twisted reactor.
        """
        self.helper = TestHelper(self)
        self.rcs = TestResources()
        self.identity = get_identity(self.helper.pool)

        scaling_group_config = {
            'launchConfiguration': {
                'args': {
                    'stack': {
                        'template': {
                            'heat_template_version': '2015-04-30',
                            'resources': {
                                'rand': {
                                    'type': 'OS::Heat::RandomString'
                                }
                            }
                        }
                    }
                },
                'type': 'launch_stack'
            },
            'groupConfiguration': {
                'name': 'test_launch_stack',
                'cooldown': 0,
                'minEntities': 0,
                'maxEntities': 10
            },
            'scalingPolicies': [],
        }

        self.group = ScalingGroup(group_config=scaling_group_config,
                                  treq=self.helper.treq,
                                  pool=self.helper.pool)

        return self.identity.authenticate_user(
            self.rcs, resources=get_resource_mapping(), region=region)
Ejemplo n.º 5
0
    def setUp(self):
        """
        Establish an HTTP connection pool and commonly used resources for each
        test. The HTTP connection pool is important for maintaining a clean
        Twisted reactor.
        """
        self.helper = TestHelper(self)
        self.rcs = TestResources()
        self.identity = get_identity(self.helper.pool)

        scaling_group_config = {
            'launchConfiguration': {
                'args': {
                    'stack': {
                        'template': {
                            'heat_template_version': '2015-04-30',
                            'resources': {
                                'rand': {'type': 'OS::Heat::RandomString'}
                            }
                        }
                    }
                },
                'type': 'launch_stack'
            },
            'groupConfiguration': {
                'name': 'test_launch_stack',
                'cooldown': 0,
                'minEntities': 0,
                'maxEntities': 10
            },
            'scalingPolicies': [],
        }

        self.group = ScalingGroup(group_config=scaling_group_config,
                                  treq=self.helper.treq,
                                  pool=self.helper.pool)

        return self.identity.authenticate_user(
            self.rcs, resources=get_resource_mapping(), region=region)