summaryrefslogtreecommitdiffstats
path: root/tests/topotests
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-04-13 07:56:04 +0200
committerGitHub <noreply@github.com>2023-04-13 07:56:04 +0200
commit0667f62411365e11ba78465d6343465351fe317c (patch)
tree3393450be177a0980afa1a00ed1f8beaa4fbb287 /tests/topotests
parentMerge pull request #13177 from mjstapp/fix_ospf_supoort_typo (diff)
parenttopotests: fix bgp lu explicit-null test (diff)
downloadfrr-0667f62411365e11ba78465d6343465351fe317c.tar.xz
frr-0667f62411365e11ba78465d6343465351fe317c.zip
Merge pull request #13276 from pguibert6WIND/explicit_null_complement
Explicit null complement
Diffstat (limited to 'tests/topotests')
-rw-r--r--tests/topotests/bgp_lu_explicitnull/test_bgp_lu_explicitnull.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/topotests/bgp_lu_explicitnull/test_bgp_lu_explicitnull.py b/tests/topotests/bgp_lu_explicitnull/test_bgp_lu_explicitnull.py
index d53ac68e8..0656e1ed4 100644
--- a/tests/topotests/bgp_lu_explicitnull/test_bgp_lu_explicitnull.py
+++ b/tests/topotests/bgp_lu_explicitnull/test_bgp_lu_explicitnull.py
@@ -115,11 +115,13 @@ def check_show_ip_label_prefix_found(router, ipversion, prefix, label):
output = json.loads(
router.vtysh_cmd("show {} route {} json".format(ipversion, prefix))
)
- expected = {prefix: [{"prefix": prefix, "nexthops": [{"fib": True, "labels": [label]}]}]}
- ret = topotest.json_cmp(output, expected)
- if ret is None:
- return "not good"
- return None
+ expected = {
+ prefix: [
+ {"prefix": prefix, "nexthops": [{"fib": True, "labels": [int(label)]}]}
+ ]
+ }
+ return topotest.json_cmp(output, expected)
+
def test_converge_bgplu():
"Wait for protocol convergence"
@@ -141,9 +143,7 @@ def test_converge_bgplu():
"0",
)
success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
- assert (
- success
- ), "r1, prefix 192.168.2.2/32 from r2 not present"
+ assert success, "r1, prefix 192.168.2.2/32 from r2 not present"
# Check r2 gets prefix 192.168.2.1/32
test_func = functools.partial(
@@ -154,9 +154,8 @@ def test_converge_bgplu():
"0",
)
success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
- assert (
- success
- ), "r2, prefix 192.168.2.1/32 from r1 not present"
+ assert success, "r2, prefix 192.168.2.1/32 from r1 not present"
+
def test_traffic_connectivity():
"Wait for protocol convergence"
@@ -168,7 +167,9 @@ def test_traffic_connectivity():
def _check_ping(name, dest_addr, src_addr):
tgen = get_topogen()
- output = tgen.gears[name].run("ping {} -c 1 -w 1 -I {}".format(dest_addr, src_addr))
+ output = tgen.gears[name].run(
+ "ping {} -c 1 -w 1 -I {}".format(dest_addr, src_addr)
+ )
logger.info(output)
if " 0% packet loss" not in output:
return True
@@ -180,6 +181,7 @@ def test_traffic_connectivity():
success, result = topotest.run_and_expect(func, None, count=10, wait=0.5)
assert result is None, "r1, ping to 192.168.2.2 from 192.168.2.1 fails"
+
def test_memory_leak():
"Run the memory leak test and report results."
tgen = get_topogen()