[ONOS-4063 to 68] Intra YANG file Linking Implementation and Intra YANG file Linking Framework
Change-Id: I06e602c351ab54178bf90b8676af71a70e42371f
diff --git a/src/test/resources/DerivedTypeStatement.yang b/src/test/resources/DerivedTypeStatement.yang
index c678822..952b7d4 100644
--- a/src/test/resources/DerivedTypeStatement.yang
+++ b/src/test/resources/DerivedTypeStatement.yang
@@ -3,6 +3,6 @@
namespace http://huawei.com;
prefix Ant;
leaf invalid-interval {
- type "hello";
+ type P:hello;
}
-}
\ No newline at end of file
+}
diff --git a/src/test/resources/GroupingAttributes.yang b/src/test/resources/GroupingAttributes.yang
index 7eb3880..977adc5 100644
--- a/src/test/resources/GroupingAttributes.yang
+++ b/src/test/resources/GroupingAttributes.yang
@@ -5,17 +5,17 @@
list valid {
key address;
leaf address {
- type ip;
+ type P:ip;
}
grouping endpoint {
description "grouping under test";
status current;
reference "RFC 6020";
leaf address {
- type ip-address;
+ type P:ip-address;
}
leaf port {
- type port-number;
+ type P:port-number;
}
}
}
diff --git a/src/test/resources/GroupingInContainer.yang b/src/test/resources/GroupingInContainer.yang
index be9e7e8..7c51913 100644
--- a/src/test/resources/GroupingInContainer.yang
+++ b/src/test/resources/GroupingInContainer.yang
@@ -5,10 +5,10 @@
container valid {
grouping endpoint {
leaf address {
- type ip-address;
+ type P:ip-address;
}
leaf port {
- type port-number;
+ type P:port-number;
}
}
}
diff --git a/src/test/resources/GroupingInList.yang b/src/test/resources/GroupingInList.yang
index 2cdf7d1..a8fad09 100644
--- a/src/test/resources/GroupingInList.yang
+++ b/src/test/resources/GroupingInList.yang
@@ -5,14 +5,14 @@
list valid {
key address;
leaf address {
- type ip;
+ type P:ip;
}
grouping endpoint {
leaf address {
- type ip-address;
+ type P:ip-address;
}
leaf port {
- type port-number;
+ type P:port-number;
}
}
}
diff --git a/src/test/resources/GroupingInModule.yang b/src/test/resources/GroupingInModule.yang
index d0a31c1..7d513a4 100644
--- a/src/test/resources/GroupingInModule.yang
+++ b/src/test/resources/GroupingInModule.yang
@@ -4,10 +4,10 @@
prefix Ant;
grouping endpoint {
leaf address {
- type ip-address;
+ type P:ip-address;
}
leaf port {
- type port-number;
+ type P:port-number;
}
}
}
diff --git a/src/test/resources/SelfFileLinkingTypedefAtMiddleLevelAfterParentHolder.yang b/src/test/resources/SelfFileLinkingTypedefAtMiddleLevelAfterParentHolder.yang
new file mode 100644
index 0000000..c372bfa
--- /dev/null
+++ b/src/test/resources/SelfFileLinkingTypedefAtMiddleLevelAfterParentHolder.yang
@@ -0,0 +1,16 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ container ospf {
+ list valid {
+ key "invalid-interval";
+ leaf invalid-interval {
+ type hello;
+ }
+ }
+ typedef hello {
+ type String;
+ }
+ }
+}
diff --git a/src/test/resources/SelfFileLinkingTypedefAtRootIsAfterContainerHavingType.yang b/src/test/resources/SelfFileLinkingTypedefAtRootIsAfterContainerHavingType.yang
new file mode 100644
index 0000000..052cb7e
--- /dev/null
+++ b/src/test/resources/SelfFileLinkingTypedefAtRootIsAfterContainerHavingType.yang
@@ -0,0 +1,16 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ container ospf {
+ list valid {
+ key "invalid-interval";
+ leaf invalid-interval {
+ type hello;
+ }
+ }
+ }
+ typedef hello {
+ type String;
+ }
+}
diff --git a/src/test/resources/SelfFileLinkingTypedefAtRootTypeTwoLevelInHierarchy.yang b/src/test/resources/SelfFileLinkingTypedefAtRootTypeTwoLevelInHierarchy.yang
new file mode 100644
index 0000000..2b4a1e8
--- /dev/null
+++ b/src/test/resources/SelfFileLinkingTypedefAtRootTypeTwoLevelInHierarchy.yang
@@ -0,0 +1,16 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ typedef hello {
+ type String;
+ }
+ container ospf {
+ list valid {
+ key "invalid-interval";
+ leaf invalid-interval {
+ type hello;
+ }
+ }
+ }
+}
diff --git a/src/test/resources/SelfFileLinkingTypedefNotFound.yang b/src/test/resources/SelfFileLinkingTypedefNotFound.yang
new file mode 100644
index 0000000..9248598
--- /dev/null
+++ b/src/test/resources/SelfFileLinkingTypedefNotFound.yang
@@ -0,0 +1,18 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ container ospf {
+ list valid {
+ key "invalid-interval";
+ leaf invalid-interval {
+ type hello;
+ }
+ }
+ }
+ container isis {
+ typedef hello {
+ type String;
+ }
+ }
+}
diff --git a/src/test/resources/SelfFileLinkingWithHierarchicalTypeFailureScenario.yang b/src/test/resources/SelfFileLinkingWithHierarchicalTypeFailureScenario.yang
new file mode 100644
index 0000000..71d1947
--- /dev/null
+++ b/src/test/resources/SelfFileLinkingWithHierarchicalTypeFailureScenario.yang
@@ -0,0 +1,22 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ typedef Percentage {
+ type INT;
+ }
+ container ospf {
+ list valid {
+ key "invalid-interval";
+ leaf invalid-interval {
+ type Ant:FirstClass;
+ }
+ typedef FirstClass {
+ type Ant:PassingClass;
+ }
+ }
+ typedef PassingClass {
+ type Percentage;
+ }
+ }
+}
diff --git a/src/test/resources/SelfFileLinkingWithTypdefHierarchicalRefUnresolved.yang b/src/test/resources/SelfFileLinkingWithTypdefHierarchicalRefUnresolved.yang
new file mode 100644
index 0000000..35c28b6
--- /dev/null
+++ b/src/test/resources/SelfFileLinkingWithTypdefHierarchicalRefUnresolved.yang
@@ -0,0 +1,22 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ typedef Percentage {
+ type P:Per;
+ }
+ container ospf {
+ list valid {
+ key "invalid-interval";
+ leaf invalid-interval {
+ type FirstClass;
+ }
+ typedef FirstClass {
+ type PassingClass;
+ }
+ }
+ typedef PassingClass {
+ type Percentage;
+ }
+ }
+}
diff --git a/src/test/resources/SelfFileLinkingWithTypdefHierarchicalReference.yang b/src/test/resources/SelfFileLinkingWithTypdefHierarchicalReference.yang
new file mode 100644
index 0000000..958dc23
--- /dev/null
+++ b/src/test/resources/SelfFileLinkingWithTypdefHierarchicalReference.yang
@@ -0,0 +1,22 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ typedef Percentage {
+ type int32;
+ }
+ container ospf {
+ list valid {
+ key "invalid-interval";
+ leaf invalid-interval {
+ type FirstClass;
+ }
+ typedef FirstClass {
+ type PassingClass;
+ }
+ }
+ typedef PassingClass {
+ type Percentage;
+ }
+ }
+}
diff --git a/src/test/resources/SelfFileLinkingWithTypeWithSelfAndExternalPrefixMix.yang b/src/test/resources/SelfFileLinkingWithTypeWithSelfAndExternalPrefixMix.yang
new file mode 100644
index 0000000..038c7de
--- /dev/null
+++ b/src/test/resources/SelfFileLinkingWithTypeWithSelfAndExternalPrefixMix.yang
@@ -0,0 +1,22 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ typedef Percentage {
+ type int32;
+ }
+ container ospf {
+ list valid {
+ key "invalid-interval";
+ leaf invalid-interval {
+ type Ant:FirstClass;
+ }
+ typedef FirstClass {
+ type P:PassingClass;
+ }
+ }
+ typedef PassingClass {
+ type Ant:Percentage;
+ }
+ }
+}
diff --git a/src/test/resources/SelfFileLinkingWithTypeWithSelfModulePrefix.yang b/src/test/resources/SelfFileLinkingWithTypeWithSelfModulePrefix.yang
new file mode 100644
index 0000000..4f292b8
--- /dev/null
+++ b/src/test/resources/SelfFileLinkingWithTypeWithSelfModulePrefix.yang
@@ -0,0 +1,22 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ typedef Percentage {
+ type int32;
+ }
+ container ospf {
+ list valid {
+ key "invalid-interval";
+ leaf invalid-interval {
+ type Ant:FirstClass;
+ }
+ typedef FirstClass {
+ type PassingClass;
+ }
+ }
+ typedef PassingClass {
+ type Ant:Percentage;
+ }
+ }
+}
diff --git a/src/test/resources/SelfResolutionWhenTypeAndTypedefAtRootLevel.yang b/src/test/resources/SelfResolutionWhenTypeAndTypedefAtRootLevel.yang
new file mode 100644
index 0000000..b6b08a7
--- /dev/null
+++ b/src/test/resources/SelfResolutionWhenTypeAndTypedefAtRootLevel.yang
@@ -0,0 +1,11 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf invalid-interval {
+ type hello;
+ }
+ typedef hello {
+ type String;
+ }
+}
diff --git a/src/test/resources/SelfResolutionWhenTypeReferredTypedefNotDefined.yang b/src/test/resources/SelfResolutionWhenTypeReferredTypedefNotDefined.yang
new file mode 100644
index 0000000..499e10d
--- /dev/null
+++ b/src/test/resources/SelfResolutionWhenTypeReferredTypedefNotDefined.yang
@@ -0,0 +1,11 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ leaf invalid-interval {
+ type hello;
+ }
+ typedef hi {
+ type String;
+ }
+}
diff --git a/src/test/resources/UsesInList.yang b/src/test/resources/UsesInList.yang
index 6443cfa..c4fd47d 100644
--- a/src/test/resources/UsesInList.yang
+++ b/src/test/resources/UsesInList.yang
@@ -5,7 +5,7 @@
list valid {
key address;
leaf address {
- type ip;
+ type P:ip;
}
uses endpoint {
description "grouping under test";
diff --git a/src/test/resources/ValidNotificationStatement.yang b/src/test/resources/ValidNotificationStatement.yang
index b96fc54..d588bb9 100644
--- a/src/test/resources/ValidNotificationStatement.yang
+++ b/src/test/resources/ValidNotificationStatement.yang
@@ -16,10 +16,10 @@
}
}
leaf if-admin-status {
- type admin-status;
+ type P:admin-status;
}
leaf if-oper-status {
- type oper-status;
+ type P:oper-status;
}
}
}
diff --git a/src/test/resources/processTypeDef.yang b/src/test/resources/processTypeDef.yang
new file mode 100644
index 0000000..2875752
--- /dev/null
+++ b/src/test/resources/processTypeDef.yang
@@ -0,0 +1,11 @@
+module Test {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ typedef hello {
+ type String;
+ }
+ leaf invalid-interval {
+ type hello;
+ }
+}