summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-01-13 23:54:08 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2024-01-15 09:27:33 +0100
commit2764344bcbd37c5ea69231d6e51ba9cd58edbb44 (patch)
tree1aa9970c47f61b48cc0ae36df297f0e2f01f969f /tests
parentlib, mgmtd: add ability to request the exact node in get-data request (diff)
downloadfrr-2764344bcbd37c5ea69231d6e51ba9cd58edbb44.tar.xz
frr-2764344bcbd37c5ea69231d6e51ba9cd58edbb44.zip
tests: add tests for mgmt get-data exact node request
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/topotests/mgmt_oper/simple-results/result-intf-eth0-description-exact.json3
-rw-r--r--tests/topotests/mgmt_oper/simple-results/result-intf-eth0-exact.json22
-rw-r--r--tests/topotests/mgmt_oper/test_simple.py10
3 files changed, 35 insertions, 0 deletions
diff --git a/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-description-exact.json b/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-description-exact.json
new file mode 100644
index 000000000..e00f23c3d
--- /dev/null
+++ b/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-description-exact.json
@@ -0,0 +1,3 @@
+{
+ "frr-interface:description": "r1-eth0-desc"
+}
diff --git a/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-exact.json b/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-exact.json
new file mode 100644
index 000000000..f04e3a55e
--- /dev/null
+++ b/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-exact.json
@@ -0,0 +1,22 @@
+{
+ "frr-interface:interface": [
+ {
+ "name": "r1-eth0",
+ "vrf": "default",
+ "state": {
+ "if-index": "rubout",
+ "mtu": 1500,
+ "mtu6": 1500,
+ "speed": 10000,
+ "metric": 0,
+ "phy-address": "rubout"
+ },
+ "frr-zebra:zebra": {
+ "state": {
+ "up-count": 0,
+ "down-count": 0
+ }
+ }
+ }
+ ]
+}
diff --git a/tests/topotests/mgmt_oper/test_simple.py b/tests/topotests/mgmt_oper/test_simple.py
index 2f75dfc82..a52d125ec 100644
--- a/tests/topotests/mgmt_oper/test_simple.py
+++ b/tests/topotests/mgmt_oper/test_simple.py
@@ -127,6 +127,16 @@ def test_oper_simple(tgen):
"simple-results/result-intf-description.json",
"with-config",
),
+ (
+ '/frr-interface:lib/interface[name="r1-eth0"]',
+ "simple-results/result-intf-eth0-exact.json",
+ "exact",
+ ),
+ (
+ '/frr-interface:lib/interface[name="r1-eth0"]/description',
+ "simple-results/result-intf-eth0-description-exact.json",
+ "with-config exact",
+ ),
# Interface state
(
'/frr-interface:lib/interface[name="r1-eth0"]/state',