Exemplo n.º 1
0
    def cleanup(self):
        # cleanup the test stack first since it could be referencing resources
        # in a support stack, and it was the last stack created.
        if self.stack_id is not None and cfg.CONF.cleanup_on_error:
            LOG.debug('Cleaning up the test stack: %s with id: %s',
                      self.stack_name, self.stack_id)
            heat.wait_stack_deletion(self.openstack_client.heat, self.stack_id)

        # cleanup support stacks; reverse the order to prevent deletion errors
        # due to possible dependencies between the support stacks.
        # Only stacks tracked during the run are deleted. e.g. if a support
        # stack already existed, the current run doesn't "own" it so it
        # won't be cleaned up.
        if len(self.support_stacks) > 0 and cfg.CONF.cleanup_on_error:
            for stack in reversed(self.support_stacks):
                LOG.debug('Cleaning up the support stack: %s with id: %s',
                          stack.name, stack.id)
                heat.wait_stack_deletion(self.openstack_client.heat, stack.id)
Exemplo n.º 2
0
    def test_wait_stack_deletion_timeout(self, openstack_mock,
                                         get_status_mock):
        get_status_mock.side_effect = TimeoutError
        stack_id = uuid.uuid4()

        self.assertIsNone(heat.wait_stack_deletion(openstack_mock, stack_id))
Exemplo n.º 3
0
    def test_wait_stack_deletion(self, openstack_mock, get_status_mock):
        get_status_mock.side_effect = heat.exc.HTTPNotFound
        stack_id = uuid.uuid4()

        self.assertIsNone(heat.wait_stack_deletion(openstack_mock, stack_id))