From: Martin Vitez Date: Tue, 27 May 2014 12:09:24 +0000 (+0200) Subject: BUG-584: added test-models to integration-test project. X-Git-Tag: release/helium~487^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=yangtools.git;a=commitdiff_plain;h=1e7d49d3b41e01210d69fbbd07f349d72426a531 BUG-584: added test-models to integration-test project. Change-Id: Ib84e16e1722c61a693452a180d7c7a3cbfb5f79c Signed-off-by: Martin Vitez --- diff --git a/integration-test/pom.xml b/integration-test/pom.xml index 9f10996bf2..f609ce8611 100644 --- a/integration-test/pom.xml +++ b/integration-test/pom.xml @@ -20,6 +20,7 @@ bug527-test-model bundle-test + test-models regression-test-model yang-runtime-tests diff --git a/integration-test/test-models/pom.xml b/integration-test/test-models/pom.xml new file mode 100644 index 0000000000..1330810048 --- /dev/null +++ b/integration-test/test-models/pom.xml @@ -0,0 +1,148 @@ + + + + + + + org.opendaylight.yangtools + integration-tests + 0.6.2-SNAPSHOT + + + 4.0.0 + test-models + pom + ${project.artifactId} + ${project.artifactId} + + + + + org.opendaylight.yangtools + yang-maven-plugin + 0.6.2-SNAPSHOT + + + + generate-sources + + + src/main/yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + + + target/generated-sources/sal + + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/restconf + + + org.opendaylight.yangtools.yang.wadl.generator.maven.WadlGenerator + target/site/restconf + + + true + + + + + + org.opendaylight.yangtools + maven-sal-api-gen-plugin + 0.6.2-SNAPSHOT + jar + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.8 + + + generate-sources + + add-source + + + + target/generated-sources/sal + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.opendaylight.yangtools + yang-maven-plugin + [0.5,) + + + generate-sources + + + + + + + + + + org.apache.felix + maven-bundle-plugin + [1.0,) + + manifest + + + + + + + + + + + + + + + + + org.opendaylight.yangtools + yang-binding + 0.6.2-SNAPSHOT + + + org.opendaylight.yangtools + yang-common + 0.6.2-SNAPSHOT + + + + + diff --git a/integration-test/test-models/src/main/yang/augment-in-augment/augment-target-augment.yang b/integration-test/test-models/src/main/yang/augment-in-augment/augment-target-augment.yang new file mode 100644 index 0000000000..a7f90cd022 --- /dev/null +++ b/integration-test/test-models/src/main/yang/augment-in-augment/augment-target-augment.yang @@ -0,0 +1,59 @@ +module augment-target-augment { + yang-version 1; + namespace "odl:test:augment-target-augment"; + prefix "ata"; + + import target { + prefix "t"; + revision-date 2013-10-14; + } + + import augment { + prefix "a"; + revision-date 2013-10-15; + } + + revision "2013-10-13" { + reference " WILL BE DEFINED LATER"; + } + + + augment "/t:interfaces/t:ifEntry/a:augment-holder" { + when "if:ifType='ds0'"; + leaf ds0ChannelNumber { + type string; + } + leaf interface-id { + type leafref { + path "/t:interfaces/t:ifEntry/t:ifMtu"; + } + } + container schemas { + } + choice odl { + leaf id { + type int8; + } + case node1 { + description "node1"; + } + case node2 { + description "node2"; + } + container node3 { + description "node3"; + } + } + } + + + uses a:target { + augment "how/interval" { + description "inner augment"; + leaf name { + type string; + } + } + } + +} diff --git a/integration-test/test-models/src/main/yang/augment-in-augment/augment.yang b/integration-test/test-models/src/main/yang/augment-in-augment/augment.yang new file mode 100644 index 0000000000..ed27cf6bd1 --- /dev/null +++ b/integration-test/test-models/src/main/yang/augment-in-augment/augment.yang @@ -0,0 +1,91 @@ +module augment { + yang-version 1; + namespace "odl:test:augment"; + prefix "a"; + + import target { + prefix "t"; + revision-date 2013-10-14; + } + + revision "2013-10-15" { + reference " WILL BE DEFINED LATER"; + } + + + augment "/t:interfaces/t:ifEntry" { + when "if:ifType='ds0'"; + container augment-holder { + description "Description for augment holder"; + } + } + + augment "/t:interfaces/t:ifEntry" { + when "if:ifType='ds2'"; + container augment-holder2 { + description "Description for augment holder"; + } + } + + augment "/t:controller/t:switch" { + leaf pause { + type int32; + } + } + + grouping target { + anyxml data { + config true; + description "Copy of the source datastore subset."; + mandatory false; + must "test-condition-text"; + reference "test-no-reference"; + status "obsolete"; + when "test-when-text"; + } + choice how { + description "test choice description"; + default interval; + case interval { + leaf interval { + type uint16; + default 30; + units minutes; + } + } + case daily { + leaf daily { + type empty; + } + leaf time-of-day { + type string; + units 24-hour-clock; + default 1am; + } + } + } + leaf address { + type string; + description "Target IP address"; + mandatory true; + } + container port { + description "Target port container"; + } + list addresses { + key "id"; + leaf id { + type int8; + } + } + grouping target-inner { + description "target-inner default description"; + leaf inner-grouping-id { + type int8; + } + } + + t:opendaylight; + } + +} diff --git a/integration-test/test-models/src/main/yang/augment-in-augment/target.yang b/integration-test/test-models/src/main/yang/augment-in-augment/target.yang new file mode 100644 index 0000000000..00958cb72b --- /dev/null +++ b/integration-test/test-models/src/main/yang/augment-in-augment/target.yang @@ -0,0 +1,46 @@ +module target { + yang-version 1; + namespace "odl:test:target"; + prefix "t"; + + revision "2013-10-14" { + reference " WILL BE DEFINED LATER"; + } + + container interfaces { + grouping ifEntry { + container augment-holder; + } + list ifEntry { + key "ifIndex"; + + leaf ifIndex { + type uint32; + units minutes; + } + + leaf ifMtu { + type int32; + } + + min-elements 1; + max-elements 11; + } + } + + container controller { + choice switch { + case start { + leaf start { + type int8; + } + } + case stop { + leaf stop { + type int16; + } + } + } + } + +} diff --git a/integration-test/test-models/src/main/yang/augment-in-uses/augment-in-uses.yang b/integration-test/test-models/src/main/yang/augment-in-uses/augment-in-uses.yang new file mode 100644 index 0000000000..c98e3f870c --- /dev/null +++ b/integration-test/test-models/src/main/yang/augment-in-uses/augment-in-uses.yang @@ -0,0 +1,35 @@ +/* + * 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 + */ +module augment-in-uses { + yang-version 1; + namespace "odl:test:augment-in-uses"; + prefix "aiu"; + + revision "2014-03-10" { + } + + container links { + container link { + uses g1 { + augment nodes/node { + leaf id { + type string; + } + } + } + } + } + + grouping g1 { + list nodes { + container node { + } + } + } + +} diff --git a/integration-test/test-models/src/main/yang/cascade-uses/cascade-uses.yang b/integration-test/test-models/src/main/yang/cascade-uses/cascade-uses.yang new file mode 100644 index 0000000000..7f3e082901 --- /dev/null +++ b/integration-test/test-models/src/main/yang/cascade-uses/cascade-uses.yang @@ -0,0 +1,55 @@ +module cascade-uses { + yang-version 1; + namespace "odl:test:cascade-uses"; + prefix "cu"; + + organization "OPEN DAYLIGHT"; + contact "http://www.opendaylight.org/"; + + revision 2013-07-18 { + } + + grouping grouping-U { + leaf leaf-grouping-U { + type string; + } + uses grouping-V; + uses grouping-X; + } + + grouping grouping-V { + leaf leaf-grouping-V { + type string; + } + container container-grouping-V { + uses grouping-X; + } + uses grouping-Z; + uses grouping-ZZ; + } + + grouping grouping-X { + leaf leaf-grouping-X { + type string; + } + uses grouping-Y; + } + + grouping grouping-Y { + leaf leaf-grouping-Y { + type string; + } + } + + grouping grouping-Z { + leaf leaf-grouping-Z { + type string; + } + } + + grouping grouping-ZZ { + leaf leaf-grouping-ZZ { + type string; + } + } +} diff --git a/integration-test/test-models/src/main/yang/nested-groupings/grouping-base.yang b/integration-test/test-models/src/main/yang/nested-groupings/grouping-base.yang new file mode 100644 index 0000000000..ac92c00fec --- /dev/null +++ b/integration-test/test-models/src/main/yang/nested-groupings/grouping-base.yang @@ -0,0 +1,127 @@ +module grouping-base { + yang-version 1; + namespace "odl:test:grouping-base"; + prefix "gb"; + + import grouping-definitions { prefix gd; revision-date 2013-09-04; } + + organization "opendaylight"; + contact "asdf"; + + revision "2013-07-30" { + } + + + grouping bandwidth-object { + uses gd:object-header; + + container bandwidth { + uses gd:ieee754-32; + } + } + + grouping endpoints-object { + uses gd:object; + + choice address-family { + case ipv4 { + leaf source-ipv4-address { + type string; + mandatory true; + } + } + case ipv6 { + leaf source-ipv6-address { + type string; + mandatory true; + } + } + } + } + + grouping lsp-attributes { + container bandwidth { + uses bandwidth-object; + } + } + + grouping metric-object { + uses gd:object; + leaf metric-type { + type uint8; + mandatory true; + } + } + + grouping path-key-object { + uses gd:object-header; + + list path-keys { + } + } + + grouping route-object { + uses gd:object-header; + + list subobjects { + } + } + + grouping svec-object { + uses gd:object-header; + + leaf link-diverse { + type boolean; + default false; + } + } + + + notification pcreq { + uses gd:message-header; + + list requests { + container rp { + uses gd:rp-object; + } + container path-key-expansion { + when "rp/path-key = true"; + container path-key { + uses path-key-object { + augment path-keys { + uses gd:message-header; + } + } + } + } + container segment-computation { + when "rp/path-key = false"; + + container p2p { + when "../rp/p2mp = false"; + + container endpoints { + uses endpoints-object; + } + container reported-route { + uses route-object; + + container bandwidth { + uses bandwidth-object; + } + } + + uses lsp-attributes; + } + } + } + + list svec { + uses svec-object; + list metric { + uses metric-object; + } + } + } + +} diff --git a/integration-test/test-models/src/main/yang/nested-groupings/grouping-definitions.yang b/integration-test/test-models/src/main/yang/nested-groupings/grouping-definitions.yang new file mode 100644 index 0000000000..7435e6166b --- /dev/null +++ b/integration-test/test-models/src/main/yang/nested-groupings/grouping-definitions.yang @@ -0,0 +1,86 @@ +module grouping-definitions { + yang-version 1; + namespace "odl:test:grouping-definitions"; + prefix "gd"; + + organization "opendaylight"; + contact "asdf"; + + revision "2013-09-04" { + } + + + typedef int-ext { + type string; + } + + typedef protocol-version { + type uint8 { + range 1..7; + } + } + + grouping base-header { + leaf delete { + type uint32; + mandatory true; + } + leaf setup { + type uint32; + mandatory true; + } + } + + grouping ieee754-32 { + reference "IEEE 754-2008"; + leaf fraction { + type uint32 { + range 0..1677215; + } + mandatory true; + } + } + + grouping message-header { + leaf version { + type protocol-version; + default 1; + } + leaf type { + type int-ext; + } + } + + grouping object { + uses object-header; + + container box { + } + } + + grouping object-header { + leaf processing-rule { + type boolean; + } + leaf ignore { + type boolean; + } + } + + grouping rp-object { + uses object { + augment "box" { + container order { + uses base-header; + } + } + } + + leaf priority { + type uint8 { + range 1..7; + } + } + } + +}