Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: I0751e51387291aab9afc3c2963e1b7302e180316
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
oleaf = QName.create(foo, "o");
ileaf = QName.create(foo, "i");
inMemoryDataTree = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
- YangParserTestUtils.parseYangResource("/bug-4295/foo.yang"));
+ YangParserTestUtils.parseYang("""
+ module foo {
+ namespace "foo";
+ prefix foo;
+
+ container root {
+ container sub-root {
+ list outer-list {
+ key "o-id";
+ leaf o-id {
+ type string;
+ }
+ list inner-list {
+ key "i-id";
+ leaf i-id {
+ type string;
+ }
+ leaf i {
+ type string;
+ }
+ }
+ leaf o {
+ type string;
+ }
+ }
+ }
+ }
+ }"""));
}
@Test
@BeforeClass
public static void beforeClass() {
- schemaContext = YangParserTestUtils.parseYangResource("/bug-4454-test.yang");
+ schemaContext = YangParserTestUtils.parseYang("""
+ module Bug4454Test {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:list-constraints-validation-test-model";
+ prefix "list-constraints-validation";
+
+ revision "2015-02-02" {
+ description "Initial revision.";
+ }
+
+ container master-container {
+ list min-max-list {
+ min-elements 1;
+ max-elements 3;
+ key "min-max-key-leaf";
+ leaf min-max-key-leaf {
+ type string;
+ }
+ leaf min-max-value-leaf {
+ type string;
+ }
+ }
+
+ list min-max-list-no-minmax {
+ key "min-max-key-leaf";
+ leaf min-max-key-leaf {
+ type string;
+ }
+ }
+
+ leaf-list min-max-leaf-list {
+ min-elements 0;
+ max-elements 10;
+ type string;
+ }
+ }
+
+ container presence {
+ presence "anchor point";
+
+ list min-max-list {
+ min-elements 2;
+ max-elements 3;
+
+ key "min-max-key-leaf";
+
+ leaf min-max-key-leaf {
+ type string;
+ }
+ }
+ }
+ }""");
}
@AfterClass
import org.opendaylight.yangtools.yang.data.tree.api.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.tree.impl.di.InMemoryDataTreeFactory;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class Bug5830Test {
private static final String NS = "foo";
}
private static void testPresenceContainer() throws DataValidationFailedException {
- final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug-5830/foo-presence.yang");
+ final EffectiveModelContext schemaContext = YangParserTestUtils.parseYang("""
+ module foo-presence {
+ yang-version 1;
+ namespace "foo";
+ prefix foo;
+
+ revision 2016-05-17 {
+ description "test";
+ }
+
+ container task-container {
+ list task {
+ key "task-id";
+ leaf task-id {
+ type string;
+ }
+ leaf task-mandatory-leaf {
+ type string;
+ mandatory true;
+ }
+
+ container task-data {
+ presence "Task data";
+ leaf mandatory-data {
+ type string;
+ mandatory true;
+ }
+ leaf other-data {
+ type string;
+ }
+ }
+ }
+ }
+ }""");
assertNotNull("Schema context must not be null.", schemaContext);
testContainerIsNotPresent(schemaContext);
}
private static void testNonPresenceContainer() throws DataValidationFailedException {
- final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug-5830/foo-non-presence.yang");
+ final EffectiveModelContext schemaContext = YangParserTestUtils.parseYang("""
+ module foo-non-presence {
+ yang-version 1;
+ namespace "foo";
+ prefix foo;
+
+ revision 2016-05-17 {
+ description "test";
+ }
+
+ container task-container {
+ list task {
+ key "task-id";
+
+ leaf task-id {
+ type string;
+ }
+ leaf task-mandatory-leaf {
+ type string;
+ mandatory true;
+ }
+
+ container task-data {
+ leaf mandatory-data {
+ type string;
+ mandatory true;
+ }
+ leaf other-data {
+ type string;
+ }
+ }
+ }
+ }
+ }""");
assertNotNull("Schema context must not be null.", schemaContext);
try {
}
private static void testMultipleContainers() throws DataValidationFailedException {
- final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug-5830/foo-multiple.yang");
+ final EffectiveModelContext schemaContext = YangParserTestUtils.parseYang("""
+ module foo-multiple {
+ yang-version 1;
+ namespace "foo";
+ prefix foo;
+
+ revision 2016-05-17 {
+ description "test";
+ }
+
+ container task-container {
+ list task {
+ key "task-id";
+
+ leaf task-id {
+ type string;
+ }
+ leaf task-mandatory-leaf {
+ type string;
+ mandatory true;
+ }
+
+ container task-data {
+ presence "Task data";
+
+ leaf mandatory-data {
+ type string;
+ mandatory true;
+ }
+ leaf other-data {
+ type string;
+ }
+
+ container non-presence-container {
+
+ container presence-container {
+ presence "presence container";
+
+ leaf mandatory-leaf {
+ mandatory true;
+ type string;
+ }
+ }
+
+ container non-presence-container-2 {
+ leaf mandatory-leaf-2 {
+ mandatory true;
+ type string;
+ }
+ }
+
+ container presence-container-2 {
+ presence "presence container";
+
+ leaf mandatory-leaf-3 {
+ mandatory true;
+ type string;
+ }
+ }
+ }
+ }
+ }
+ }
+ }""");
assertNotNull("Schema context must not be null.", schemaContext);
testContainerIsNotPresent(schemaContext);
import org.opendaylight.yangtools.yang.data.tree.api.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.tree.impl.di.InMemoryDataTreeFactory;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class Bug5968MergeTest {
private static final String NS = "bug5968";
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = TestModel.createTestContext("/bug5968.yang");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module bug5968 {
+ yang-version 1;
+ namespace bug5968;
+ prefix bug5968;
+
+ revision 2016-07-28 {
+ description "test";
+ }
+
+ container root {
+ list my-list {
+ key "list-id";
+ leaf list-id {
+ type string;
+ }
+ leaf mandatory-leaf {
+ type string;
+ mandatory true;
+ }
+ leaf common-leaf {
+ type string;
+ }
+ }
+ }
+ }""");
}
@AfterClass
import org.opendaylight.yangtools.yang.data.tree.api.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.tree.impl.di.InMemoryDataTreeFactory;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class Bug5968Test {
private static final String NS = "bug5968";
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = TestModel.createTestContext("/bug5968.yang");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module bug5968 {
+ yang-version 1;
+ namespace bug5968;
+ prefix bug5968;
+
+ revision 2016-07-28 {
+ description "test";
+ }
+
+ container root {
+ list my-list {
+ key "list-id";
+ leaf list-id {
+ type string;
+ }
+ leaf mandatory-leaf {
+ type string;
+ mandatory true;
+ }
+ leaf common-leaf {
+ type string;
+ }
+ }
+ }
+ }""");
}
@AfterClass
import org.opendaylight.yangtools.yang.data.tree.api.TreeType;
import org.opendaylight.yangtools.yang.data.tree.impl.di.InMemoryDataTreeFactory;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class Bug8291Test {
private static final String NS = "bug8291";
@Before
public void init() {
- schemaContext = TestModel.createTestContext("/bug8291.yang");
+ schemaContext = YangParserTestUtils.parseYang("""
+ module bug8291 {
+ yang-version 1;
+ namespace bug8291;
+ prefix bug8291;
+
+ container root {
+ list outer-list {
+ key "id";
+ leaf id {
+ type uint16;
+ }
+
+ list inner-list {
+ key name;
+ leaf name {
+ type string;
+ }
+ leaf value {
+ type string;
+ }
+ }
+ }
+ }
+ }""");
assertNotNull("Schema context must not be null.", schemaContext);
}
import org.opendaylight.yangtools.yang.data.tree.api.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.tree.impl.di.InMemoryDataTreeFactory;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class CaseAugmentTest {
private static final QName CHOICE1_QNAME = QName.create(TestModel.TEST_QNAME, "choice1");
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = TestModel.createTestContext("/case-augment-test.yang");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module case-augment-test {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test";
+ prefix "store-test";
+
+ revision "2014-03-13" {
+ description "Initial revision.";
+ }
+
+ container test {
+ choice choice1 {
+ case case1 {
+ leaf case1-leaf1 {
+ type string;
+ }
+ }
+ case case2 {
+ leaf case2-leaf1 {
+ type string;
+ }
+ }
+ }
+ }
+
+ augment "/test/choice1/case1" {
+ leaf case1-leaf2 {
+ type string;
+ }
+ leaf case1-leaf3 {
+ type string;
+ }
+ }
+ }""");
}
@AfterClass
@BeforeClass
public static void beforeClass() {
- schemaContext = YangParserTestUtils.parseYangResource("/list-constraints-validation-test-model.yang");
+ schemaContext = YangParserTestUtils.parseYang("""
+ module list-constraints-validation-test-model {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:list-constraints-validation-test-model";
+ prefix "list-constraints-validation";
+
+ revision "2015-02-02" {
+ description "Initial revision.";
+ }
+
+ container master-container {
+ list min-max-list {
+ min-elements 2;
+ max-elements 3;
+ key "min-max-key-leaf";
+ leaf min-max-key-leaf {
+ type string;
+ }
+ }
+
+ list unbounded-list {
+ key "unbounded-key-leaf";
+ leaf unbounded-key-leaf {
+ type int8;
+ }
+ }
+
+ leaf-list min-max-leaf-list {
+ min-elements 1;
+ max-elements 3;
+ type string;
+ }
+
+ leaf-list unbounded-leaf-list {
+ type string;
+ }
+
+ list unkeyed-list {
+ max-elements 1;
+ leaf unkeyed-leaf {
+ type string;
+ }
+ }
+ }
+ }""");
}
@AfterClass
parentOrdinaryLeaf = QName.create(testModule, "parent-ordinary-leaf");
childOrdinaryLeaf = QName.create(testModule, "child-ordinary-leaf");
inMemoryDataTree = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
- YangParserTestUtils.parseYangResource("/ordered-list-modification-test.yang"));
+ YangParserTestUtils.parseYang("""
+ module ordered-list-modification-test {
+ namespace "ordered-list-modification-test";
+ prefix "olmt";
+
+ container parent-container {
+ container child-container {
+ list parent-ordered-list {
+ ordered-by user;
+ key "parent-key-leaf";
+
+ leaf parent-key-leaf {
+ type string;
+ }
+ leaf parent-ordinary-leaf {
+ type string;
+ }
+
+ list child-ordered-list {
+ ordered-by user;
+ key "child-key-leaf";
+
+ leaf child-key-leaf {
+ type string;
+ }
+ leaf child-ordinary-leaf {
+ type string;
+ }
+ }
+ }
+ }
+ }
+ }"""));
}
@Test
import org.opendaylight.yangtools.yang.data.tree.api.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.tree.impl.di.InMemoryDataTreeFactory;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class YT1104Test {
private static final QName MODULE = QName.create("yt1104", "yt1104");
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = TestModel.createTestContext("/yt1104.yang");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module yt1104 {
+ yang-version 1.1;
+ namespace yt1104;
+ prefix yt1104;
+
+ choice foo {
+ anydata bar;
+ anyxml baz;
+ }
+ }""");
}
@AfterClass
import org.opendaylight.yangtools.yang.data.tree.api.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.tree.impl.di.InMemoryDataTreeFactory;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class YT776Test {
private static final QName MODULE = QName.create("yt776", "yt776");
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = TestModel.createTestContext("/yt776.yang");
+ SCHEMA_CONTEXT = YangParserTestUtils.parseYang("""
+ module yt776 {
+ namespace yt776;
+ prefix yt776;
+
+ container box {
+ list object {
+ key object-id;
+
+ leaf object-id {
+ type string;
+ }
+
+ leaf-list attributes {
+ type string;
+ min-elements 1;
+ max-elements 2;
+ }
+
+ list nested {
+ key nested-attribute;
+ max-elements 1;
+ leaf nested-attribute {
+ type string;
+ }
+ }
+ }
+
+ choice any-of {
+ leaf some-leaf {
+ type string;
+ }
+ list some-list {
+ key some-leaf;
+ min-elements 1;
+
+ leaf some-leaf {
+ type string;
+ }
+ }
+ }
+ }
+ }""");
}
@AfterClass
@Test
public void test() {
- final EffectiveModelContext context = YangParserTestUtils.parseYangResourceDirectory("/bug7844");
+ final EffectiveModelContext context = YangParserTestUtils.parseYang("""
+ module bar {
+ namespace bar;
+ prefix bar-mod;
+
+ import baz { prefix baz-imp; }
+
+ typedef bar-leafref {
+ type baz-imp:my-leafref;
+ description "bar-leafref";
+ }
+
+ typedef bar-base-leafref {
+ type leafref {
+ path "/baz-imp:root/baz-imp:target";
+ }
+ }
+
+ leaf my-leafref-in-bar {
+ type bar-base-leafref;
+ }
+
+ leaf my-leafref-in-bar-2 {
+ type bar-base-leafref;
+ description "bar-base-leafref-2";
+ }
+
+ leaf bar-target {
+ type string;
+ }
+ }""", """
+ module baz {
+ namespace baz;
+ prefix baz-mod;
+
+ typedef my-leafref {
+ type leafref {
+ path "/baz-mod:root/baz-mod:target";
+ }
+ description "baz-leafref";
+ }
+
+ container root {
+ leaf target {
+ type string;
+ }
+ }
+ }""", """
+ module foo {
+ namespace foo;
+ prefix foo-mod;
+
+ import bar { prefix bar-imp; }
+
+ leaf my-leaf {
+ type foo-leafref;
+ }
+
+ typedef foo-leafref {
+ type bar-imp:bar-leafref;
+ description "foo-leafref";
+ }
+
+ leaf my-leaf-2 {
+ type foo-leafref-2;
+ }
+
+ typedef foo-leafref-2 {
+ type bar-imp:bar-base-leafref;
+ description "foo-leaf-ref-2";
+ }
+
+ leaf bar-base-leafref {
+ type bar-imp:bar-base-leafref;
+ }
+
+ leaf bar-base-leafref-2 {
+ type bar-imp:bar-base-leafref;
+ description "bar-base-leafref-2";
+ }
+
+ leaf direct-leafref {
+ type leafref {
+ path "/bar-imp:bar-target";
+ }
+ }
+ }""");
assertNotNull(context);
final LeafRefContext leafRefContext = LeafRefContext.create(context);
@Test
public void dataTreeCanditateValidationTest() throws Exception {
- final EffectiveModelContext context = YangParserTestUtils.parseYangResourceDirectory("/bug8713/");
+ final EffectiveModelContext context = YangParserTestUtils.parseYang("""
+ module bar {
+ namespace bar;
+ prefix bar;
+
+ import foo { prefix foo; revision-date 2017-09-06; }
+ revision 2017-09-06;
+
+ augment "/foo:root" {
+ leaf ref {
+ type leafref {
+ path "../target" ;
+ }
+ }
+ leaf target {
+ type string;
+ }
+ }
+ }""", """
+ module foo {
+ namespace foo;
+ prefix foo;
+ revision 2017-09-06;
+
+ container root {
+ }
+ }""");
final LeafRefContext rootLeafRefContext = LeafRefContext.create(context);
final DataTree inMemoryDataTree = new InMemoryDataTreeFactory().create(
DataTreeConfiguration.DEFAULT_OPERATIONAL, context);
@BeforeClass
public static void beforeClass() {
- schemaContext = YangParserTestUtils.parseYangResource("/yt821.yang");
+ schemaContext = YangParserTestUtils.parseYang("""
+ module yt821 {
+ namespace "urn:opendaylight:params:xml:ns:yang:foo";
+ prefix foo;
+ revision 2018-07-18;
+
+ container root {
+ list foo {
+ key name;
+ leaf name {
+ type string;
+ }
+ }
+
+ list bar {
+ key name;
+ leaf name {
+ type string;
+ }
+
+ container container-in-list {
+ }
+ }
+ }
+
+ augment /root/bar/container-in-list {
+ leaf ref-from-aug {
+ type leafref {
+ path "/root/foo/name";
+ }
+ }
+ }
+
+ augment /root/bar/ {
+ container container-from-aug {
+ leaf ref-in-container {
+ type leafref {
+ path "/root/foo/name";
+ }
+ }
+ }
+ }
+ }""");
leafRefContext = LeafRefContext.create(schemaContext);
}
@BeforeClass
public static void beforeClass() {
- schemaContext = YangParserTestUtils.parseYangResourceDirectory("/yt891");
+ schemaContext = YangParserTestUtils.parseYang("""
+ module bar {
+ namespace "urn:opendaylight:params:xml:ns:yang:bar";
+ prefix bar;
+ revision 2018-07-27;
+
+ grouping grouping-with-list {
+ list list-in-grouping {
+ key "name";
+ leaf name {
+ type leafref {
+ path "../container-in-list/name";
+ }
+ }
+ container container-in-list {
+ leaf name {
+ type string;
+ }
+ }
+ }
+ }
+ }""", """
+ module baz {
+ namespace "urn:opendaylight:params:xml:ns:yang:baz";
+ prefix baz;
+ revision 2018-07-27;
+
+ grouping grouping-with-leafref {
+ leaf ref {
+ type leafref {
+ path "/baz-top/list-in-container/name";
+ }
+ }
+ }
+
+ container baz-top {
+ list list-in-container {
+ key "name";
+ leaf name {
+ type string;
+ }
+ }
+ }
+ }""", """
+ module foo {
+ namespace "urn:opendaylight:params:xml:ns:yang:foo";
+ prefix foo;
+
+ import bar {
+ prefix bar;
+ }
+
+ import baz {
+ prefix baz;
+ }
+
+ revision 2018-07-27;
+
+ container foo-top {
+ uses bar:grouping-with-list;
+ uses baz:grouping-with-leafref;
+ }
+ }""");
leafRefContext = LeafRefContext.create(schemaContext);
}
+++ /dev/null
-module foo {
- namespace "foo";
- prefix foo;
-
- container root {
- container sub-root {
- list outer-list {
- key "o-id";
- leaf o-id {
- type string;
- }
- list inner-list {
- key "i-id";
- leaf i-id {
- type string;
- }
- leaf i {
- type string;
- }
- }
- leaf o {
- type string;
- }
- }
- }
- }
-}
+++ /dev/null
-module Bug4454Test {
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:list-constraints-validation-test-model";
- prefix "list-constraints-validation";
-
- revision "2015-02-02" {
- description "Initial revision.";
- }
-
- container master-container {
- list min-max-list {
- min-elements 1;
- max-elements 3;
-
- key "min-max-key-leaf";
-
- leaf min-max-key-leaf {
- type string;
- }
- leaf min-max-value-leaf {
- type string;
- }
- }
-
- list min-max-list-no-minmax {
- key "min-max-key-leaf";
-
- leaf min-max-key-leaf {
- type string;
- }
- }
-
- leaf-list min-max-leaf-list {
- min-elements 0;
- max-elements 10;
- type string;
- }
- }
-
- container presence {
- presence "anchor point";
-
- list min-max-list {
- min-elements 2;
- max-elements 3;
-
- key "min-max-key-leaf";
-
- leaf min-max-key-leaf {
- type string;
- }
- }
- }
-}
+++ /dev/null
-module foo-multiple {
- yang-version 1;
- namespace "foo";
- prefix foo;
-
- revision 2016-05-17 {
- description "test";
- }
-
- container task-container {
- list task {
- key "task-id";
-
- leaf task-id {
- type string;
- }
- leaf task-mandatory-leaf {
- type string;
- mandatory true;
- }
-
- container task-data {
- presence "Task data";
- leaf mandatory-data {
- type string;
- mandatory true;
- }
- leaf other-data {
- type string;
- }
- container non-presence-container {
- container presence-container {
- presence "presence container";
- leaf mandatory-leaf {
- mandatory true;
- type string;
- }
- }
- container non-presence-container-2 {
- leaf mandatory-leaf-2 {
- mandatory true;
- type string;
- }
- }
- container presence-container-2 {
- presence "presence container";
- leaf mandatory-leaf-3 {
- mandatory true;
- type string;
- }
- }
- }
- }
- }
- }
-}
+++ /dev/null
-module foo-non-presence {
- yang-version 1;
- namespace "foo";
- prefix foo;
-
- revision 2016-05-17 {
- description "test";
- }
-
- container task-container {
- list task {
- key "task-id";
-
- leaf task-id {
- type string;
- }
- leaf task-mandatory-leaf {
- type string;
- mandatory true;
- }
-
- container task-data {
- leaf mandatory-data {
- type string;
- mandatory true;
- }
- leaf other-data {
- type string;
- }
- }
- }
- }
-}
+++ /dev/null
-module foo-presence {
- yang-version 1;
- namespace "foo";
- prefix foo;
-
- revision 2016-05-17 {
- description "test";
- }
-
- container task-container {
- list task {
- key "task-id";
-
- leaf task-id {
- type string;
- }
- leaf task-mandatory-leaf {
- type string;
- mandatory true;
- }
-
- container task-data {
- presence "Task data";
- leaf mandatory-data {
- type string;
- mandatory true;
- }
- leaf other-data {
- type string;
- }
- }
- }
- }
-}
+++ /dev/null
-module bug5968 {
- yang-version 1;
- namespace bug5968;
- prefix bug5968;
-
- revision 2016-07-28 {
- description "test";
- }
-
- container root {
- list my-list {
- key "list-id";
- leaf list-id {
- type string;
- }
- leaf mandatory-leaf {
- type string;
- mandatory true;
- }
- leaf common-leaf {
- type string;
- }
- }
- }
-}
+++ /dev/null
-module bar {
- namespace bar;
- prefix bar-mod;
-
- import baz { prefix baz-imp; }
-
- typedef bar-leafref {
- type baz-imp:my-leafref;
- description "bar-leafref";
- }
-
- typedef bar-base-leafref {
- type leafref {
- path "/baz-imp:root/baz-imp:target";
- }
- }
-
- leaf my-leafref-in-bar {
- type bar-base-leafref;
- }
-
- leaf my-leafref-in-bar-2 {
- type bar-base-leafref;
- description "bar-base-leafref-2";
- }
-
- leaf bar-target {
- type string;
- }
-}
+++ /dev/null
-module baz {
- namespace baz;
- prefix baz-mod;
-
- typedef my-leafref {
- type leafref {
- path "/baz-mod:root/baz-mod:target";
- }
- description "baz-leafref";
- }
-
- container root {
- leaf target {
- type string;
- }
- }
-}
+++ /dev/null
-module foo {
- namespace foo;
- prefix foo-mod;
-
- import bar { prefix bar-imp; }
-
- leaf my-leaf {
- type foo-leafref;
- }
-
- typedef foo-leafref {
- type bar-imp:bar-leafref;
- description "foo-leafref";
- }
-
- leaf my-leaf-2 {
- type foo-leafref-2;
- }
-
- typedef foo-leafref-2 {
- type bar-imp:bar-base-leafref;
- description "foo-leaf-ref-2";
- }
-
- leaf bar-base-leafref {
- type bar-imp:bar-base-leafref;
- }
-
- leaf bar-base-leafref-2 {
- type bar-imp:bar-base-leafref;
- description "bar-base-leafref-2";
- }
-
- leaf direct-leafref {
- type leafref {
- path "/bar-imp:bar-target";
- }
- }
-}
+++ /dev/null
-module bug8291 {
- yang-version 1;
- namespace bug8291;
- prefix bug8291;
-
- container root {
- list outer-list {
- key "id";
- leaf id {
- type uint16;
- }
- list inner-list {
- key name;
- leaf name {
- type string;
- }
- leaf value {
- type string;
- }
- }
- }
- }
-}
+++ /dev/null
-module bar {
- namespace bar;
- prefix bar;
-
- import foo { prefix foo; revision-date 2017-09-06; }
-
- revision 2017-09-06;
-
- augment "/foo:root" {
- leaf ref {
- type leafref {
- path "../target" ;
- }
- }
- leaf target {
- type string;
- }
- }
-}
+++ /dev/null
-module foo {
- namespace foo;
- prefix foo;
-
- revision 2017-09-06;
-
- container root {
- }
-}
+++ /dev/null
-module case-augment-test {
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test";
- prefix "store-test";
-
- revision "2014-03-13" {
- description "Initial revision.";
- }
-
- container test {
- choice choice1 {
- case case1 {
- leaf case1-leaf1 {
- type string;
- }
- }
- case case2 {
- leaf case2-leaf1 {
- type string;
- }
- }
- }
- }
-
- augment "/test/choice1/case1" {
- leaf case1-leaf2 {
- type string;
- }
- leaf case1-leaf3 {
- type string;
- }
- }
-}
+++ /dev/null
-module list-constraints-validation-test-model {
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:list-constraints-validation-test-model";
- prefix "list-constraints-validation";
-
- revision "2015-02-02" {
- description "Initial revision.";
- }
-
- container master-container {
- list min-max-list {
- min-elements 2;
- max-elements 3;
-
- key "min-max-key-leaf";
-
- leaf min-max-key-leaf {
- type string;
- }
- }
-
- list unbounded-list {
- key "unbounded-key-leaf";
-
- leaf unbounded-key-leaf {
- type int8;
- }
- }
-
- leaf-list min-max-leaf-list {
- min-elements 1;
- max-elements 3;
- type string;
- }
-
- leaf-list unbounded-leaf-list {
- type string;
- }
-
- list unkeyed-list {
- max-elements 1;
- leaf unkeyed-leaf {
- type string;
- }
- }
- }
-}
+++ /dev/null
-module ordered-list-modification-test {
- namespace "ordered-list-modification-test";
- prefix "olmt";
-
- container parent-container {
- container child-container {
- list parent-ordered-list {
- ordered-by user;
-
- key "parent-key-leaf";
-
- leaf parent-key-leaf {
- type string;
- }
-
- leaf parent-ordinary-leaf {
- type string;
- }
-
- list child-ordered-list {
- ordered-by user;
-
- key "child-key-leaf";
-
- leaf child-key-leaf {
- type string;
- }
-
- leaf child-ordinary-leaf {
- type string;
- }
- }
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module yt1104 {
- yang-version 1.1;
- namespace yt1104;
- prefix yt1104;
-
- choice foo {
- anydata bar;
- anyxml baz;
- }
-}
-
+++ /dev/null
-module yt776 {
- namespace yt776;
- prefix yt776;
-
- container box {
- list object {
- key object-id;
-
- leaf object-id {
- type string;
- }
-
- leaf-list attributes {
- type string;
- min-elements 1;
- max-elements 2;
- }
-
- list nested {
- key nested-attribute;
- max-elements 1;
-
- leaf nested-attribute {
- type string;
- }
- }
- }
-
- choice any-of {
- leaf some-leaf {
- type string;
- }
- list some-list {
- key some-leaf;
- min-elements 1;
-
- leaf some-leaf {
- type string;
- }
- }
- }
- }
-}
-
+++ /dev/null
-module yt821 {
- namespace "urn:opendaylight:params:xml:ns:yang:foo";
- prefix foo;
-
- revision 2018-07-18;
-
- container root {
- list foo {
- key name;
- leaf name {
- type string;
- }
- }
- list bar {
- key name;
- leaf name {
- type string;
- }
- container container-in-list {
- }
- }
- }
-
- augment /root/bar/container-in-list {
- leaf ref-from-aug {
- type leafref {
- path "/root/foo/name";
- }
- }
- }
-
- augment /root/bar/ {
- container container-from-aug {
- leaf ref-in-container {
- type leafref {
- path "/root/foo/name";
- }
- }
- }
- }
-}
+++ /dev/null
-module bar {
- namespace "urn:opendaylight:params:xml:ns:yang:bar";
- prefix bar;
-
- revision 2018-07-27;
-
- grouping grouping-with-list {
- list list-in-grouping {
- key "name";
- leaf name {
- type leafref {
- path "../container-in-list/name";
- }
- }
- container container-in-list {
- leaf name {
- type string;
- }
- }
- }
- }
-}
+++ /dev/null
-module baz {
- namespace "urn:opendaylight:params:xml:ns:yang:baz";
- prefix baz;
-
- revision 2018-07-27;
-
- grouping grouping-with-leafref {
- leaf ref {
- type leafref {
- path "/baz-top/list-in-container/name";
- }
- }
- }
-
- container baz-top {
- list list-in-container {
- key "name";
- leaf name {
- type string;
- }
- }
- }
-}
+++ /dev/null
-module foo {
- namespace "urn:opendaylight:params:xml:ns:yang:foo";
- prefix foo;
-
- import bar {
- prefix bar;
- }
- import baz {
- prefix baz;
- }
-
- revision 2018-07-27;
-
- container foo-top {
- uses bar:grouping-with-list;
- uses baz:grouping-with-leafref;
- }
-}