def setUp(self): super(TestNexentaDriver, self).setUp() self.flags( nexenta_host='1.1.1.1', nexenta_volume='cinder', nexenta_target_prefix='iqn:', nexenta_target_group_prefix='cinder/', nexenta_blocksize='8K', nexenta_sparse=True, ) self.nms_mock = self.mox.CreateMockAnything() for mod in ['volume', 'zvol', 'iscsitarget', 'stmf', 'scsidisk', 'snapshot']: setattr(self.nms_mock, mod, self.mox.CreateMockAnything()) self.stubs.Set(jsonrpc, 'NexentaJSONProxy', lambda *_, **__: self.nms_mock) self.drv = volume.NexentaDriver() self.drv.do_setup({})
def setUp(self): super(TestNexentaDriver, self).setUp() self.configuration = mox_lib.MockObject(conf.Configuration) self.configuration.nexenta_host = '1.1.1.1' self.configuration.nexenta_user = '******' self.configuration.nexenta_password = '******' self.configuration.nexenta_volume = 'cinder' self.configuration.nexenta_rest_port = 2000 self.configuration.nexenta_rest_protocol = 'http' self.configuration.nexenta_iscsi_target_portal_port = 3260 self.configuration.nexenta_target_prefix = 'iqn:' self.configuration.nexenta_target_group_prefix = 'cinder/' self.configuration.nexenta_blocksize = '8K' self.configuration.nexenta_sparse = True self.nms_mock = self.mox.CreateMockAnything() for mod in ['volume', 'zvol', 'iscsitarget', 'appliance', 'stmf', 'scsidisk', 'snapshot']: setattr(self.nms_mock, mod, self.mox.CreateMockAnything()) self.stubs.Set(jsonrpc, 'NexentaJSONProxy', lambda *_, **__: self.nms_mock) self.drv = volume.NexentaDriver(configuration=self.configuration) self.drv.do_setup({})