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
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
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
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)
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)
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)
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)
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)