[ONOS-6960] Identity referred in sub-module of imported module.
Change-Id: I66bef7b5eec5859c94ecd0ced9bf139a32fa70f0
diff --git a/compiler/plugin/maven/src/test/resources/identityinsubmod/module1.yang b/compiler/plugin/maven/src/test/resources/identityinsubmod/module1.yang
new file mode 100644
index 0000000..8dbcd30
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/identityinsubmod/module1.yang
@@ -0,0 +1,16 @@
+module module1 {
+
+ namespace "urn:ietf:params:xml:ns:aug:module:1";
+
+ prefix mod-a;
+
+ import module2 {
+ prefix mod2;
+ }
+
+ leaf name {
+ type identityref {
+ base mod2:BGP_ERROR_CODE;
+ }
+ }
+}
diff --git a/compiler/plugin/maven/src/test/resources/identityinsubmod/module2.yang b/compiler/plugin/maven/src/test/resources/identityinsubmod/module2.yang
new file mode 100644
index 0000000..5a2d85d
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/identityinsubmod/module2.yang
@@ -0,0 +1,8 @@
+module module2 {
+
+ namespace "urn:ietf:params:xml:ns:aug:module:2";
+
+ prefix mod-b;
+
+ include submodule2;
+}
diff --git a/compiler/plugin/maven/src/test/resources/identityinsubmod/submodule.yang b/compiler/plugin/maven/src/test/resources/identityinsubmod/submodule.yang
new file mode 100644
index 0000000..b6b8b10
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/identityinsubmod/submodule.yang
@@ -0,0 +1,9 @@
+submodule submodule2 {
+
+ belongs-to module2 {
+ prefix mod2;
+ }
+
+ identity BGP_ERROR_CODE {
+ }
+}