Skip to content

Commit b1dab45

Browse files
wangxinyxieca
authored andcommitted
[arp] Ignore intermittent failure of "ip neigh flush all" (#820)
In ARP testing, the script needs to run "ip neigh flush all" couple of times to clean up ARP table. Occasionally flushing ARP table may fail with error "*** Flush not complete bailing out after 10 rounds" on ptf32 or ptf64 topology. The reason is that BGP peers are configured on these topologies although the PTF container does not have BGP running. From time to time, DUT will try to contact the BGP peers. ARP requests are firstly sent out. This will create some INCOMPLETE entries in ARP table for the BGP peers. If "ip neigh flush all" is executed at the same moment, the command may fail with "*** Flush not complete bailing out after 10 rounds". The fix is to simply ignore the error of "ip neigh flush all". Purpose of the "ip neigh flush all" command is to cleanup ARP entries generated by previous testing. It doesn't matter when there are ARP entries generated by other activities not flushed. Meanwhile, I changed the command to "ip -stats neigh flush all" to have more detailed output for debug in case of failure. Signed-off-by: Xin Wang <[email protected]>
1 parent 78d53ea commit b1dab45

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

ansible/roles/test/tasks/arpall.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
delegate_to: "{{ ptf_host }}"
7474

7575
- name: Clear DUT arp cache
76-
command: ip nei flush all
76+
command: ip -stats neigh flush all
77+
ignore_errors: yes
7778
become: yes
7879

7980
- name: Start PTF runner and Send correct unicast arp packets (10.10.1.3 to 10.10.1.2 with src_mac=00:06:07:08:09:00)
@@ -99,7 +100,8 @@
99100
- "{{ arptable['v4']['10.10.1.3']['interface'] == intf1 }}"
100101

101102
- name: Clear DUT arp cache
102-
command: ip nei flush all
103+
command: ip -stats neigh flush all
104+
ignore_errors: yes
103105
become: yes
104106

105107
# Send correct ARP request from correct interface, expecting normal behavior
@@ -127,7 +129,8 @@
127129

128130
## check DUT won't reply ARP and install ARP entry when ARP request coming from other interfaces
129131
- name: Clear DUT arp cache
130-
command: ip nei flush all
132+
command: ip -stats neigh flush all
133+
ignore_errors: yes
131134
become: yes
132135

133136
- name: Send correct arp packets from other interface expect no reply(10.10.1.4 to 10.10.1.2 with src_mac=00:02:07:08:09:0a)
@@ -154,7 +157,8 @@
154157

155158
## check DUT won't reply ARP and install ARP entry when src address is not in interface subnet range
156159
- name: Clear DUT arp cache
157-
command: ip nei flush all
160+
command: ip -stats neigh flush all
161+
ignore_errors: yes
158162
become: yes
159163

160164
- name: Send Src IP out of interface subnet range arp packets, expect no reply and no arp table entry (10.10.1.22 to 10.10.1.2 with src_mac=00:03:07:08:09:0a)
@@ -181,7 +185,8 @@
181185

182186
## Test Gratuitous ARP behavior, no Gratuitous ARP installed when arp was not resolved before
183187
- name: Clear DUT arp cache
184-
command: ip nei flush all
188+
command: ip -stats neigh flush all
189+
ignore_errors: yes
185190
become: yes
186191

187192
- name: Send garp packets (10.10.1.7 to 10.10.1.7)

0 commit comments

Comments
 (0)