diff options
author | Christian Hopps <chopps@labn.net> | 2021-07-29 07:33:20 +0200 |
---|---|---|
committer | Christian Hopps <chopps@labn.net> | 2021-07-30 23:01:22 +0200 |
commit | 002e6825c13e01765d156cb492692ef99876a1ae (patch) | |
tree | 6195d3758ed73f7a2b3a8f67b113122d6900b435 /tests/topotests/bgp_evpn_mh | |
parent | Merge pull request #9215 from idryzhov/bgp-damp-crash (diff) | |
download | frr-002e6825c13e01765d156cb492692ef99876a1ae.tar.xz frr-002e6825c13e01765d156cb492692ef99876a1ae.zip |
tests: add scapy_sendpkt.py util, replace arping use with it
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests/topotests/bgp_evpn_mh')
-rw-r--r-- | tests/topotests/bgp_evpn_mh/test_evpn_mh.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/topotests/bgp_evpn_mh/test_evpn_mh.py b/tests/topotests/bgp_evpn_mh/test_evpn_mh.py index c66b353c9..2dcf70f14 100644 --- a/tests/topotests/bgp_evpn_mh/test_evpn_mh.py +++ b/tests/topotests/bgp_evpn_mh/test_evpn_mh.py @@ -597,14 +597,23 @@ def test_evpn_ead_update(): def ping_anycast_gw(tgen): - local_host = tgen.gears["hostd11"] - remote_host = tgen.gears["hostd21"] - # ping the anycast gw from the local and remote hosts to populate # the mac address on the PEs - cmd_str = "arping -I torbond -c 1 45.0.0.1" - local_host.run(cmd_str) - remote_host.run(cmd_str) + script_path = os.path.abspath(os.path.join(CWD, "../lib/scapy_sendpkt.py")) + intf = "torbond" + ipaddr = "45.0.0.1" + ping_cmd = [ + script_path, + "--imports=Ether,ARP", + "--interface=" + intf, + "'Ether(dst=\"ff:ff:ff:ff:ff:ff\")/ARP(pdst=\"{}\")'".format(ipaddr) + ] + for name in ("hostd11", "hostd21"): + host = tgen.net[name] + stdout = host.cmd(ping_cmd) + stdout = stdout.strip() + if stdout: + host.logger.debug("%s: arping on %s for %s returned: %s", name, intf, ipaddr, stdout) def check_mac(dut, vni, mac, m_type, esi, intf, ping_gw=False, tgen=None): |