[ONOS-6784] Leafref and identity ref under grouping.
Change-Id: Ic2d950efc6da25ed83fe4b709e2800f45f01edfa
diff --git a/runtime/src/test/resources/yobTestYangFiles/simple-data-types.yang b/runtime/src/test/resources/yobTestYangFiles/simple-data-types.yang
index 599649f..1267a0a 100644
--- a/runtime/src/test/resources/yobTestYangFiles/simple-data-types.yang
+++ b/runtime/src/test/resources/yobTestYangFiles/simple-data-types.yang
@@ -1,275 +1,606 @@
module simple-data-types {
- namespace "simple:data:types";
+ namespace "simple:data:types";
- prefix "smpdtp";
- revision 2013-11-12 {
- }
+ prefix "smpdtp";
- identity iden {
- }
-
- typedef tpdfempty {
- type empty;
- }
-
- typedef tpdfbit {
- type bits {
- bit b1;
- bit b2;
- bit b3;
+ import YtbDataTypes {
+ prefix ytb;
}
- }
-
- typedef tpdfun4 {
- type boolean;
- }
-
- typedef tpdfun3 {
- type union {
- type tpdfbit;
- type tpdfempty;
- }
- }
-
- typedef tpdfun2 {
- type union {
- type tpdfun3;
- type tpdfun4;
- }
- }
-
- typedef tpdfun1 {
- type union {
- type uint8;
- type decimal64 {
- fraction-digits 2;
- }
- }
- }
-
- typedef tpdfun0 {
- type enumeration {
- enum "successful exit" {
- value 1;
- }
- enum "grace period expired" {
- value 2;
- }
- }
- }
-
- container cont {
- leaf lfnint8Min {
- type int8;
- }
- leaf lfnint8Max {
- type int8;
- }
- leaf lfnint16Min {
- type int16;
- }
- leaf lfnint16Max {
- type int16;
- }
- leaf lfnint32Min {
- type int32;
- }
- leaf lfnint32Max {
- type int32;
- }
- leaf lfnint64Min {
- type int64;
- }
- leaf lfnint64Max {
- type int64;
- }
- leaf lfnuint8Max {
- type uint8;
- }
- leaf lfnuint16Max {
- type uint16;
- }
- leaf lfnuint32Max {
- type uint32;
- }
- leaf lfuint64Max {
- type uint64;
- }
- leaf lfstr {
- type string;
- }
- leaf lfstr1 {
- type string;
- }
- leaf lfbool1 {
- type boolean;
- }
- leaf lfbool2 {
- type boolean;
- }
- leaf lfbool3 {
- type boolean;
- }
- leaf lfdecimal1 {
- type decimal64 {
- fraction-digits 1;
- }
- }
- leaf lfdecimal2 {
- type decimal64 {
- fraction-digits 2;
- }
- }
- leaf lfdecimal3 {
- type decimal64 {
- fraction-digits 3;
- }
- }
-
- leaf lfdecimal4 {
- type decimal64 {
- fraction-digits 4;
- }
- }
-
- leaf lfdecimal6 {
- type decimal64 {
- fraction-digits 6;
- }
- }
-
- leaf lfenum {
- type enumeration {
- enum enum1;
- enum enum2;
- enum enum3;
- enum enum4;
- }
+ revision 2013-11-12 {
}
- leaf lfbits {
- type bits {
- bit bit1;
- bit bit2;
- bit bit3;
- bit bit4;
- }
+ identity iden {
}
- leaf lfbinary {
- type binary;
- }
-
- leaf lfref1 { //reference to string type
- type leafref {
- path "../lfstr";
- }
+ identity val {
+ base iden;
}
- leaf lfref2 { //reference to number type
- type leafref {
- path "../lfnint8Max";
- }
+ identity pro {
+ base iden;
}
- leaf lfempty {
+ typedef tpdfempty {
type empty;
}
- leaf lfunion1 {
- type union {
- type uint16;
- type string;
+ typedef tpdfbit {
+ type bits {
+ bit b1;
+ bit b2;
+ bit b3;
}
}
- leaf lfunion2 {
+
+ typedef tpdfun4 {
+ type boolean;
+ }
+
+ typedef tpdfun3 {
type union {
+ type tpdfbit;
+ type tpdfempty;
+ }
+ }
+
+ typedef tpdfun2 {
+ type union {
+ type tpdfun3;
+ type tpdfun4;
+ }
+ }
+
+ typedef tpdfun1 {
+ type union {
+ type uint8;
type decimal64 {
fraction-digits 2;
}
- type string;
}
}
- leaf lfunion4 {
- type union {
- type boolean;
- type string;
- }
- }
-
- leaf lfunion5 {
- type union {
- type uint16;
- type string;
- }
- }
-
- leaf lfunion7 {
- type tpdfun3;
- }
-
- leaf lfunion8 {
- type union {
- type uint16;
- type string;
- }
- }
-
- leaf lfunion9 {
- type union {
- type uint16;
- type boolean;
- }
- }
-
- leaf lfunion10 {
- type union {
- type bits {
- bit bt1;
- bit bt2;
+ typedef tpdfun0 {
+ type enumeration {
+ enum "successful exit" {
+ value 1;
}
- type boolean;
+ enum "grace period expired" {
+ value 2;
+ }
}
}
- leaf lfunion11 {
- type union {
- type tpdfun1;
+ container cont {
+ leaf lfnint8Min {
+ type int8;
+ }
+
+ leaf lfnint8Max {
+ type int8;
+ }
+
+ leaf lfnint16Min {
+ type int16;
+ }
+
+ leaf lfnint16Max {
+ type int16;
+ }
+
+ leaf lfnint32Min {
+ type int32;
+ }
+
+ leaf lfnint32Max {
+ type int32;
+ }
+
+ leaf lfnint64Min {
+ type int64;
+ }
+
+ leaf lfnint64Max {
+ type int64;
+ }
+
+ leaf lfnuint8Max {
+ type uint8;
+ }
+
+ leaf lfnuint16Max {
+ type uint16;
+ }
+
+ leaf lfnuint32Max {
+ type uint32;
+ }
+
+ leaf lfuint64Max {
+ type uint64;
+ }
+
+ leaf lfstr {
+ type string;
+ }
+
+ leaf lfstr1 {
+ type string;
+ }
+
+ leaf lfbool1 {
+ type boolean;
+ }
+
+ leaf lfbool2 {
+ type boolean;
+ }
+
+ leaf lfbool3 {
+ type boolean;
+ }
+
+ leaf lfdecimal1 {
+ type decimal64 {
+ fraction-digits 1;
+ }
+ }
+
+ leaf lfdecimal2 {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+
+ leaf lfdecimal3 {
+ type decimal64 {
+ fraction-digits 3;
+ }
+ }
+
+ leaf lfdecimal4 {
+ type decimal64 {
+ fraction-digits 4;
+ }
+ }
+
+ leaf lfdecimal6 {
+ type decimal64 {
+ fraction-digits 6;
+ }
+ }
+
+ leaf lfenum {
+ type enumeration {
+ enum enum1;
+ enum enum2;
+ enum enum3;
+ enum enum4;
+ }
+ }
+
+ leaf lfbits {
+ type bits {
+ bit bit1;
+ bit bit2;
+ bit bit3;
+ bit bit4;
+ }
+ }
+
+ leaf lfbinary {
+ type binary;
+ }
+
+ leaf lfref1 { //reference to string type
+ type leafref {
+ path "../lfstr";
+ }
+ }
+
+ leaf lfref2 { //reference to number type
+ type leafref {
+ path "../lfnint8Max";
+ }
+ }
+
+ leaf lfempty {
+ type empty;
+ }
+
+ leaf lfunion1 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+ leaf lfunion2 {
+ type union {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ type string;
+ }
+ }
+
+ leaf lfunion4 {
+ type union {
+ type boolean;
+ type string;
+ }
+ }
+
+ leaf lfunion5 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+
+ leaf lfunion7 {
+ type tpdfun3;
+ }
+
+ leaf lfunion8 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+
+ leaf lfunion9 {
+ type union {
+ type uint16;
+ type boolean;
+ }
+ }
+
+ leaf lfunion10 {
+ type union {
+ type bits {
+ bit bt1;
+ bit bt2;
+ }
+ type boolean;
+ }
+ }
+
+ leaf lfunion11 {
+ type union {
+ type tpdfun1;
+ type tpdfun2;
+ }
+ }
+
+ leaf lfunion12 {
type tpdfun2;
}
- }
- leaf lfunion12 {
- type tpdfun2;
- }
+ leaf lfunion13 {
+ type tpdfbit;
+ }
- leaf lfunion13 {
- type tpdfbit;
- }
-
- leaf lfunion14 {
- type union {
- type enumeration {
- enum zero;
- enum one;
+ leaf lfunion14 {
+ type union {
+ type enumeration {
+ enum zero;
+ enum one;
+ }
+ type uint16;
}
- type uint16;
+ }
+
+ leaf identityref1 {
+ type identityref {
+ base iden;
+ }
+ }
+
+ leaf lfenum1 {
+ type tpdfun0;
+ }
+
+ leaf inst-iden {
+ type instance-identifier;
+ }
+
+ leaf lref1 {
+ type leafref {
+ path "../lfnint8Min";
+ }
+ }
+
+ leaf lref2 {
+ type leafref {
+ path "../identityref1";
+ }
+ }
+
+ leaf lref3 {
+ type leafref {
+ path "../lfunion14";
+ }
+ }
+
+ leaf lref4 {
+ type leafref {
+ path "../lfunion13";
+ }
+ }
+
+ leaf lref5 {
+ type leafref {
+ path "../lfunion11";
+ }
+ }
+
+ leaf lref6 {
+ type leafref {
+ path "../lfref2";
+ }
+ }
+
+ leaf lref7 {
+ type leafref {
+ path "../lfenum";
+ }
+ }
+
+ leaf lref8 {
+ type leafref {
+ path "../lfdecimal6";
+ }
+ }
+
+ leaf lref9 {
+ type leafref {
+ path "/ytb:leaf12";
+ }
+ }
+
+ leaf lref10 {
+ type leafref {
+ path "/ytb:leaf11";
+ }
+ }
+
+ leaf lref11 {
+ type leafref {
+ path "/ytb:leaf10";
+ }
+ }
+
+ leaf lref12 {
+ type leafref {
+ path "/ytb:leaf9";
+ }
+ }
+
+ leaf lref13 {
+ type leafref {
+ path "/ytb:leaf8";
+ }
+ }
+
+ leaf lref14 {
+ type leafref {
+ path "/ytb:leaf7";
+ }
+ }
+
+ leaf lref15 {
+ type leafref {
+ path "/ytb:leaf6";
+ }
+ }
+
+ leaf lref16 {
+ type leafref {
+ path "/ytb:leaf5";
+ }
+ }
+
+ leaf lref17 {
+ type leafref {
+ path "/ytb:leaf4";
+ }
+ }
+
+ leaf lref18 {
+ type leafref {
+ path "/ytb:leaf3";
+ }
+ }
+
+ leaf lref19 {
+ type leafref {
+ path "/ytb:leaf2";
+ }
+ }
+
+ leaf lref20 {
+ type leafref {
+ path "/ytb:leaf1";
+ }
+ }
+
+ leaf iref1 {
+ type identityref {
+ base iden;
+ }
+ }
+
+ leaf-list iref2 {
+ type identityref {
+ base iden;
+ }
+ }
+
+ leaf iref3 {
+ type identityref {
+ base ytb:type;
+ }
+ }
+
+ leaf-list iref4 {
+ type identityref {
+ base ytb:type;
+ }
+ }
+
+ uses gr;
+ }
+
+ grouping gr {
+ container cont3 {
+ leaf-list llref1 {
+ type leafref {
+ path "../../lfnint8Min";
+ }
+ }
+
+ leaf-list llref2 {
+ type leafref {
+ path "../../identityref1";
+ }
+ }
+
+ leaf-list llref3 {
+ type leafref {
+ path "../../lfunion14";
+ }
+ }
+
+ leaf-list llref4 {
+ type leafref {
+ path "../../lfunion13";
+ }
+ }
+
+ leaf-list llref5 {
+ type leafref {
+ path "../../lfunion11";
+ }
+ }
+
+ leaf-list llref6 {
+ type leafref {
+ path "../../lfref2";
+ }
+ }
+
+ leaf-list llref7 {
+ type leafref {
+ path "../../lfenum";
+ }
+ }
+
+ leaf-list llref8 {
+ type leafref {
+ path "../../lfdecimal6";
+ }
+ }
+
+ leaf-list llref9 {
+ type leafref {
+ path "/ytb:leaf12";
+ }
+ }
+
+ leaf-list llref10 {
+ type leafref {
+ path "/ytb:leaf11";
+ }
+ }
+
+ leaf-list llref11 {
+ type leafref {
+ path "/ytb:leaf10";
+ }
+ }
+
+ leaf-list llref12 {
+ type leafref {
+ path "/ytb:leaf9";
+ }
+ }
+
+ leaf-list llref13 {
+ type leafref {
+ path "/ytb:leaf8";
+ }
+ }
+
+ leaf-list llref14 {
+ type leafref {
+ path "/ytb:leaf7";
+ }
+ }
+
+ leaf-list llref15 {
+ type leafref {
+ path "/ytb:leaf6";
+ }
+ }
+
+ leaf-list llref16 {
+ type leafref {
+ path "/ytb:leaf5";
+ }
+ }
+
+ leaf-list llref17 {
+ type leafref {
+ path "/ytb:leaf4";
+ }
+ }
+
+ leaf-list llref18 {
+ type leafref {
+ path "/ytb:leaf3";
+ }
+ }
+
+ leaf-list llref19 {
+ type leafref {
+ path "/ytb:leaf2";
+ }
+ }
+
+ leaf-list llref20 {
+ type leafref {
+ path "/ytb:leaf1";
+ }
+ }
+
+ leaf lref21 {
+ type leafref {
+ path "/ytb:leaf1";
+ }
+ }
+
+ leaf iref1 {
+ type identityref {
+ base iden;
+ }
+ }
+
+ leaf-list iref2 {
+ type identityref {
+ base iden;
+ }
+ }
+
+ leaf iref3 {
+ type identityref {
+ base ytb:type;
+ }
+ }
+
+ leaf-list iref4 {
+ type identityref {
+ base ytb:type;
+ }
+ }
}
}
-
- leaf identityref1 {
- type identityref {
- base iden;
- }
- }
-
- leaf lfenum1 {
- type tpdfun0;
- }
-
- leaf inst-iden {
- type instance-identifier;
- }
- }
}