def setUp(self): super(GroupsAPITestCase, self).setUp() self.controller = v3_groups.GroupsController() self.group_api = cinder.group.API() self.ctxt = context.RequestContext(fake.USER_ID, fake.PROJECT_ID, auth_token=True, is_admin=True) self.user_ctxt = context.RequestContext( fake.USER_ID, fake.PROJECT_ID, auth_token=True) self.volume_type1 = self._create_volume_type(id=fake.VOLUME_TYPE_ID) self.group1 = self._create_group() self.group2 = self._create_group() self.group3 = self._create_group(ctxt=self.user_ctxt) self.addCleanup(self._cleanup)
def setUp(self, enforce_scope=False, enforce_new_defaults=False, *args, **kwargs): super().setUp(enforce_scope, enforce_new_defaults, *args, **kwargs) self.controller = groups.GroupsController() self.api_path = '/v3/%s/groups' % (self.project_id) self.api_version = mv.GROUP_REPLICATION self.group_type = group_types.create(self.project_admin_context, 'group_type_name', {'key3': 'value3'}, is_public=True) # not surprisingly, to do a group action you need to get a # group, so relax the group:get policy so that these tests # will check the group action policy we're interested in self.policy.set_rules({"group:get": ""}, overwrite=False)