tests: Test Resilient NHG's are properly created in zebra

When a Resilient NHG is created, ensure that Zebra notes
that it is created and has it as well.

Signed-off-by: Donald Sharp <sharp@nvidia.com>
This commit is contained in:
Donald Sharp 2022-10-26 15:47:08 -04:00 committed by Donald Sharp
parent 8966cca209
commit a5e5c9a301

View File

@ -47,6 +47,9 @@ pytestmark = [
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from lib import topotest
from lib.topogen import Topogen, get_topogen
from lib.common_config import (
required_linux_kernel_version,
)
fatal_error = ""
@ -1591,6 +1594,24 @@ def test_mpls_interfaces():
assert fatal_error == "", fatal_error
def test_resilient_nexthop_group():
net = get_topogen().net
result = required_linux_kernel_version("5.19")
if result is not True:
pytest.skip("Kernel requirements are not met, kernel version should be >= 5.19")
net["r1"].cmd(
'vtysh -c "conf" -c "nexthop-group resilience" -c "resilient buckets 64 idle-timer 128 unbalanced-timer 256" -c "nexthop 1.1.1.1 r1-eth1 onlink" -c "nexthop 1.1.1.2 r1-eth2 onlink"'
)
output = net["r1"].cmd('vtysh -c "show nexthop-group rib sharp"')
output = re.findall(r"Buckets", output)
verify_nexthop_group(185483878)
assert len(output) == 1, "Resilient NHG not created in zebra"
def test_shutdown_check_stderr():
global fatal_error
net = get_topogen().net