-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16840 from LabNConsulting/chopps/yang-lib
add ietf-yang-library support
- Loading branch information
Showing
6 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
log timestamp precision 6 | ||
log file frr.log | ||
|
||
no debug memstats-at-exit | ||
|
||
debug mgmt backend datastore frontend transaction | ||
|
||
interface r1-eth0 | ||
ip address 1.1.1.1/24 | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python | ||
# SPDX-License-Identifier: ISC | ||
# -*- coding: utf-8 eval: (blacken-mode 1) -*- | ||
# | ||
# September 17 2024, Christian Hopps <[email protected]> | ||
# | ||
# Copyright (c) 2024, LabN Consulting, L.L.C. | ||
# | ||
|
||
import json | ||
import pytest | ||
from lib.topogen import Topogen | ||
|
||
pytestmark = [pytest.mark.staticd, pytest.mark.mgmtd] | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def tgen(request): | ||
"Setup/Teardown the environment and provide tgen argument to tests" | ||
|
||
topodef = {"s1": ("r1",)} | ||
|
||
tgen = Topogen(topodef, request.module.__name__) | ||
tgen.start_topology() | ||
|
||
router_list = tgen.routers() | ||
for rname, router in router_list.items(): | ||
router.load_frr_config("frr-yanglib.conf") | ||
|
||
tgen.start_router() | ||
yield tgen | ||
tgen.stop_topology() | ||
|
||
|
||
def test_yang_lib(tgen): | ||
if tgen.routers_have_failure(): | ||
pytest.skip(tgen.errors) | ||
|
||
r1 = tgen.gears["r1"].net | ||
output = r1.cmd_nostatus( | ||
"vtysh -c 'show mgmt get-data /ietf-yang-library:yang-library'" | ||
) | ||
ret = json.loads(output) | ||
loaded_modules = ret['ietf-yang-library:yang-library']['module-set'][0]['module'] | ||
assert len(loaded_modules) > 10, "Modules missing from yang-library" |