Skip to content

Commit

Permalink
tests: micronet: update infra
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hopps <chopps@labn.net>
  • Loading branch information
choppsv1 committed Sep 4, 2021
1 parent 6a5433e commit 4958158
Show file tree
Hide file tree
Showing 18 changed files with 1,464 additions and 937 deletions.
6 changes: 6 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[MASTER]
init-hook="import sys; sys.path.insert(0, '..')"
signature-mutators=common_config.retry,retry

[MESSAGES CONTROL]
disable=I,C,R,W
4 changes: 2 additions & 2 deletions tests/topotests/bfd_vrf_topo1/test_bfd_vrf_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def setup_module(mod):
for rname, router in router_list.items():
# create VRF rx-bfd-cust1 and link rx-eth0 to rx-bfd-cust1
for cmd in cmds:
output = tgen.net[rname].cmd(cmd.format(rname))
output = tgen.net[rname].cmd_raises(cmd.format(rname))
if rname == "r2":
for cmd in cmds2:
output = tgen.net[rname].cmd(cmd.format(rname))
output = tgen.net[rname].cmd_raises(cmd.format(rname))

for rname, router in router_list.items():
router.load_config(
Expand Down
11 changes: 8 additions & 3 deletions tests/topotests/bgp_evpn_mh/test_evpn_mh.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
import os
import re
import sys
import subprocess
from functools import partial

import pytest
import json
import platform
Expand Down Expand Up @@ -599,18 +602,20 @@ def test_evpn_ead_update():
def ping_anycast_gw(tgen):
# ping the anycast gw from the local and remote hosts to populate
# the mac address on the PEs
python3_path = tgen.net.get_exec_path(["python3", "python"])
script_path = os.path.abspath(os.path.join(CWD, "../lib/scapy_sendpkt.py"))
intf = "torbond"
ipaddr = "45.0.0.1"
ping_cmd = [
python3_path,
script_path,
"--imports=Ether,ARP",
"--interface=" + intf,
"'Ether(dst=\"ff:ff:ff:ff:ff:ff\")/ARP(pdst=\"{}\")'".format(ipaddr)
'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)
host = tgen.net.hosts[name]
_, stdout, _ = host.cmd_status(ping_cmd, warn=False, stderr=subprocess.STDOUT)
stdout = stdout.strip()
if stdout:
host.logger.debug("%s: arping on %s for %s returned: %s", name, intf, ipaddr, stdout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@
LOOPBACK_1 = {
"ipv4": "10.0.0.7/24",
"ipv6": "fd00:0:0:1::7/64",
"ipv4_mask": "255.255.255.0",
"ipv6_mask": None,
}
LOOPBACK_2 = {
"ipv4": "10.0.0.16/24",
Expand Down
Loading

0 comments on commit 4958158

Please sign in to comment.