[Functional tests] Change way how conntrack entries are checked
In netlink_lib functional tests module there are listed conntrack
entries and those entries are assert to some expected list.
It may happen that sometimes some additional entries from other
tests will also be in the list and that cause failures of
netlink_lib tests.
So this patch changes way how those assertions are done. For now
it will check if each of expected entries is in entries list and
in case of delete entries tests, it will also check if any of
deleted entries isn't actually in list.
Change-Id: I30c18f141a8356b060902e6493ba0657b21619ad
Closes-Bug: #1817295
(cherry picked from commit 798c6c731f
)
This commit is contained in:
parent
10de9ff017
commit
289f66bd74
|
@ -55,7 +55,10 @@ class NetlinkLibTestCase(functional_base.BaseSudoTestCase):
|
|||
def _delete_entry(self, delete_entries, remain_entries, zone):
|
||||
nl_lib.delete_entries(entries=delete_entries)
|
||||
entries_list = nl_lib.list_entries(zone=zone)
|
||||
self.assertEqual(remain_entries, entries_list)
|
||||
for delete_entry in delete_entries:
|
||||
self.assertNotIn(delete_entry, entries_list)
|
||||
for remain_entry in remain_entries:
|
||||
self.assertIn(remain_entry, entries_list)
|
||||
|
||||
@staticmethod
|
||||
def _find_unused_zone_id(start, end):
|
||||
|
@ -83,7 +86,8 @@ class NetlinkLibTestCase(functional_base.BaseSudoTestCase):
|
|||
(4, 'udp', 4, 5, '1.1.1.1', '2.2.2.2', _zone)
|
||||
)
|
||||
entries_list = nl_lib.list_entries(zone=_zone)
|
||||
self.assertEqual(expected, entries_list)
|
||||
for entry in expected:
|
||||
self.assertIn(entry, entries_list)
|
||||
|
||||
def test_delete_icmp_entry(self):
|
||||
_zone = self._find_unused_zone_id(31, 50)
|
||||
|
|
Loading…
Reference in New Issue