diff options
author | Sujitha <sujitha.neti@intel.com> | 2016-12-02 19:13:43 +0000 |
---|---|---|
committer | Balazs Gibizer <balazs.gibizer@ericsson.com> | 2017-04-21 12:44:12 +0200 |
commit | eb1ac77dd792375a2a8ce6915f19a8d68558ede6 (patch) | |
tree | d8e4327b1f0cc23f7aa11bcb0eb3001f8e7748f5 /nova/tests/unit/test_notifications.py | |
parent | c2d38a50bac4503089ce5d9a1f919e5e0a86021f (diff) | |
download | nova-eb1ac77dd792375a2a8ce6915f19a8d68558ede6.tar.gz |
add tags field to instance.update notification
Tags field is added to the InstanceUpdatePayload based on the
tags field fo the related Instance object. Adding tags to instance.create
notification will be handled in the bp tag-instances-when-boot.
Implements: bp additional-notification-fields-for-searchlight
Change-Id: Ifad6487de200767fc16d035ad830c77bba49154a
Diffstat (limited to 'nova/tests/unit/test_notifications.py')
-rw-r--r-- | nova/tests/unit/test_notifications.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/tests/unit/test_notifications.py b/nova/tests/unit/test_notifications.py index 749048664c..48297cdff5 100644 --- a/nova/tests/unit/test_notifications.py +++ b/nova/tests/unit/test_notifications.py @@ -520,6 +520,16 @@ class NotificationsTestCase(test.TestCase): self.assertEqual(payload["old_display_name"], old_display_name) self.assertEqual(payload["display_name"], new_display_name) + def test_send_versioned_tags_update(self): + objects.TagList.create(self.context, + self.instance.uuid, ['tag1', 'tag2']) + notifications.send_update(self.context, self.instance, self.instance) + self.assertEqual(1, len(fake_notifier.VERSIONED_NOTIFICATIONS)) + + self.assertEqual(['tag1', 'tag2'], + fake_notifier.VERSIONED_NOTIFICATIONS[0] + ['payload']['nova_object.data']['tags']) + def test_send_no_state_change(self): called = [False] |