File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ package netlink
99import (
1010 "net"
1111 "testing"
12+ "time"
1213
1314 "github.com/stretchr/testify/require"
1415 "golang.org/x/sys/unix"
@@ -285,6 +286,10 @@ func TestAddRemoveStaticArp(t *testing.T) {
285286 mac , _ := net .ParseMAC ("aa:b3:4d:5e:e2:4a" )
286287 nl := NewNetlink ()
287288
289+ // wait for interface to fully come up
290+ // if it isn't fully up it might wipe the arp entry we're about to add
291+ time .Sleep (time .Millisecond * 100 )
292+
288293 linkInfo := LinkInfo {
289294 Name : ifName ,
290295 IPAddr : ip ,
@@ -302,6 +307,9 @@ func TestAddRemoveStaticArp(t *testing.T) {
302307 MacAddress : mac ,
303308 }
304309
310+ // ensure arp address remains for a period of time
311+ time .Sleep (time .Millisecond * 100 )
312+
305313 err = nl .SetOrRemoveLinkAddress (linkInfo , REMOVE , NUD_INCOMPLETE )
306314 if err != nil {
307315 t .Errorf ("ret val %v" , err )
You can’t perform that action at this time.
0 commit comments