self.called = []
def _cleanup(self):
+ fake_notifier.reset()
try:
shutil.rmtree(CONF.volumes_dir)
except OSError:
pass
- fake_notifier.reset()
def fake_get_target(obj, iqn):
return 1
volume_id = volume['id']
self.assertIsNone(volume['encryption_key_id'])
- self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(0, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
self.assertRaises(exception.DriverNotInitialized,
self.volume.create_volume,
self.context, volume_id)
volume_id = volume['id']
self.assertIsNone(volume['encryption_key_id'])
- self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(0, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
self.assertRaises(exception.DriverNotInitialized,
self.volume.delete_volume,
self.context, volume_id)
**self.volume_params)
volume_id = volume['id']
self.assertIsNone(volume['encryption_key_id'])
- self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(0, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
self.volume.create_volume(self.context, volume_id)
- self.assertEqual(2, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(2, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
msg = fake_notifier.NOTIFICATIONS[0]
self.assertEqual('volume.create.start', msg['event_type'])
expected = {
vol = db.volume_get(context.get_admin_context(read_deleted='yes'),
volume_id)
self.assertEqual('deleted', vol['status'])
- self.assertEqual(4, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(4, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
msg = fake_notifier.NOTIFICATIONS[2]
self.assertEqual('volume.delete.start', msg['event_type'])
self.assertDictMatch(expected, msg['payload'])
self.context,
availability_zone=CONF.storage_availability_zone,
**self.volume_params)
- self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(0, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
self.volume.create_volume(self.context, volume['id'])
msg = fake_notifier.NOTIFICATIONS[0]
self.assertEqual('volume.create.start', msg['event_type'])
if len(fake_notifier.NOTIFICATIONS) > 2:
# Cause an assert to print the unexpected item
self.assertFalse(fake_notifier.NOTIFICATIONS[2])
- self.assertEqual(2, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(2, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
snapshot_id = self._create_snapshot(volume['id'],
size=volume['size'])['id']
# Cause an assert to print the unexpected item
self.assertFalse(fake_notifier.NOTIFICATIONS[4])
- self.assertEqual(4, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(4, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
self.volume.delete_snapshot(self.context, snapshot_obj)
msg = fake_notifier.NOTIFICATIONS[4]
# Cause an assert to print the unexpected item
self.assertFalse(fake_notifier.NOTIFICATIONS[6])
- self.assertEqual(6, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(6, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
snap = db.snapshot_get(context.get_admin_context(read_deleted='yes'),
snapshot_id)
availability_zone=CONF.storage_availability_zone,
volume_type='type1,type2')
group_id = group['id']
- self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(0, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
self.volume.create_consistencygroup(self.context, group_id)
- self.assertEqual(2, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(2, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
msg = fake_notifier.NOTIFICATIONS[0]
self.assertEqual('consistencygroup.create.start', msg['event_type'])
expected = {
context.get_admin_context(read_deleted='yes'),
group_id)
self.assertEqual('deleted', cg['status'])
- self.assertEqual(4, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(4, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
msg = fake_notifier.NOTIFICATIONS[2]
self.assertEqual('consistencygroup.delete.start', msg['event_type'])
self.assertDictMatch(expected, msg['payload'])
'consistencygroup_id': group_id
}
self.assertEqual('available', cg['status'])
- self.assertEqual(10, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(10, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
msg = fake_notifier.NOTIFICATIONS[6]
self.assertEqual('consistencygroup.update.start', msg['event_type'])
self.assertDictMatch(expected, msg['payload'])
if len(fake_notifier.NOTIFICATIONS) > 6:
self.assertFalse(fake_notifier.NOTIFICATIONS[6])
- self.assertEqual(6, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(6, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
self.volume.delete_consistencygroup(self.context, group2_id)
if len(fake_notifier.NOTIFICATIONS) > 10:
self.assertFalse(fake_notifier.NOTIFICATIONS[10])
- self.assertEqual(10, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(10, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
msg = fake_notifier.NOTIFICATIONS[6]
self.assertEqual('consistencygroup.delete.start', msg['event_type'])
if len(fake_notifier.NOTIFICATIONS) > 2:
self.assertFalse(fake_notifier.NOTIFICATIONS[2])
- self.assertEqual(2, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(2, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
cgsnapshot_returns = self._create_cgsnapshot(group_id, volume_id)
cgsnapshot_id = cgsnapshot_returns[0]['id']
msg = fake_notifier.NOTIFICATIONS[5]
self.assertEqual('snapshot.create.end', msg['event_type'])
- self.assertEqual(6, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(6, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
self.volume.delete_cgsnapshot(self.context, cgsnapshot_id)
self.assertEqual('cgsnapshot.delete.end', msg['event_type'])
self.assertDictMatch(expected, msg['payload'])
- self.assertEqual(10, len(fake_notifier.NOTIFICATIONS))
+ self.assertEqual(10, len(fake_notifier.NOTIFICATIONS),
+ fake_notifier.NOTIFICATIONS)
cgsnap = db.cgsnapshot_get(
context.get_admin_context(read_deleted='yes'),