summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJay Lau <jay.lau.513@gmail.com>2013-05-20 11:20:25 +0800
committerJay Lau <jay.lau.513@gmail.com>2013-05-26 15:01:08 +0800
commit22acf0d2a460149b07ce4a2bbbcff1c1773c9dac (patch)
tree6c77f642ad9601893b5f31af6a53e33b2c4d0fc2 /nova/tests
parente1528ee7fca4f7d77e3808090c10bd304c79fc57 (diff)
downloadnova-22acf0d2a460149b07ce4a2bbbcff1c1773c9dac.tar.gz
nova-22acf0d2a460149b07ce4a2bbbcff1c1773c9dac.tar.xz
nova-22acf0d2a460149b07ce4a2bbbcff1c1773c9dac.zip
Add node as instance attribute for notification
Fix bug 1181900 In havana release, node is not set as instance attribute and node indicates the hypervisor where the instance reside in, we should set node as instance attribute for notification. Change-Id: I872fba626ef3e321d88cf60fc730df6cf4612c86
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_notifications.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/tests/test_notifications.py b/nova/tests/test_notifications.py
index 0d2108557..71b85b375 100644
--- a/nova/tests/test_notifications.py
+++ b/nova/tests/test_notifications.py
@@ -82,6 +82,7 @@ class NotificationsTestCase(test.TestCase):
inst['access_ip_v6'] = 'feed:5eed'
inst['display_name'] = 'test_instance'
inst['hostname'] = 'test_instance_hostname'
+ inst['node'] = 'test_instance_node'
inst['system_metadata'] = sys_meta
if params:
inst.update(params)
@@ -211,6 +212,7 @@ class NotificationsTestCase(test.TestCase):
access_ip_v6 = self.instance["access_ip_v6"]
display_name = self.instance["display_name"]
hostname = self.instance["hostname"]
+ node = self.instance["node"]
self.assertEquals(vm_states.BUILDING, payload["old_state"])
self.assertEquals(vm_states.ACTIVE, payload["state"])
@@ -220,6 +222,7 @@ class NotificationsTestCase(test.TestCase):
self.assertEquals(payload["access_ip_v6"], access_ip_v6)
self.assertEquals(payload["display_name"], display_name)
self.assertEquals(payload["hostname"], hostname)
+ self.assertEquals(payload["node"], node)
def test_task_update_with_states(self):
self.flags(notify_on_state_change="vm_and_task_state")