Tests: Fix XIV test failure with hash randomization
_get_fc_targets creates a set() from target_wwpns. It then sorts the contents of that set using a comparison that only checks the last digit of the entry. This is not a stable sort, so the order of the list output from _get_fc_targets is non-deterministic. This appears to be fine in practice, so just fix the unit test. Needed-By: I4c7396f9d8e58ac8420754503f8ed60cd7473426 Change-Id: I281ad59fa518f936aa8d1b518acf61800ba949f5
This commit is contained in:
parent
b6d2ec994c
commit
405cd37823
@ -1439,7 +1439,8 @@ class XIVProxyTest(test.TestCase):
|
||||
p.ibm_storage_cli.cmd.host_connectivity_list.return_value = (
|
||||
HOST_CONNECTIVITY_LIST)
|
||||
fc_targets = p._get_fc_targets(host)
|
||||
self.assertEqual(FC_TARGETS_OPTIMIZED_WITH_HOST, fc_targets,
|
||||
six.assertCountEqual(self,
|
||||
FC_TARGETS_OPTIMIZED_WITH_HOST, fc_targets,
|
||||
"FC targets are different from the expected")
|
||||
|
||||
def test_get_fc_targets_returns_host_all_wwpns_list(self):
|
||||
@ -1459,7 +1460,8 @@ class XIVProxyTest(test.TestCase):
|
||||
p.ibm_storage_cli.cmd.host_connectivity_list.return_value = (
|
||||
HOST_CONNECTIVITY_LIST_UNKNOWN_HOST)
|
||||
fc_targets = p._get_fc_targets(host)
|
||||
self.assertEqual(FC_TARGETS_OPTIMIZED, fc_targets,
|
||||
six.assertCountEqual(self,
|
||||
FC_TARGETS_OPTIMIZED, fc_targets,
|
||||
"FC targets are different from the expected")
|
||||
|
||||
def test_define_ports_returns_sorted_wwpns_list(self):
|
||||
|
Loading…
Reference in New Issue
Block a user