Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1385

Unique statement reference is not validated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 8.0.0
    • None
    • parser
    • None

      We do not seem to enforce that 'unique' statement argument actually references a leaf/leaf-list when the unique statement is introduced via "deviate add".

      This was discovered by checking our behavior w.r.t a NETMOD WG query.

      We have a test case which covers the following:

      module foo {
          deviation "/bar:my-list" {
              deviate add {
                  unique "my-leaf-a my-leaf-b";
                  unique "my-leaf-c my-leaf-d";
              }
          }
      }
      

      and checks whether the unique statements are added, but alas the checks are incomplete.

      The implementation interprets these arguments as "foo:my-leaf-a" and transplants them verbatim – which means that /bar:my-list has the equivalent of

      unique "foo:my-leaf-a foo:my-leaf-b";
      unique "foo:my-leaf-c foo:my-leaf-d";
      

      and the model context gets happily constructed in DeviationResolutionTest.testDeviateAdd().

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: