[YANGTOOLS-1385] Unique statement reference is not validated Created: 15/Dec/21 Updated: 17/May/22 Resolved: 05/Jan/22 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | parser |
| Affects Version/s: | None |
| Fix Version/s: | 8.0.0 |
| Type: | Bug | Priority: | Medium |
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| 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(). |