Fix dhcp autoschedule test assertion logic

The functional test for auto_schedule_networks passes even if the
method does nothing. This patch changes the test so it checks that
each expected hosted network is in hosted_net_ids.

Change-Id: I42130993b1af3f3d028e355d30322853453f064f
Closes-Bug: #1478531
This commit is contained in:
Darragh O'Reilly 2015-07-27 11:23:19 +00:00
parent e95bc6f5be
commit 7f152490bf
1 changed files with 1 additions and 3 deletions

View File

@ -391,9 +391,7 @@ class TestAutoSchedule(test_dhcp_sch.TestDhcpSchedulerBaseTestCase,
for net in hosted_networks]
expected_hosted_networks = self.expected_hosted_networks['agent-%s' %
host_index]
for hosted_net_id in hosted_net_ids:
self.assertIn(hosted_net_id, expected_hosted_networks,
message=msg + '[%s]' % hosted_net_id)
self.assertItemsEqual(hosted_net_ids, expected_hosted_networks, msg)
def test_auto_schedule(self):
for i in range(self.agent_count):