Set node_availability_zone in XenAPIAggregateTestCase

In XenAPIAggregateTestCase some service records
are directly injected to the db for testing with customized AZ
values . The AZ doesn't match the default availability
zone setting (nova), and may or may not be overwritten during
heart beat message update. It is mostly ignored but
sometimes make the test_remove_host_from_aggregate_error()
test fail, as discovered in the servicegroup test.
Set the AZ explicitly to get rid of the non-determinism.

Change-Id: I2ded5314480b2b7eb2254a58e3eb7ca9e3f8b32d
This commit is contained in:
Yun Mao
2012-11-18 15:54:46 -05:00
parent 121669dec2
commit f94346d58b

View File

@@ -2076,7 +2076,8 @@ class XenAPIAggregateTestCase(stubs.XenAPITestBase):
firewall_driver='nova.virt.xenapi.firewall.'
'Dom0IptablesFirewallDriver',
host='host',
compute_driver='xenapi.XenAPIDriver')
compute_driver='xenapi.XenAPIDriver',
node_availability_zone='avail_zone1')
host_ref = xenapi_fake.get_all('host')[0]
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
self.context = context.get_admin_context()