diff --git a/tests/arp/test_wr_arp.py b/tests/arp/test_wr_arp.py index 6af49d18eb1..86e567ec35d 100644 --- a/tests/arp/test_wr_arp.py +++ b/tests/arp/test_wr_arp.py @@ -124,6 +124,12 @@ def setupFerret(self, duthost, ptfhost): logger.info('Refreshing supervisor control with ferret configuration') ptfhost.shell('supervisorctl reread && supervisorctl update') + @pytest.fixture(scope='class', autouse=True) + def clean_dut(self, duthost): + yield + logger.info("Clear ARP cache on DUT") + duthost.command('sonic-clear arp') + @pytest.fixture(scope='class', autouse=True) def setupRouteToPtfhost(self, duthost, ptfhost): ''' diff --git a/tests/bgp/test_bgp_speaker.py b/tests/bgp/test_bgp_speaker.py index f7b7ef5f546..d6f5c0a2eb4 100644 --- a/tests/bgp/test_bgp_speaker.py +++ b/tests/bgp/test_bgp_speaker.py @@ -112,6 +112,8 @@ def common_setup_teardown(duthost, ptfhost, localhost): ptfhost.shell("ip route flush %s/%d" % (lo_addr, lo_addr_prefixlen)) ptfhost.shell("ip route add %s/%d via %s" % (lo_addr, lo_addr_prefixlen, vlan_addr)) + logging.info("clear ARP cache on DUT") + duthost.command("sonic-clear arp") for ip in vlan_ips: duthost.command("ip route flush %s/32" % ip.ip) # The ping here is workaround for known issue: