summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2025-01-07 19:17:37 +0100
committerGitHub <noreply@github.com>2025-01-07 19:17:37 +0100
commit96ab6ae32b95e3399dc23805e2d31bae99a59a60 (patch)
treea5410bfcd861edca3c7a33fcd31a541578f85c13 /tests
parentMerge pull request #17782 from LabNConsulting/chopps/new-notify-msg-fmt (diff)
parenttests: add unit test case for keyless list xpath queries (diff)
downloadfrr-96ab6ae32b95e3399dc23805e2d31bae99a59a60.tar.xz
frr-96ab6ae32b95e3399dc23805e2d31bae99a59a60.zip
Merge pull request #17781 from LabNConsulting/chopps/fix-keyless-list-query
fix xpath query on keyless list with positional predicate
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/northbound/test_oper_data.in3
-rw-r--r--tests/lib/northbound/test_oper_data.refout43
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/lib/northbound/test_oper_data.in b/tests/lib/northbound/test_oper_data.in
index f7c44cad3..005314895 100644
--- a/tests/lib/northbound/test_oper_data.in
+++ b/tests/lib/northbound/test_oper_data.in
@@ -1,2 +1,5 @@
show yang operational-data /frr-test-module:frr-test-module
+show yang operational-data /frr-test-module:frr-test-module/vrfs/vrf[name='vrf0']/routes/route[2]
+show yang operational-data /frr-test-module:frr-test-module/vrfs/vrf[name='vrf0']/routes/route[3]/interface
+show yang operational-data /frr-test-module:frr-test-module/vrfs/vrf[name='vrf0']/routes/route[10]
test rpc
diff --git a/tests/lib/northbound/test_oper_data.refout b/tests/lib/northbound/test_oper_data.refout
index eadb63964..2536e0306 100644
--- a/tests/lib/northbound/test_oper_data.refout
+++ b/tests/lib/northbound/test_oper_data.refout
@@ -131,6 +131,49 @@ test# show yang operational-data /frr-test-module:frr-test-module
}
}
}
+test# show yang operational-data /frr-test-module:frr-test-module/vrfs/vrf[name='vrf0']/routes/route[2]
+{
+ "frr-test-module:frr-test-module": {
+ "vrfs": {
+ "vrf": [
+ {
+ "name": "vrf0",
+ "routes": {
+ "route": [
+ {
+ "prefix": "10.0.0.1/32",
+ "next-hop": "172.16.0.1",
+ "interface": "eth1",
+ "metric": 1
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+}
+test# show yang operational-data /frr-test-module:frr-test-module/vrfs/vrf[name='vrf0']/routes/route[3]/interface
+{
+ "frr-test-module:frr-test-module": {
+ "vrfs": {
+ "vrf": [
+ {
+ "name": "vrf0",
+ "routes": {
+ "route": [
+ {
+ "interface": "eth2"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+}
+test# show yang operational-data /frr-test-module:frr-test-module/vrfs/vrf[name='vrf0']/routes/route[10]
+{}
test# test rpc
vrf testname data testdata
test#