Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: Ibe3772d09e651a0f29751075d3b62b5bf128ba7e
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
@BeforeClass
public static void beforeClass() throws Exception {
- SCHEMA_CONTEXT = YangParserTestUtils.parseYangResource("/test-anydata.yang");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module test-anydata {
+ yang-version 1.1;
+ namespace test-anydata;
+ prefix ta;
+
+ anydata foo;
+
+ container cont {
+ anydata cont-any;
+ leaf cont-leaf {
+ type string;
+ }
+ leaf empty-leaf {
+ type empty;
+ }
+ container bar {
+ leaf cont-leaf {
+ type string;
+ }
+ }
+ }
+
+ list lst {
+ leaf cont-leaf {
+ type string;
+ }
+ leaf-list my-leafs {
+ type string;
+ }
+ }
+ }""");
}
@AfterClass
public class Bug5396Test {
private static final QNameModule FOO = QNameModule.create(XMLNamespace.of("foo"), Revision.of("2016-03-22"));
- private final EffectiveModelContext schemaContext = YangParserTestUtils.parseYangResourceDirectory("/bug5396/yang");
+ private final EffectiveModelContext schemaContext = YangParserTestUtils.parseYang("""
+ module foo {
+ yang-version 1;
+ namespace "foo";
+ prefix "foo";
+
+ revision "2016-03-22" {
+ description "test";
+ }
+
+ container root {
+ leaf my-leaf {
+ type my-type;
+ }
+ }
+
+ typedef my-type {
+ type union {
+ type string {
+ pattern "dp[0-9]+o[0-9]+";
+ }
+ type string {
+ pattern "dp[0-9]+s[0-9]+(f[0-9]+)?(d[0-9]+)?";
+ }
+ type string {
+ pattern "dp[0-9]+(P[0-9]+)?p[0-9]{1,3}s[0-9]{1,3}(f[0-9]+)?(d[0-9]+)?";
+ }
+ type string {
+ pattern "dp[0-9]+p[0-9]+p[0-9]+";
+ }
+ }
+ }
+ }""");
@Test
public void test() throws Exception {
@Test
public void test() throws Exception {
- final EffectiveModelContext schemaContext = YangParserTestUtils.parseYangResource("/bug5446/yang/foo.yang");
+ final EffectiveModelContext schemaContext = YangParserTestUtils.parseYang("""
+ module foo {
+ yang-version 1;
+ namespace "foo";
+ prefix "foo";
+
+ revision "2015-11-05" {
+ }
+
+ typedef ipv4-address-binary {
+ type binary {
+ length "4";
+ }
+ }
+
+ typedef ipv6-address-binary {
+ type binary {
+ length "16";
+ }
+ }
+
+ typedef ip-address-binary {
+ type union {
+ type ipv4-address-binary;
+ type ipv6-address-binary;
+ }
+ }
+
+ container root {
+ leaf ip-address {
+ type ip-address-binary;
+ }
+ }
+ }""");
final Document doc = loadDocument("/bug5446/xml/foo.xml");
final ContainerNode docNode = createDocNode();
@Test
public void testInstanceIdentifierPathWithEmptyListKey() throws Exception {
- final var schemaContext = YangParserTestUtils.parseYangResource("/bug8083/yang/baz.yang");
+ final var schemaContext = YangParserTestUtils.parseYang("""
+ module baz {
+ namespace baz-ns;
+ prefix baz-prefix;
+
+ container top-cont {
+ list keyed-list {
+ key empty-key-leaf;
+ leaf empty-key-leaf {
+ type empty;
+ }
+ leaf regular-leaf {
+ type int32;
+ }
+ }
+ leaf iid-leaf {
+ type instance-identifier;
+ }
+ }
+ }""");
final InputStream resourceAsStream = Bug8083Test.class.getResourceAsStream("/bug8083/xml/baz.xml");
@Test
public void testInstanceIdentifierPathWithIdentityrefListKey() throws Exception {
- final var schemaContext = YangParserTestUtils.parseYangResource("/bug8083/yang/zab.yang");
+ final var schemaContext = YangParserTestUtils.parseYang("""
+ module zab {
+ namespace zab-ns;
+ prefix zab-prefix;
+
+ identity base-id;
+
+ identity derived-id {
+ base base-id;
+ }
+
+ container top-cont {
+ list keyed-list {
+ key identityref-key-leaf;
+ leaf identityref-key-leaf {
+ type identityref {
+ base base-id;
+ }
+ }
+ leaf regular-leaf {
+ type int32;
+ }
+ }
+ leaf iid-leaf {
+ type instance-identifier;
+ }
+ }
+ }""");
final var resourceAsStream = Bug8083Test.class.getResourceAsStream("/bug8083/xml/zab.xml");
@Test
public void testInstanceIdentifierPathWithInstanceIdentifierListKey() throws Exception {
- final var schemaContext = YangParserTestUtils.parseYangResource("/bug8083/yang/foobar.yang");
+ final var schemaContext = YangParserTestUtils.parseYang("""
+ module foobar {
+ namespace foobar-ns;
+ prefix foobar-prefix;
+
+ container top-cont {
+ list keyed-list {
+ key iid-key-leaf;
+ leaf iid-key-leaf {
+ type instance-identifier;
+ }
+ leaf regular-leaf {
+ type int32;
+ }
+ }
+ leaf iid-leaf {
+ type instance-identifier;
+ }
+ leaf leaf-b {
+ type int32;
+ }
+ }
+ }""");
final var resourceAsStream = Bug8083Test.class.getResourceAsStream("/bug8083/xml/foobar.xml");
final var reader = UntrustedXML.createXMLStreamReader(resourceAsStream);
@BeforeClass
public static void setup() {
- schemaContext = YangParserTestUtils.parseYangResource("/bug8675/foo.yang");
+ schemaContext = YangParserTestUtils.parseYang("""
+ module foo {
+ namespace foo;
+ prefix foo;
+ revision 2017-06-13;
+
+ list top-level-list {
+ key key-leaf;
+ leaf key-leaf {
+ type string;
+ }
+ leaf ordinary-leaf {
+ type string;
+ }
+
+ container cont-in-list {}
+
+ list inner-list {
+ key inner-key-leaf;
+ leaf inner-key-leaf {
+ type string;
+ }
+ leaf inner-ordinary-leaf {
+ type string;
+ }
+ }
+ }
+
+ container top-level-container {
+ container inner-container-1 {}
+ container inner-container-2 {}
+ }
+
+ anyxml top-level-anyxml;
+
+ leaf top-level-leaf {
+ type int32;
+ }
+
+ leaf-list top-level-leaf-list {
+ type int32;
+ }
+ }""");
}
@AfterClass
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = YangParserTestUtils.parseYangResource("/bug8745/foo.yang");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module foo {
+ namespace foo;
+ prefix foo;
+
+ container cont-with-attributes {
+ leaf leaf-with-attributes {
+ type string;
+ }
+ leaf-list leaf-list-with-attributes {
+ type string;
+ }
+ list list-with-attributes {
+ key list-key;
+ leaf list-key {
+ type string;
+ }
+ }
+ }
+ }""");
}
@AfterClass
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = YangParserTestUtils.parseYangResourceDirectory("/bug8803");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module bar {
+ namespace bar-ns;
+ prefix bar;
+
+ import foo {
+ prefix foo;
+ }
+
+ augment "/foo:top-cont/foo:keyed-list" {
+ leaf iid-leaf {
+ type instance-identifier;
+ }
+ }
+ }""", """
+ module baz {
+ namespace baz-ns;
+ prefix baz;
+
+ container top-cont {
+ list keyed-list {
+ key key-leaf;
+ leaf key-leaf {
+ type int32;
+ }
+ }
+ }
+ }""", """
+ module foo {
+ namespace foo-ns;
+ prefix foo;
+
+ container top-cont {
+ list keyed-list {
+ key key-leaf;
+ leaf key-leaf {
+ type int32;
+ }
+ }
+ }
+ }""");
}
@AfterClass
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = YangParserTestUtils.parseYangResourceDirectory("/dom-reader-test");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module bar {
+ namespace bar-ns;
+ prefix bar;
+
+ import foo {
+ prefix foo;
+ }
+
+ augment "/foo:top-cont/foo:keyed-list" {
+ leaf iid-leaf {
+ type instance-identifier;
+ }
+ }
+ }""", """
+ module baz {
+ namespace baz-ns;
+ prefix baz;
+
+ container top-cont {
+ /*list keyed-list {
+ key key-leaf;
+ leaf key-leaf {
+ type int32;
+ }
+ }*/
+ }
+ }""", """
+ module foo {
+ namespace foo-ns;
+ prefix foo;
+
+ import rab {
+ prefix rab;
+ }
+
+ container top-cont {
+ list keyed-list {
+ key key-leaf;
+ leaf key-leaf {
+ type int32;
+ }
+ leaf idref-leaf {
+ type identityref {
+ base rab:base-id;
+ }
+ }
+ leaf ordinary-leaf {
+ type int32;
+ }
+ }
+ }
+ }""", """
+ module rab {
+ namespace rab-ns;
+ prefix rab;
+
+ import baz {
+ prefix baz;
+ }
+
+ augment "/baz:top-cont" {
+ list keyed-list {
+ key key-leaf;
+ leaf key-leaf {
+ type int32;
+ }
+ }
+ }
+
+ identity base-id;
+
+ identity id-foo {
+ base base-id;
+ }
+ }""", """
+ module zab {
+ namespace zab-ns;
+ prefix zab;
+
+ import foo {
+ prefix foo;
+ }
+
+ augment "/foo:top-cont/foo:keyed-list/" {
+ /*leaf ordinary-leaf {
+ type int32;
+ }*/
+ anyxml aug-anyxml;
+ }
+ }""");
}
@AfterClass
final StringWriter stringWriter = new StringWriter();
final XMLStreamWriter xmlStreamWriter = factory.createXMLStreamWriter(stringWriter);
- EffectiveModelContext schemaContext = getSchemaContext("/bug1848/foo.yang");
+ EffectiveModelContext schemaContext = getSchemaContext("""
+ module foo {
+ namespace "foo";
+ prefix "foo";
+ revision "2016-02-17";
+
+ container root {
+ list policy {
+ key name;
+ leaf name {
+ type string;
+ }
+ list rule {
+ key name;
+ leaf name {
+ type string;
+ }
+ }
+ }
+ }
+ }""");
NormalizedNodeStreamWriter writer = XMLStreamNormalizedNodeStreamWriter.create(xmlStreamWriter, schemaContext);
try (SchemaOrderedNormalizedNodeWriter nnw = new SchemaOrderedNormalizedNodeWriter(writer, schemaContext)) {
public void testWriteOrder() throws XMLStreamException, IOException, SAXException {
final StringWriter stringWriter = new StringWriter();
final XMLStreamWriter xmlStreamWriter = factory.createXMLStreamWriter(stringWriter);
- EffectiveModelContext schemaContext = getSchemaContext("/bug1848/order.yang");
+ EffectiveModelContext schemaContext = getSchemaContext("""
+ module order {
+ namespace "order";
+ prefix "order";
+ revision "2016-02-17";
+
+ container root {
+ leaf id {
+ type string;
+ }
+ container cont {
+ leaf content {
+ type string;
+ }
+ }
+ }
+ }""");
NormalizedNodeStreamWriter writer = XMLStreamNormalizedNodeStreamWriter.create(xmlStreamWriter, schemaContext);
try (NormalizedNodeWriter nnw = new SchemaOrderedNormalizedNodeWriter(writer, schemaContext)) {
XMLAssert.assertXMLIdentical(new Diff(EXPECTED_2, stringWriter.toString()), true);
}
- private static EffectiveModelContext getSchemaContext(final String filePath) {
- return YangParserTestUtils.parseYangResource(filePath);
+ private static EffectiveModelContext getSchemaContext(final String literalYang) {
+ return YangParserTestUtils.parseYang(literalYang);
}
private static YangInstanceIdentifier.NodeIdentifier getNodeIdentifier(final String ns, final String name) {
@BeforeClass
public static void beforeClass() {
- schemaContext = YangParserTestUtils.parseYangResource("/strict-parsing-mode-test/foo.yang");
+ schemaContext = YangParserTestUtils.parseYang("""
+ module foo {
+ namespace foo;
+ prefix foo;
+
+ container top-level-container {
+ container inner-container {}
+ }
+ }""");
}
@AfterClass
@Test
public void testInterleavingLists() throws Exception {
- final var schemaContext = YangParserTestUtils.parseYangResource("/yt1107/yt1107.yang");
+ final var schemaContext = YangParserTestUtils.parseYang("""
+ module yt1107 {
+ namespace "yt1107";
+ prefix "yt1107";
+
+ container parent {
+ config true;
+ list user {
+ key name;
+ leaf name {
+ type string;
+ }
+ }
+ list admin {
+ key name;
+ leaf name {
+ type string;
+ }
+ }
+ }
+ }""");
final var resourceAsStream = XmlToNormalizedNodesTest.class.getResourceAsStream("/yt1107/yt1107.xml");
final var reader = UntrustedXML.createXMLStreamReader(resourceAsStream);
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = YangParserTestUtils.parseYangResource("/yt1108/yang/foo.yang");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module foo {
+ namespace "foo-namespace";
+ prefix "f";
+
+ identity ident-base;
+
+ identity ident-one {
+ base ident-base;
+ }
+
+ typedef union-type {
+ type union {
+ type uint8;
+ type identityref {
+ base ident-base;
+ }
+ }
+ }
+
+ container leaf-container {
+ leaf union-identityref-leaf {
+ type union-type;
+ }
+ leaf identityref-leaf {
+ type identityref {
+ base ident-base;
+ }
+ }
+ }
+ }""");
}
@AfterClass
@BeforeAll
static void beforeAll() {
- final var modelContext = YangParserTestUtils.parseYangResourceDirectory("/yt1473");
+ final var modelContext = YangParserTestUtils.parseYang("""
+ module bar {
+ namespace barns;
+ prefix bar;
+
+ import foo {
+ prefix foo;
+ }
+
+ identity two {
+ base foo:one;
+ }
+
+ leaf-list str {
+ type string;
+ }
+
+ leaf-list foo {
+ type identityref {
+ base foo:one;
+ }
+ }
+
+ leaf-list bar {
+ type instance-identifier;
+ }
+
+ leaf-list bee {
+ type foo:bitz;
+ }
+
+ leaf baz {
+ type instance-identifier;
+ }
+ }""", """
+ module foo {
+ namespace foons;
+ prefix foo;
+ identity one;
+
+ typedef bitz {
+ type bits {
+ bit one;
+ bit two;
+ bit three;
+ }
+ }
+
+ list foo {
+ key str;
+ leaf str {
+ type string;
+ }
+ }
+
+ list bar {
+ key qname;
+ leaf qname {
+ type identityref {
+ base one;
+ }
+ }
+ }
+
+ list baz {
+ key id;
+ leaf id {
+ type instance-identifier;
+ }
+ }
+
+ list bee {
+ key bts;
+ leaf bts {
+ type bitz;
+ }
+ }
+ }""");
final var baz = assertInstanceOf(ListSchemaNode.class, modelContext.getDataChildByName(FOO_BAZ));
final var id = assertInstanceOf(LeafSchemaNode.class, baz.getDataChildByName(FOO_ID));
final var type = assertInstanceOf(InstanceIdentifierTypeDefinition.class, id.getType());
+++ /dev/null
-module bar {
- namespace "bar";
- prefix bar;
-
- container bar {
- container my-container-1 {
- leaf my-leaf-1 {
- type string;
- }
- }
-
- container my-container-2 {
- leaf my-leaf-2 {
- type string;
- }
- }
- }
-}
+++ /dev/null
-module foo {
- namespace "foo";
- prefix foo;
-
- import yang-ext { prefix ext; revision-date 2013-07-09; }
-
- container my-container-1 {
- leaf my-leaf-1 {
- type string;
- }
- }
-
- container my-container-2 {
- container inner-container {
- leaf my-leaf-2 {
- type string;
- }
- }
- leaf my-leaf-3 {
- type string;
- }
- }
-
- anyxml my-anyxml-data {
- ext:anyxml-schema-location "/my-container-2";
- }
-}
+++ /dev/null
-module yang-ext {
- yang-version 1;
- namespace "urn:opendaylight:yang:extension:yang-ext";
- prefix "ext";
-
- contact "Anton Tkacik <ttkacik@cisco.com>";
-
- description
- "Copyright (c) 2013 Cisco Systems, Inc. and others. All rights
- reserved. This program and the accompanying materials are made
- available under the terms of the Eclipse Public License v1.0 which
- accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html";
-
- revision "2013-07-09" {
- description "";
- }
-
- // Augmentation name
-
- extension "augment-identifier" {
- description
- "YANG language extension which assigns an identifier to augmentation.
- Augment identifier is used to identify specific augment statement
- by name. The identifier syntax is defined formally defined by
- the rule 'identifier' in Section 12 of RFC 6020. All augment identifiers
- defined in a namespace MUST be unique. The namespace of augment
- identifiers is shared by module and its submodules.";
-
- /*
- Discussion:
- This extension allows for ease of development / debug
- of YANG modules and it is suitable for code generation,
- where each augment statement is nicely identified by
- unique name instead of combination of augment target
- and when condition.
- */
- argument "identifier";
- }
-
- // Context-aware RPCs
-
- grouping rpc-context-ref {
- description
- "A reference to RPC context.";
- leaf context-instance {
- type instance-identifier;
- description "Pointer to the context. ";
- }
- }
-
- extension "rpc-context-instance" {
- description
- "YANG language extension which defines enclosing (parent) schema
- node as referencable context for RPCs. The argument is identity
- which is used to identify RPC context type.";
-
- argument "context-type";
- }
-
- extension "context-reference" {
- argument "context-type";
- }
-
- extension "context-instance" {
- argument "context-type";
- }
-
- extension "instance-target" {
- argument "path";
- }
-
- extension "anyxml-schema-location" {
- argument "target-node";
- }
-}
+++ /dev/null
-module foo {
- namespace "foo";
- prefix "foo";
- revision "2016-02-17";
-
- container root {
- list policy {
- key name;
- leaf name {
- type string;
- }
- list rule {
- key name;
- leaf name {
- type string;
- }
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module order {
- namespace "order";
- prefix "order";
- revision "2016-02-17";
-
- container root {
- leaf id {
- type string;
- }
- container cont {
- leaf content {
- type string;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module foo {
- yang-version 1;
- namespace "foo";
- prefix "foo";
-
- revision "2016-03-22" {
- description "test";
- }
-
- container root {
- leaf my-leaf {
- type my-type;
- }
- }
-
- typedef my-type {
- type union {
- type string {
- pattern "dp[0-9]+o[0-9]+";
- }
- type string {
- pattern "dp[0-9]+s[0-9]+(f[0-9]+)?(d[0-9]+)?";
- }
- type string {
- pattern "dp[0-9]+(P[0-9]+)?p[0-9]{1,3}s[0-9]{1,3}(f[0-9]+)?(d[0-9]+)?";
- }
- type string {
- pattern "dp[0-9]+p[0-9]+p[0-9]+";
- }
- }
- }
-}
+++ /dev/null
-module foo {
- yang-version 1;
- namespace "foo";
- prefix "foo";
-
- revision "2015-11-05" {
- }
-
- typedef ipv4-address-binary {
- type binary {
- length "4";
- }
- }
-
- typedef ipv6-address-binary {
- type binary {
- length "16";
- }
- }
-
- typedef ip-address-binary {
- type union {
- type ipv4-address-binary;
- type ipv6-address-binary;
- }
- }
-
- container root {
- leaf ip-address {
- type ip-address-binary;
- }
- }
-}
+++ /dev/null
-module baz {
-
- namespace baz-ns;
- prefix baz-prefix;
-
- container top-cont {
- list keyed-list {
- key empty-key-leaf;
-
- leaf empty-key-leaf {
- type empty;
- }
-
- leaf regular-leaf {
- type int32;
- }
- }
-
- leaf iid-leaf {
- type instance-identifier;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module foobar {
-
- namespace foobar-ns;
- prefix foobar-prefix;
-
- container top-cont {
- list keyed-list {
- key iid-key-leaf;
-
- leaf iid-key-leaf {
- type instance-identifier;
- }
-
- leaf regular-leaf {
- type int32;
- }
- }
-
- leaf iid-leaf {
- type instance-identifier;
- }
-
- leaf leaf-b {
- type int32;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module zab {
-
- namespace zab-ns;
- prefix zab-prefix;
-
- identity base-id;
-
- identity derived-id {
- base base-id;
- }
-
- container top-cont {
- list keyed-list {
- key identityref-key-leaf;
-
- leaf identityref-key-leaf {
- type identityref {
- base base-id;
- }
- }
-
- leaf regular-leaf {
- type int32;
- }
- }
-
- leaf iid-leaf {
- type instance-identifier;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module foo {
- namespace foo;
- prefix foo;
-
- revision 2017-06-13;
-
- list top-level-list {
- key key-leaf;
-
- leaf key-leaf {
- type string;
- }
-
- leaf ordinary-leaf {
- type string;
- }
-
- container cont-in-list {}
-
- list inner-list {
- key inner-key-leaf;
-
- leaf inner-key-leaf {
- type string;
- }
-
- leaf inner-ordinary-leaf {
- type string;
- }
- }
- }
-
- container top-level-container {
- container inner-container-1 {}
- container inner-container-2 {}
- }
-
- anyxml top-level-anyxml;
-
- leaf top-level-leaf {
- type int32;
- }
-
- leaf-list top-level-leaf-list {
- type int32;
- }
-}
\ No newline at end of file
+++ /dev/null
-module foo {
- namespace foo;
- prefix foo;
-
- container cont-with-attributes {
- leaf leaf-with-attributes {
- type string;
- }
-
- leaf-list leaf-list-with-attributes {
- type string;
- }
-
- list list-with-attributes {
- key list-key;
-
- leaf list-key {
- type string;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module bar {
- namespace bar-ns;
- prefix bar;
-
- import foo {
- prefix foo;
- }
-
- augment "/foo:top-cont/foo:keyed-list" {
- leaf iid-leaf {
- type instance-identifier;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module baz {
- namespace baz-ns;
- prefix baz;
-
- container top-cont {
- list keyed-list {
- key key-leaf;
-
- leaf key-leaf {
- type int32;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module foo {
- namespace foo-ns;
- prefix foo;
-
- container top-cont {
- list keyed-list {
- key key-leaf;
-
- leaf key-leaf {
- type int32;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module bar {
- namespace bar-ns;
- prefix bar;
-
- import foo {
- prefix foo;
- }
-
- augment "/foo:top-cont/foo:keyed-list" {
- leaf iid-leaf {
- type instance-identifier;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module baz {
- namespace baz-ns;
- prefix baz;
-
- container top-cont {
- /*list keyed-list {
- key key-leaf;
-
- leaf key-leaf {
- type int32;
- }
- }*/
- }
-}
\ No newline at end of file
+++ /dev/null
-module foo {
- namespace foo-ns;
- prefix foo;
-
- import rab {
- prefix rab;
- }
-
- container top-cont {
- list keyed-list {
- key key-leaf;
-
- leaf key-leaf {
- type int32;
- }
-
- leaf idref-leaf {
- type identityref {
- base rab:base-id;
- }
- }
-
- leaf ordinary-leaf {
- type int32;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module rab {
- namespace rab-ns;
- prefix rab;
-
- import baz {
- prefix baz;
- }
-
- augment "/baz:top-cont" {
- list keyed-list {
- key key-leaf;
-
- leaf key-leaf {
- type int32;
- }
- }
- }
-
- identity base-id;
- identity id-foo {
- base base-id;
- }
-}
\ No newline at end of file
+++ /dev/null
-module zab {
- namespace zab-ns;
- prefix zab;
-
- import foo {
- prefix foo;
- }
-
- augment "/foo:top-cont/foo:keyed-list/" {
- /*leaf ordinary-leaf {
- type int32;
- }*/
-
- anyxml aug-anyxml;
- }
-}
\ No newline at end of file
+++ /dev/null
-module foo {
- namespace foo;
- prefix foo;
-
- container top-level-container {
- container inner-container {}
- }
-}
\ No newline at end of file
+++ /dev/null
-module test-anydata {
- yang-version 1.1;
- namespace test-anydata;
- prefix ta;
-
- anydata foo;
-
- container cont {
- anydata cont-any;
-
- leaf cont-leaf {
- type string;
- }
- leaf empty-leaf {
- type empty;
- }
- container bar {
- leaf cont-leaf {
- type string;
- }
- }
- }
- list lst {
- leaf cont-leaf {
- type string;
- }
- leaf-list my-leafs {
- type string;
- }
- }
-}
-
+++ /dev/null
-module yt1107 {
- namespace "yt1107";
- prefix "yt1107";
- container parent {
- config true;
- list user {
- key name;
- leaf name {
- type string;
- }
- }
- list admin {
- key name;
- leaf name {
- type string;
- }
- }
- }
-}
+++ /dev/null
-module foo {
- namespace "foo-namespace";
- prefix "f";
-
- identity ident-base;
- identity ident-one {
- base ident-base;
- }
-
- typedef union-type {
- type union {
- type uint8;
- type identityref {
- base ident-base;
- }
- }
- }
-
- container leaf-container {
- leaf union-identityref-leaf {
- type union-type;
- }
-
- leaf identityref-leaf {
- type identityref {
- base ident-base;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module bar {
- namespace barns;
- prefix bar;
-
- import foo { prefix foo; }
-
- identity two {
- base foo:one;
- }
-
- leaf-list str {
- type string;
- }
-
- leaf-list foo {
- type identityref {
- base foo:one;
- }
- }
-
- leaf-list bar {
- type instance-identifier;
- }
-
- leaf-list bee {
- type foo:bitz;
- }
-
- leaf baz {
- type instance-identifier;
- }
-}
+++ /dev/null
-module foo {
- namespace foons;
- prefix foo;
-
- identity one;
-
- typedef bitz {
- type bits {
- bit one;
- bit two;
- bit three;
- }
- }
-
- list foo {
- key str;
- leaf str {
- type string;
- }
- }
-
- list bar {
- key qname;
- leaf qname {
- type identityref {
- base one;
- }
- }
- }
-
- list baz {
- key id;
- leaf id {
- type instance-identifier;
- }
- }
-
- list bee {
- key bts;
- leaf bts {
- type bitz;
- }
- }
-}