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

Unique statement reference is not validated

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 8.0.0
    • parser
    • None

    Description

      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().

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: