Merge "Delete conntrack entry on the other direction"
This commit is contained in:
@@ -79,7 +79,9 @@ class IpConntrackManager(object):
|
|||||||
|
|
||||||
def delete_conntrack_state_by_remote_ips(self, device_info_list,
|
def delete_conntrack_state_by_remote_ips(self, device_info_list,
|
||||||
ethertype, remote_ips):
|
ethertype, remote_ips):
|
||||||
rule = {'ethertype': str(ethertype).lower(), 'direction': 'ingress'}
|
for direction in ['ingress', 'egress']:
|
||||||
|
rule = {'ethertype': str(ethertype).lower(),
|
||||||
|
'direction': direction}
|
||||||
if remote_ips:
|
if remote_ips:
|
||||||
for remote_ip in remote_ips:
|
for remote_ip in remote_ips:
|
||||||
self._delete_conntrack_state(
|
self._delete_conntrack_state(
|
||||||
|
@@ -1131,9 +1131,17 @@ class IptablesFirewallTestCase(BaseIptablesFirewallTestCase):
|
|||||||
'-w', 10],
|
'-w', 10],
|
||||||
run_as_root=True, check_exit_code=True,
|
run_as_root=True, check_exit_code=True,
|
||||||
extra_ok_codes=[1]),
|
extra_ok_codes=[1]),
|
||||||
|
mock.call(['conntrack', '-D', '-f', 'ipv4', '-s', '10.0.0.1',
|
||||||
|
'-w', 10],
|
||||||
|
run_as_root=True, check_exit_code=True,
|
||||||
|
extra_ok_codes=[1]),
|
||||||
mock.call(['conntrack', '-D', '-f', 'ipv6', '-d', 'fe80::1',
|
mock.call(['conntrack', '-D', '-f', 'ipv6', '-d', 'fe80::1',
|
||||||
'-w', 10],
|
'-w', 10],
|
||||||
run_as_root=True, check_exit_code=True,
|
run_as_root=True, check_exit_code=True,
|
||||||
|
extra_ok_codes=[1]),
|
||||||
|
mock.call(['conntrack', '-D', '-f', 'ipv6', '-s', 'fe80::1',
|
||||||
|
'-w', 10],
|
||||||
|
run_as_root=True, check_exit_code=True,
|
||||||
extra_ok_codes=[1])]
|
extra_ok_codes=[1])]
|
||||||
self.utils_exec.assert_has_calls(calls)
|
self.utils_exec.assert_has_calls(calls)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user