diff --git a/cinder/tests/fake_driver.py b/cinder/tests/fake_driver.py index 1d0e96e7cad..35bda120c1a 100644 --- a/cinder/tests/fake_driver.py +++ b/cinder/tests/fake_driver.py @@ -18,12 +18,12 @@ from cinder import exception from cinder import objects from cinder.objects import fields from cinder.tests.unit.brick import fake_lvm +from cinder import utils from cinder.volume import driver from cinder.volume.drivers import lvm from cinder.zonemanager import utils as fczm_utils -# TODO(e0ne): add logging to FakeLoggingVolumeDriver and remove this one. # TODO(e0ne): inherit from driver.VolumeDriver and fix unit-tests class FakeLoggingVolumeDriver(lvm.LVMVolumeDriver): """Logs calls instead of executing.""" @@ -37,46 +37,60 @@ class FakeLoggingVolumeDriver(lvm.LVMVolumeDriver): None, 'default', self.fake_execute) + @utils.trace_method def check_for_setup_error(self): """No setup necessary in fake mode.""" pass + @utils.trace_method def create_volume(self, volume): pass + @utils.trace_method def delete_volume(self, volume): pass + @utils.trace_method def create_snapshot(self, snapshot): pass + @utils.trace_method def delete_snapshot(self, snapshot): pass + @utils.trace_method def ensure_export(self, context, volume): pass + @utils.trace_method def create_export(self, context, volume, connector): pass + @utils.trace_method def remove_export(self, context, volume): pass + @utils.trace_method def create_export_snapshot(self, context, snapshot): pass + @utils.trace_method def remove_export_snapshot(self, context, snapshot): pass + @utils.trace_method def terminate_connection_snapshot(self, snapshot, connector): pass + @utils.trace_method def create_cloned_volume(self, volume, src_vol): pass + @utils.trace_method def create_volume_from_snapshot(self, volume, snapshot): pass + @utils.trace_method def initialize_connection(self, volume, connector): # NOTE(thangp): There are several places in the core cinder code where # the volume passed through is a dict and not an oslo_versionedobject. @@ -98,11 +112,13 @@ class FakeLoggingVolumeDriver(lvm.LVMVolumeDriver): return {'driver_volume_type': 'iscsi', 'data': {'access_mode': access_mode}} + @utils.trace_method def initialize_connection_snapshot(self, snapshot, connector): return { 'driver_volume_type': 'iscsi', } + @utils.trace_method def terminate_connection(self, volume, connector, **kwargs): pass