Skip to contentSkip to conversation

ipneigh01.sh: Fix an issue where ipneigh01_arp test case fail due to ARP timeout

PATCH In review Xu Senmiao via ltp 2 participants 2 messages Aug 15, 2023 – Sep 22, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipneigh01.sh: Fix an issue where ipneigh01_arp test case fail due to ARP timeout

When the ARP status of the rhost is stale,
lhost ping rhost and the lhost deletes the ARP record,
the record in the rhost changes from stale to delay.
Then, the probe request is sent to the lhost, and the lhost ARP information is updated.

rhost(10.0.0.1) lhost(10.0.0.2)
t1 10.0.0.2 STALE ping 10.0.0.1

                        10.0.0.1 REACHABLE
                        arp -d 10.0.0.1

t2 10.0.0.2 DELAY
t3 probe 10.0.0.2
t4 10.0.0.1 REACHABLE

Clear the ARP entries of rhost before each round of test.

---
 testcases/network/tcp_cmds/ipneigh/ipneigh01.sh | 1 +
 1 file changed, 1 insertion(+)
testcases/network/tcp_cmds/ipneigh/ipneigh01.sh +1 -0
index e67ff5cc8..4db675f8f 100755
@@ -56,6 +56,7 @@ do_test()
 	tst_res TINFO "stress auto-creation $entry_name cache entry deleted with '$CMD' $NUMLOOPS times"
 
 	for i in $(seq 1 $NUMLOOPS); do
+		tst_rhost_run -c "arp -d $(tst_ipaddr lhost)"
 
 		ping$TST_IPV6 -q -c1 $(tst_ipaddr rhost) -I $(tst_iface) > /dev/null || \
 			tst_brk TFAIL "cannot ping $(tst_ipaddr rhost)"
Signature · 5 lines
2.33.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Xu,

Quoted 9 lines

When the ARP status of the rhost is stale,
lhost ping rhost and the lhost deletes the ARP record,
the record in the rhost changes from stale to delay.
Then, the probe request is sent to the lhost, and the lhost ARP information is updated.

   rhost(10.0.0.1)      lhost(10.0.0.2)
t1 10.0.0.2 STALE       ping 10.0.0.1
                        10.0.0.1 REACHABLE
                        arp -d 10.0.0.1
Quoted 5 lines

t2 10.0.0.2 DELAY
t3 probe 10.0.0.2
t4 10.0.0.1 REACHABLE

Clear the ARP entries of rhost before each round of test.

Do you have idea why ARP status of the rhost is stale? I've never encountered problem like this.

Quoted 10 lines
---
 testcases/network/tcp_cmds/ipneigh/ipneigh01.sh | 1 +
 1 file changed, 1 insertion(+)
testcases/network/tcp_cmds/ipneigh/ipneigh01.sh +0 -0
index e67ff5cc8..4db675f8f 100755

testcases/network/tcp_cmds/ipneigh/ipneigh01.sh do_test() · line 59

Quoted 4 lines
testcases/network/tcp_cmds/ipneigh/ipneigh01.sh +1 -0
@@ -56,6 +56,7 @@ do_test()
 	tst_res TINFO "stress auto-creation $entry_name cache entry deleted with '$CMD' $NUMLOOPS times"
 
 	for i in $(seq 1 $NUMLOOPS); do
+		tst_rhost_run -c "arp -d $(tst_ipaddr lhost)"

IMHO we use $DEL_CMD as we use later in the test function, because some systems does not have arp installed. i.e. use the tool which is used for testing. Otherwise we endup with: sh: arp: command not found

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp