diff options
| author | Christian Hopps <chopps@labn.net> | 2025-01-07 00:15:12 -0500 | 
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2025-01-07 01:24:38 -0500 | 
| commit | 0ce15fb0f770f5b20199dbff8931bd95f6aabcfd (patch) | |
| tree | 5b61cc9829b9eea74d37c668074c24c5b2acc3c0 | |
| parent | 2fb6519c52f919be79c27feddfd36502736f64c0 (diff) | |
tests: add unit test case for keyless list xpath queries
Signed-off-by: Christian Hopps <chopps@labn.net>
| -rw-r--r-- | tests/lib/northbound/test_oper_data.in | 3 | ||||
| -rw-r--r-- | tests/lib/northbound/test_oper_data.refout | 43 | 
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 f7c44cad31..0053148953 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 7c56564143..77e8562525 100644 --- a/tests/lib/northbound/test_oper_data.refout +++ b/tests/lib/northbound/test_oper_data.refout @@ -119,6 +119,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#   | 
