Skip to content

Commit

Permalink
Merge pull request #14534 from mjstapp/fix_topo_nhgid
Browse files Browse the repository at this point in the history
tests: locate nhg id from json output in all_proto_startup
  • Loading branch information
donaldsharp authored Oct 5, 2023
2 parents 580bc71 + 22fb94a commit c516447
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/topotests/all_protocol_startup/test_all_protocol_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
required_linux_kernel_version,
)

from lib.topolog import logger
import json

fatal_error = ""


Expand Down Expand Up @@ -1611,10 +1614,21 @@ def test_resilient_nexthop_group():
)

output = net["r1"].cmd('vtysh -c "show nexthop-group rib sharp"')
output = re.findall(r"Buckets", output)
buckets = re.findall(r"Buckets", output)

output = net["r1"].cmd('vtysh -c "show nexthop-group rib sharp json"')

joutput = json.loads(output)

# Use the json output and collect the nhg id from it

for nhgid in joutput:
n = joutput[nhgid]
if "buckets" in n:
break

verify_nexthop_group(185483878)
assert len(output) == 1, "Resilient NHG not created in zebra"
verify_nexthop_group(int(nhgid))
assert len(buckets) == 1, "Resilient NHG not created in zebra"


def test_shutdown_check_stderr():
Expand Down

0 comments on commit c516447

Please sign in to comment.