Changing arping command execute to accept 1 as extra OK code

Connecting any network to a router causes l3-agent to send out
gratuitous ARP packets that do not require a response. On Ubuntu 14.04
sometimes this command returns 1, which causes it to falsely report
arping command failure. This is now added to the extra OK codes.

Change-Id: I6299e936d4e4e7fd7497d23224e7abf605a99c15
Closes-bug: #1578842
This commit is contained in:
Arun Sriraman 2016-05-05 22:18:24 +00:00 committed by Sreekumar S
parent 9f022dad4f
commit cc9ce5189d
2 changed files with 5 additions and 2 deletions

View File

@ -1023,7 +1023,10 @@ def _arping(ns_name, iface_name, address, count, log_exception):
'-w', 1.5 * count, address]
try:
ip_wrapper = IPWrapper(namespace=ns_name)
ip_wrapper.netns.execute(arping_cmd, check_exit_code=True)
# Since arping is used to send gratuitous ARP, a response is not
# expected. In some cases (no response) and with some platforms
# (>=Ubuntu 14.04), arping exit code can be 1.
ip_wrapper.netns.execute(arping_cmd, extra_ok_codes=[1])
except Exception as exc:
msg = _("Failed sending gratuitous ARP "
"to %(addr)s on %(iface)s in namespace %(ns)s: %(err)s")

View File

@ -1357,7 +1357,7 @@ class TestArpPing(TestIPCmdBase):
'-w', mock.ANY,
address]
ip_wrapper.netns.execute.assert_any_call(arping_cmd,
check_exit_code=True)
extra_ok_codes=[1])
@mock.patch('eventlet.spawn_n')
def test_no_ipv6_addr_notif(self, spawn_n):