YANG sub module linking + unsupported yang construct + defect fix
Change-Id: I224c8c14ee2111f6844278cb540c48651544f59b
diff --git a/src/test/resources/AnyxmlStatement.yang b/src/test/resources/AnyxmlStatement.yang
new file mode 100644
index 0000000..4b1e421
--- /dev/null
+++ b/src/test/resources/AnyxmlStatement.yang
@@ -0,0 +1,16 @@
+module event {
+
+ namespace "http://example.com/event";
+ prefix "ev";
+
+ notification event {
+ leaf event-class {
+ type string;
+ }
+ anyxml reporting-entity;
+ leaf severity {
+ type string;
+ }
+ }
+}
+
diff --git a/src/test/resources/ChoiceSubStatementDefault.yang b/src/test/resources/ChoiceSubStatementDefault.yang
new file mode 100644
index 0000000..b9fd60d
--- /dev/null
+++ b/src/test/resources/ChoiceSubStatementDefault.yang
@@ -0,0 +1,23 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ container food {
+ choice snack {
+ case sports-arena {
+ leaf pretzel {
+ type string;
+ }
+ leaf beer {
+ type string;
+ }
+ }
+ case late-night {
+ leaf chocolate {
+ type string;
+ }
+ }
+ default "hello";
+ }
+ }
+}
diff --git a/src/test/resources/EnumBoundaryValue.yang b/src/test/resources/EnumBoundaryValue.yang
new file mode 100644
index 0000000..ac87ef0
--- /dev/null
+++ b/src/test/resources/EnumBoundaryValue.yang
@@ -0,0 +1,16 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf ifType {
+ type enumeration {
+ enum "unbounded";
+ enum ZERO;
+ enum two;
+ enum four;
+ enum seven {
+ value 21474836472147483647;
+ }
+ }
+ }
+}
diff --git a/src/test/resources/EnumMaxNextValue.yang b/src/test/resources/EnumMaxNextValue.yang
new file mode 100644
index 0000000..4e4a373
--- /dev/null
+++ b/src/test/resources/EnumMaxNextValue.yang
@@ -0,0 +1,18 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf ifType {
+ type enumeration {
+ enum "unbounded";
+ enum ZERO;
+ enum two;
+ enum four;
+ enum seven {
+ value 2147483647;
+ }
+ enum five;
+
+ }
+ }
+}
diff --git a/src/test/resources/KeyWithUsesInList.yang b/src/test/resources/KeyWithUsesInList.yang
new file mode 100644
index 0000000..d076d0a
--- /dev/null
+++ b/src/test/resources/KeyWithUsesInList.yang
@@ -0,0 +1,23 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ grouping network {
+ leaf invalid-interval {
+ type "string";
+ units "seconds";
+ status current;
+ reference "RFC 6020";
+ }
+ }
+ list valid {
+ key "invalid-interval";
+ leaf invalid {
+ type "string";
+ units "seconds";
+ status current;
+ reference "RFC 6020";
+ }
+ uses "network";
+ }
+}
diff --git a/src/test/resources/LeafSubStatementDefault.yang b/src/test/resources/LeafSubStatementDefault.yang
new file mode 100644
index 0000000..a78131d
--- /dev/null
+++ b/src/test/resources/LeafSubStatementDefault.yang
@@ -0,0 +1,15 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf invalid-interval {
+ type "uint16";
+ units "seconds";
+ default "1";
+ description "Interval before a route is declared invalid";
+ config true;
+ mandatory true;
+ status current;
+ reference "RFC 6020";
+ }
+}
diff --git a/src/test/resources/LengthSubStatements.yang b/src/test/resources/LengthSubStatements.yang
new file mode 100644
index 0000000..f61f979
--- /dev/null
+++ b/src/test/resources/LengthSubStatements.yang
@@ -0,0 +1,13 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf invalid-interval {
+ type string {
+ length "0..100" {
+ description "length description";
+ reference "length reference";
+ }
+ }
+ }
+}
diff --git a/src/test/resources/OrderedByStatement.yang b/src/test/resources/OrderedByStatement.yang
new file mode 100644
index 0000000..f6b4336
--- /dev/null
+++ b/src/test/resources/OrderedByStatement.yang
@@ -0,0 +1,10 @@
+module rock {
+ namespace "http://example.net/rock";
+ prefix "rock";
+ leaf-list cipher {
+ type string;
+ ordered-by user;
+ description "A list of ciphers";
+ }
+}
+
diff --git a/src/test/resources/PatternSubStatements.yang b/src/test/resources/PatternSubStatements.yang
new file mode 100644
index 0000000..3e792c6
--- /dev/null
+++ b/src/test/resources/PatternSubStatements.yang
@@ -0,0 +1,13 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf invalid-interval {
+ type string {
+ pattern "[a-zA-Z]" {
+ description "pattern description";
+ reference "pattern reference";
+ }
+ }
+ }
+}
diff --git a/src/test/resources/RangeSubStatements.yang b/src/test/resources/RangeSubStatements.yang
new file mode 100644
index 0000000..4b57bd0
--- /dev/null
+++ b/src/test/resources/RangeSubStatements.yang
@@ -0,0 +1,14 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf invalid-interval {
+ type int32 {
+ range "1..4 | 10..20" {
+ description "range description";
+ reference "range reference";
+ }
+ }
+ }
+}
+
diff --git a/src/test/resources/ValidAugmentStatement.yang b/src/test/resources/ValidAugmentStatement.yang
index 6175c35..f6c247e 100644
--- a/src/test/resources/ValidAugmentStatement.yang
+++ b/src/test/resources/ValidAugmentStatement.yang
@@ -10,7 +10,6 @@
prefix "P";
}
augment "/if:interfaces/if:ifEntry" {
- when "if:ifType='ds0'";
leaf ds0ChannelNumber {
type P:ChannelNumber;
}
diff --git a/src/test/resources/ValidNotificationStatement.yang b/src/test/resources/ValidNotificationStatement.yang
index 072df23..7e6bc17 100644
--- a/src/test/resources/ValidNotificationStatement.yang
+++ b/src/test/resources/ValidNotificationStatement.yang
@@ -14,9 +14,7 @@
type int32;
}
leaf if-name {
- type leafref {
- path "/interface/name";
- }
+ type leafref;
}
leaf if-admin-status {
type P:admin-status;
diff --git a/src/test/resources/ValueStatementWithNegativeValue.yang b/src/test/resources/ValueStatementWithNegativeValue.yang
new file mode 100644
index 0000000..a3f236b
--- /dev/null
+++ b/src/test/resources/ValueStatementWithNegativeValue.yang
@@ -0,0 +1,18 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf speed {
+ type enumeration {
+ enum 10m {
+ value -2;
+ }
+ enum 100m {
+ value "-1";
+ }
+ enum auto {
+ value 0;
+ }
+ }
+ }
+}
diff --git a/src/test/resources/ValueStatementWithQuotes.yang b/src/test/resources/ValueStatementWithQuotes.yang
new file mode 100644
index 0000000..e166ca4
--- /dev/null
+++ b/src/test/resources/ValueStatementWithQuotes.yang
@@ -0,0 +1,18 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf speed {
+ type enumeration {
+ enum 10m {
+ value "10";
+ }
+ enum 100m {
+ value "100";
+ }
+ enum auto {
+ value "1000";
+ }
+ }
+ }
+}