Add binding v2 model for testing identifier namespaces 97/36997/3
authorVratko Polak <vrpolak@cisco.com>
Fri, 1 Apr 2016 10:05:04 +0000 (12:05 +0200)
committerRobert Varga <nite@hq.sk>
Fri, 20 May 2016 20:39:20 +0000 (20:39 +0000)
Just a Yang file, no actual unit test.

Change-Id: I94ec9dca335a81b55b2aa23764bec6ea100ac7a4
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
binding/mdsal-binding-spec-2/src/test/resources/odl-test-namespaces.yang [new file with mode: 0644]

diff --git a/binding/mdsal-binding-spec-2/src/test/resources/odl-test-namespaces.yang b/binding/mdsal-binding-spec-2/src/test/resources/odl-test-namespaces.yang
new file mode 100644 (file)
index 0000000..9fd4d50
--- /dev/null
@@ -0,0 +1,78 @@
+module odl-test-namespaces {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:mdsal:binding2:test:namespaces";
+    prefix "otn";
+
+    description
+        "Testing for the same identifier in different namespaces.
+        see http://tools.ietf.org/html/rfc6020#section-6.2.1
+
+        All module and submodule names share the same global module
+        identifier namespace.";
+
+    revision "2016-03-31" {
+        description
+            "Initial revision, for ODL Boron.";
+    }
+
+    extension odl-test-namespaces {
+        description
+            "All extension names defined in a module and its submodules share
+            the same extension identifier namespace.";
+    }
+
+    feature odl-test-namespaces {
+        description
+            "All feature names defined in a module and its submodules share the
+            same feature identifier namespace.";
+    }
+
+    identity odl-test-namespaces {
+        description
+            "All identity names defined in a module and its submodules share
+            the same identity identifier namespace.";
+    }
+
+    typedef odl-test-namespaces {
+        description
+            "All derived type names defined within a parent node or at the top
+            level of the module or its submodules share the same type
+            identifier namespace.";
+        type string;
+    }
+
+    grouping odl-test-namespaces {
+        description
+            "All grouping names defined within a parent node or at the top
+            level of the module or its submodules share the same grouping
+            identifier namespace.";
+        leaf odl-test-namespaces {
+            description
+                "This namespace is scoped to the parent node or module, unless the
+                parent node is a case node.  In that case, the namespace is scoped
+                to the closest ancestor node that is not a case or choice node.";
+            type odl-test-namespaces;
+        }
+    }
+
+    container odl-test-namespaces {
+        description
+            "All leafs, leaf-lists, lists, containers, choices, rpcs, actions,
+            notifications, anydatas, and anyxmls defined (directly or through
+            a uses statement) within a parent node or at the top level of the
+            module or its submodules share the same identifier namespace.";
+        choice nonconflict-identifier {
+            description
+                "The leaf from grouping would end up scoped under container,
+                so the choice has to have a different identifier.";
+            case odl-test-namespaces {
+                description
+                    "All cases within a choice share the same case identifier
+                    namespace.  This namespace is scoped to the parent choice node.";
+                uses odl-test-namespaces;
+                // See descriptions of leaf and choice.
+            }
+        }
+    }
+
+}