diff --git a/tests/arp/test_unknown_mac.py b/tests/arp/test_unknown_mac.py index d519bc47d8a..4b8a6323d3d 100644 --- a/tests/arp/test_unknown_mac.py +++ b/tests/arp/test_unknown_mac.py @@ -41,6 +41,25 @@ def wrapper(self, *args): return wrapper +@pytest.fixture(autouse=True, scope="module") +def dut_disable_arp_update(rand_selected_dut): + """ + Fixture to disable arp update before the test and re-enable it afterwards + + Args: + rand_selected_dut(AnsibleHost) : dut instance + """ + duthost = rand_selected_dut + if duthost.shell("docker exec -t swss supervisorctl stop arp_update")['stdout_lines'][0] \ + == 'arp_update: ERROR (not running)': + logger.warning("arp_update not running, already disabled") + + yield + + assert duthost.shell("docker exec -t swss supervisorctl start arp_update")['stdout_lines'][0] \ + == 'arp_update: started' + + @pytest.fixture(autouse=True, scope="module") def unknownMacSetup(duthosts, rand_one_dut_hostname, tbinfo): """