Handle compare in test_pre_live_migration_volume_backed* directly
We can't use assertJsonEqual here even if that function deserializes the nested connection_info_json. When deserializing the "bdms" entry in the migrate_data object, it creates a random order on the list which can still cause mismatch errors. So rather than rely on assertJsonEqual handling this, that change is reverted and we simply deserialize the connection_info_json in the test in question before comparing to our expected data. This reverts commit ac9acce283a28326c6f9af4a158e6f3c1e09db45. Change-Id: I7bba91e490a9ac5d0bbffa90e9cbefe60bb31f27 Closes-Bug: #1779711
This commit is contained in:
parent
43fb084b4a
commit
e4c7bd19b1
11
nova/test.py
11
nova/test.py
@ -489,18 +489,7 @@ class TestCase(testtools.TestCase):
|
|||||||
return sorted(items)
|
return sorted(items)
|
||||||
return x
|
return x
|
||||||
|
|
||||||
def try_deserialize(entry):
|
|
||||||
"""Try to deserialize string entry; if not json, return entry"""
|
|
||||||
if isinstance(entry, six.string_types):
|
|
||||||
try:
|
|
||||||
return jsonutils.loads(entry)
|
|
||||||
except ValueError:
|
|
||||||
pass
|
|
||||||
return entry
|
|
||||||
|
|
||||||
def inner(expected, observed, path='root'):
|
def inner(expected, observed, path='root'):
|
||||||
expected = try_deserialize(expected)
|
|
||||||
observed = try_deserialize(observed)
|
|
||||||
if isinstance(expected, dict) and isinstance(observed, dict):
|
if isinstance(expected, dict) and isinstance(observed, dict):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
len(expected), len(observed),
|
len(expected), len(observed),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user