예제 #1
0
 def setUp(self):
     super(VolumeTypeAccessTest, self).setUp()
     self.type_controller_v2 = types_api_v2.VolumeTypesController()
     self.type_access_controller = type_access.VolumeTypeAccessController()
     self.type_action_controller = type_access.VolumeTypeActionController()
     self.req = FakeRequest()
     self.context = self.req.environ['cinder.context']
     self.stubs.Set(db, 'volume_type_get', fake_volume_type_get)
     self.stubs.Set(db, 'volume_type_get_all', fake_volume_type_get_all)
예제 #2
0
 def setUp(self,
           enforce_scope=False,
           enforce_new_defaults=False,
           *args,
           **kwargs):
     super().setUp(enforce_scope, enforce_new_defaults, *args, **kwargs)
     self.controller = vta.VolumeTypeAccessController()
     self.volume_type = objects.VolumeType(
         self.project_admin_context,
         name='private_volume_type',
         is_public=False,
         description='volume type for srbac testing',
         extra_specs=None,
         projects=[self.project_id, self.project_id_other])
     self.volume_type.create()
     self.addCleanup(self.volume_type.destroy)
     self.api_version = mv.BASE_VERSION
     self.api_path = (f'/v3/{self.project_id}/types/'
                      f'{self.volume_type.id}/os-volume-type-access')