예제 #1
0
 def setUp(self):
     """Establish a clean test environment"""
     super(TestStore, self).setUp()
     self.stubs.Set(rbd_store, 'rados', mock_rados)
     self.stubs.Set(rbd_store, 'rbd', mock_rbd)
     self.store = rbd_store.Store()
     self.store.chunk_size = 2
     self.called_commands_actual = []
     self.called_commands_expected = []
     self.store_specs = {'image': 'fake_image', 'snapshot': 'fake_snapshot'}
     self.location = StoreLocation(self.store_specs)
예제 #2
0
 def setUp(self):
     """Establish a clean test environment"""
     super(TestStore, self).setUp()
     self.stubs.Set(rbd_store, 'rados', mock_rados)
     self.stubs.Set(rbd_store, 'rbd', mock_rbd)
     self.store = rbd_store.Store()
     self.store.chunk_size = 2
     self.called_commands_actual = []
     self.called_commands_expected = []
     self.store_specs = {'image': 'fake_image', 'snapshot': 'fake_snapshot'}
     self.location = StoreLocation(self.store_specs)
     # Provide enough data to get more than one chunk iteration.
     self.data_len = 3 * units.Ki
     self.data_iter = six.StringIO('*' * self.data_len)
예제 #3
0
 def _fake_create_image(*args, **kwargs):
     called_commands.append('create')
     return StoreLocation({'image': 'fake_image',
                           'snapshot': 'fake_snapshot'})