summaryrefslogtreecommitdiff
path: root/tests/topotests/mgmt_oper
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2024-01-01 09:04:19 +0000
committerChristian Hopps <chopps@labn.net>2024-01-02 09:47:15 +0000
commit7e6595698bd66c7a191996a7cb933ae63b5c5883 (patch)
tree58f0d9a43e29c8f5dfae04b66327247203a77bfa /tests/topotests/mgmt_oper
parent353ee7bb819d5f06a180a1d062b47006456a98c7 (diff)
lib: fix specific entry queries
- fix key leaf queries - fix specific list entry with non-key leaf top element Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests/topotests/mgmt_oper')
-rw-r--r--tests/topotests/mgmt_oper/simple-results/result-intf-eth0-name.json9
-rw-r--r--tests/topotests/mgmt_oper/simple-results/result-intf-eth0-vrf.json10
-rw-r--r--tests/topotests/mgmt_oper/simple-results/result-intf-name.json21
-rw-r--r--tests/topotests/mgmt_oper/test_simple.py17
4 files changed, 57 insertions, 0 deletions
diff --git a/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-name.json b/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-name.json
new file mode 100644
index 0000000000..3988204bb8
--- /dev/null
+++ b/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-name.json
@@ -0,0 +1,9 @@
+{
+ "frr-interface:lib": {
+ "interface": [
+ {
+ "name": "r1-eth0"
+ }
+ ]
+ }
+}
diff --git a/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-vrf.json b/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-vrf.json
new file mode 100644
index 0000000000..3a6eeb853d
--- /dev/null
+++ b/tests/topotests/mgmt_oper/simple-results/result-intf-eth0-vrf.json
@@ -0,0 +1,10 @@
+{
+ "frr-interface:lib": {
+ "interface": [
+ {
+ "name": "r1-eth0",
+ "vrf": "default"
+ }
+ ]
+ }
+}
diff --git a/tests/topotests/mgmt_oper/simple-results/result-intf-name.json b/tests/topotests/mgmt_oper/simple-results/result-intf-name.json
new file mode 100644
index 0000000000..9d8ea759b9
--- /dev/null
+++ b/tests/topotests/mgmt_oper/simple-results/result-intf-name.json
@@ -0,0 +1,21 @@
+{
+ "frr-interface:lib": {
+ "interface": [
+ {
+ "name": "lo"
+ },
+ {
+ "name": "r1-eth0"
+ },
+ {
+ "name": "lo-red"
+ },
+ {
+ "name": "r1-eth1"
+ },
+ {
+ "name": "red"
+ }
+ ]
+ }
+}
diff --git a/tests/topotests/mgmt_oper/test_simple.py b/tests/topotests/mgmt_oper/test_simple.py
index f3d64e156a..1f9f21b8de 100644
--- a/tests/topotests/mgmt_oper/test_simple.py
+++ b/tests/topotests/mgmt_oper/test_simple.py
@@ -46,6 +46,23 @@ def test_oper_simple(tgen):
pytest.skip(tgen.errors)
query_results = [
+ (
+ # Non-key query with key specific selection
+ '/frr-interface:lib/interface[name="r1-eth0"]/vrf',
+ "simple-results/result-intf-eth0-vrf.json",
+ ),
+ # Test machines will have different sets of interfaces so the test results will
+ # vary and need to be generated dynamically before this test is re-enabled
+ # (
+ # # Key query on generic list
+ # "/frr-interface:lib/interface/name",
+ # "simple-results/result-intf-name.json",
+ # ),
+ (
+ # Key query with key specific selection
+ '/frr-interface:lib/interface[name="r1-eth0"]/name',
+ "simple-results/result-intf-eth0-name.json",
+ ),
("/frr-vrf:lib", "simple-results/result-lib.json"),
("/frr-vrf:lib/vrf", "simple-results/result-lib-vrf-nokey.json"),
(