def _build_expected_msg(self):
     expected = {
         "instance_size": instance_info.dbaas_flavor.ram,
         "tenant_id": instance_info.user.tenant_id,
         "instance_id": instance_info.id,
         "instance_name": instance_info.name,
         "created_at": testsutil.iso_time(instance_info.initial_result.created),
         "launched_at": testsutil.iso_time(self.instance.updated),
         "modify_at": testsutil.iso_time(self.instance.updated),
     }
     return expected
Example #2
0
 def _build_expected_msg(self):
     expected = {
         'instance_size': instance_info.dbaas_flavor.ram,
         'tenant_id': instance_info.user.tenant_id,
         'instance_id': instance_info.id,
         'instance_name': instance_info.name,
         'created_at':
         testsutil.iso_time(instance_info.initial_result.created),
         'launched_at': testsutil.iso_time(self.instance.updated),
         'modify_at': testsutil.iso_time(self.instance.updated)
     }
     return expected
Example #3
0
 def _build_expected_msg(self):
     expected = {
         'instance_size': instance_info.dbaas_flavor.ram,
         'tenant_id': instance_info.user.tenant_id,
         'instance_id': instance_info.id,
         'instance_name': instance_info.name,
         'created_at': testsutil.iso_time(
             instance_info.initial_result.created),
         'launched_at': testsutil.iso_time(self.instance.updated),
         'modify_at': testsutil.iso_time(self.instance.updated)
     }
     return expected
Example #4
0
 def test_resize_instance_down_usage_event_sent(self):
     expected = {
         "old_instance_size": self.old_dbaas_flavor.ram,
         "instance_size": instance_info.dbaas_flavor.ram,
         "tenant_id": instance_info.user.tenant_id,
         "instance_id": instance_info.id,
         "instance_name": instance_info.name,
         "created_at": iso_time(instance_info.initial_result.created),
         "launched_at": iso_time(self.instance.updated),
         "modify_at": iso_time(self.instance.updated),
         "service_id": SERVICE_ID,
     }
     instance_info.consumer.check_message(instance_info.id, "trove.instance.modify_flavor", **expected)
Example #5
0
 def test_instance_delete_event_sent(self):
     expected = {
         'instance_size': instance_info.dbaas_flavor.ram,
         'tenant_id': instance_info.user.tenant_id,
         'instance_id': instance_info.id,
         'instance_name': instance_info.name,
         'created_at': iso_time(instance_info.initial_result.created),
         'launched_at': iso_time(instance_info.initial_result.created),
         'deleted_at': iso_time(instance_info.deleted_at),
     }
     instance_info.consumer.check_message(instance_info.id,
                                          'trove.instance.delete',
                                          **expected)
Example #6
0
 def test_instance_delete_event_sent(self):
     expected = {
         'instance_size': instance_info.dbaas_flavor.ram,
         'tenant_id': instance_info.user.tenant_id,
         'instance_id': instance_info.id,
         'instance_name': instance_info.name,
         'created_at': iso_time(instance_info.initial_result.created),
         'launched_at': iso_time(instance_info.initial_result.created),
         'deleted_at': iso_time(instance_info.deleted_at),
     }
     instance_info.consumer.check_message(instance_info.id,
                                          'trove.instance.delete',
                                          **expected)
Example #7
0
 def test_create_notification(self):
     expected = {
         'instance_size': instance_info.dbaas_flavor.ram,
         'tenant_id': instance_info.user.tenant_id,
         'instance_id': instance_info.id,
         'instance_name': instance_info.name,
         'created_at': iso_time(instance_info.initial_result.created),
         'launched_at': iso_time(instance_info.initial_result.created),
         'region': 'LOCAL_DEV',
         'availability_zone': 'nova',
     }
     instance_info.consumer.check_message(instance_info.id,
                                          'trove.instance.create',
                                          **expected)
Example #8
0
 def test_resize_instance_down_usage_event_sent(self):
     expected = {
         'old_instance_size': self.old_dbaas_flavor.ram,
         'instance_size': instance_info.dbaas_flavor.ram,
         'tenant_id': instance_info.user.tenant_id,
         'instance_id': instance_info.id,
         'instance_name': instance_info.name,
         'created_at': iso_time(instance_info.initial_result.created),
         'launched_at': iso_time(self.instance.updated),
         'modify_at': iso_time(self.instance.updated),
     }
     instance_info.consumer.check_message(instance_info.id,
                                          'trove.instance.modify_flavor',
                                          **expected)
Example #9
0
 def test_resize_instance_down_usage_event_sent(self):
     expected = {
         'old_instance_size': self.old_dbaas_flavor.ram,
         'instance_size': instance_info.dbaas_flavor.ram,
         'tenant_id': instance_info.user.tenant_id,
         'instance_id': instance_info.id,
         'instance_name': instance_info.name,
         'created_at': iso_time(instance_info.initial_result.created),
         'launched_at': iso_time(self.instance.updated),
         'modify_at': iso_time(self.instance.updated),
     }
     instance_info.consumer.check_message(instance_info.id,
                                          'trove.instance.modify_flavor',
                                          **expected)
Example #10
0
 def test_create_notification(self):
     expected = {
         'instance_size': instance_info.dbaas_flavor.ram,
         'tenant_id': instance_info.user.tenant_id,
         'instance_id': instance_info.id,
         'instance_name': instance_info.name,
         'created_at': iso_time(instance_info.initial_result.created),
         'launched_at': iso_time(instance_info.initial_result.created),
         'region': 'LOCAL_DEV',
         'availability_zone': 'nova',
     }
     instance_info.consumer.check_message(instance_info.id,
                                          'trove.instance.create',
                                          **expected)
Example #11
0
 def test_resize_volume_usage_event_sent(self):
     instance = instance_info.dbaas.instances.get(instance_info.id)
     expected = {
         'old_volume_size': self.old_volume_size,
         'instance_size': instance_info.dbaas_flavor.ram,
         'tenant_id': instance_info.user.tenant_id,
         'instance_id': instance_info.id,
         'instance_name': instance_info.name,
         'created_at': iso_time(instance_info.initial_result.created),
         'launched_at': iso_time(instance.updated),
         'modify_at': iso_time(instance.updated),
         'volume_size': self.new_volume_size,
         'service_id': SERVICE_ID
     }
     instance_info.consumer.check_message(instance_info.id,
                                          'trove.instance.modify_volume',
                                          **expected)