From: Robert Varga Date: Fri, 23 Aug 2019 16:05:42 +0000 (+0200) Subject: Fix action lookups X-Git-Tag: release/magnesium~59 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=4dc751203f52b31c4327ad8793956047691ff9fb;p=netconf.git Fix action lookups Actions, unlike RPCs, are not uniquely identified by their last component, simply because they can be defined at any nest level -- and while their names can be equal, they can be completely different things. JIRA: NETCONF-639 Change-Id: Ic9f1df106240a26dd14a5f34de34a198945355c3 Signed-off-by: Robert Varga --- diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformer.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformer.java index 624b4f76ba..b283f9c607 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformer.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformer.java @@ -16,7 +16,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSet.Builder; import com.google.common.collect.Maps; import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; @@ -24,10 +23,11 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.time.Instant; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.List; import java.util.Map; -import java.util.Set; import javax.xml.stream.XMLStreamException; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; @@ -57,6 +57,8 @@ import org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult; import org.opendaylight.yangtools.yang.data.util.DataSchemaContextTree; import org.opendaylight.yangtools.yang.model.api.ActionDefinition; import org.opendaylight.yangtools.yang.model.api.ActionNodeContainer; +import org.opendaylight.yangtools.yang.model.api.CaseSchemaNode; +import org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode; import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode; import org.opendaylight.yangtools.yang.model.api.DataNodeContainer; import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; @@ -87,7 +89,7 @@ public class NetconfMessageTransformer implements MessageTransformer mappedRpcs; private final Multimap mappedNotifications; private final boolean strictParsing; - private final Set actions; + private final ImmutableMap actions; public NetconfMessageTransformer(final SchemaContext schemaContext, final boolean strictParsing) { this(schemaContext, strictParsing, BaseSchema.BASE_NETCONF_CTX); @@ -98,7 +100,7 @@ public class NetconfMessageTransformer implements MessageTransformer node.getQName().withoutRevision()); this.baseSchema = baseSchema; @@ -106,20 +108,15 @@ public class NetconfMessageTransformer implements MessageTransformer getActions(final SchemaContext schemaContext) { - final Builder builder = ImmutableSet.builder(); - for (DataSchemaNode dataSchemaNode : schemaContext.getChildNodes()) { - if (dataSchemaNode instanceof ActionNodeContainer) { - findAction(dataSchemaNode, builder); - } - } - return builder.build(); + static List getActions(final SchemaContext schemaContext) { + final List builder = new ArrayList<>(); + findAction(schemaContext, builder); + return builder; } - private static void findAction(final DataSchemaNode dataSchemaNode, final Builder builder) { + private static void findAction(final DataSchemaNode dataSchemaNode, final List builder) { if (dataSchemaNode instanceof ActionNodeContainer) { - final ActionNodeContainer containerSchemaNode = (ActionNodeContainer) dataSchemaNode; - for (ActionDefinition actionDefinition : containerSchemaNode.getActions()) { + for (ActionDefinition actionDefinition : ((ActionNodeContainer) dataSchemaNode).getActions()) { builder.add(actionDefinition); } } @@ -127,6 +124,10 @@ public class NetconfMessageTransformer implements MessageTransformer payload) { - ActionDefinition actionDefinition = null; - for (ActionDefinition actionDef : actions) { - if (actionDef.getPath().getLastComponent().equals(action.getLastComponent())) { - actionDefinition = actionDef; - } - } - Preconditions.checkNotNull(actionDefinition, "Action does not exist: %s", action.getLastComponent()); + final ActionDefinition actionDef = actions.get(action); + Preconditions.checkArgument(actionDef != null, "Action does not exist: %s", action); - final ContainerSchemaNode inputDef = actionDefinition.getInput(); + final ContainerSchemaNode inputDef = actionDef.getInput(); if (inputDef.getChildNodes().isEmpty()) { return new NetconfMessage(NetconfMessageTransformUtil.prepareDomResultForActionRequest( DataSchemaContextTree.from(schemaContext), domDataTreeIdentifier, action, counter, - actionDefinition.getQName().getLocalName()).getNode().getOwnerDocument()); + actionDef.getQName().getLocalName()).getNode().getOwnerDocument()); } - Preconditions.checkNotNull(payload, "Transforming an action with input: %s, payload cannot be null", - action.getLastComponent()); + Preconditions.checkNotNull(payload, "Transforming an action with input: %s, payload cannot be null", action); Preconditions.checkArgument(payload instanceof ContainerNode, - "Transforming an rpc with input: %s, payload has to be a container, but was: %s", - action.getLastComponent(), payload); + "Transforming an action with input: %s, payload has to be a container, but was: %s", action, payload); // Set the path to the input of action for the node stream writer final DOMResult result = NetconfMessageTransformUtil.prepareDomResultForActionRequest( DataSchemaContextTree.from(schemaContext), domDataTreeIdentifier, inputDef.getPath(), counter, - actionDefinition.getQName().getLocalName()); + actionDef.getQName().getLocalName()); try { NetconfMessageTransformUtil.writeNormalizedRpc((ContainerNode) payload, result, inputDef.getPath(), @@ -255,9 +249,7 @@ public class NetconfMessageTransformer implements MessageTransformer qnames = new HashSet<>(Arrays.asList(reset, start, open, enable, kill)); - Set actions = NetconfMessageTransformer.getActions(ACTION_SCHEMA); - assertTrue(!actions.isEmpty()); + Set schemaPaths = new HashSet<>(); + schemaPaths.add(RESET_SERVER_PATH); + schemaPaths.add(START_DEVICE_PATH); + schemaPaths.add(ENABLE_INTERFACE_PATH); + schemaPaths.add(OPEN_BOXES_PATH); + schemaPaths.add(KILL_SERVER_APP_PATH); + schemaPaths.add(XYZZY_FOO_PATH); + schemaPaths.add(XYZZY_BAR_PATH); + schemaPaths.add(CHOICE_ACTION_PATH); + + List actions = NetconfMessageTransformer.getActions(ACTION_SCHEMA); + assertEquals(schemaPaths.size(), actions.size()); for (ActionDefinition actionDefinition : actions) { - QName qname = actionDefinition.getQName(); - assertTrue(qnames.contains(qname)); - qnames.remove(qname); + SchemaPath path = actionDefinition.getPath(); + assertTrue(schemaPaths.remove(path)); } } @Test public void toActionRequestListTopLevelTest() { - QName qname = QName.create(URN_EXAMPLE_SERVER_FARM, REVISION_EXAMPLE_SERVER_FARM, "server"); - QName nameQname = QName.create(qname, "name"); - QName actionResetQName = QName.create(qname, "reset"); + QName nameQname = QName.create(SERVER_QNAME, "name"); List nodeIdentifiers = new ArrayList<>(); - nodeIdentifiers.add(new NodeIdentifier(qname)); - nodeIdentifiers.add(new NodeIdentifierWithPredicates(qname, nameQname, "test")); + nodeIdentifiers.add(new NodeIdentifier(SERVER_QNAME)); + nodeIdentifiers.add(new NodeIdentifierWithPredicates(SERVER_QNAME, nameQname, "test")); DOMDataTreeIdentifier domDataTreeIdentifier = prepareDataTreeId(nodeIdentifiers); - ContainerNode data = initInputAction(QName.create(qname, "reset-at"), "now"); + ContainerNode data = initInputAction(QName.create(SERVER_QNAME, "reset-at"), "now"); NetconfMessage actionRequest = actionNetconfMessageTransformer.toActionRequest( - SchemaPath.create(true, actionResetQName), domDataTreeIdentifier, data); + RESET_SERVER_PATH, domDataTreeIdentifier, data); Node childAction = checkBasePartOfActionRequest(actionRequest); Node childServer = childAction.getFirstChild(); - checkNode(childServer, "server", "server", qname.getNamespace().toString()); + checkNode(childServer, "server", "server", URN_EXAMPLE_SERVER_FARM); Node childName = childServer.getFirstChild(); - checkNode(childName, "name", "name", qname.getNamespace().toString()); + checkNode(childName, "name", "name", URN_EXAMPLE_SERVER_FARM); Node childTest = childName.getFirstChild(); assertEquals(childTest.getNodeValue(), "test"); - checkAction(actionResetQName, childName.getNextSibling(), "reset-at", "reset-at", "now"); + checkAction(RESET_QNAME, childName.getNextSibling(), "reset-at", "reset-at", "now"); } @Test public void toActionRequestContainerTopLevelTest() { - QName qname = QName.create(URN_EXAMPLE_SERVER_FARM, REVISION_EXAMPLE_SERVER_FARM, "device"); - QName actionStartQName = QName.create(qname, "start"); - - List nodeIdentifiers = Collections.singletonList(NodeIdentifier.create(qname)); + List nodeIdentifiers = Collections.singletonList(NodeIdentifier.create(DEVICE_QNAME)); DOMDataTreeIdentifier domDataTreeIdentifier = prepareDataTreeId(nodeIdentifiers); - NormalizedNode payload = initInputAction(QName.create(qname, "start-at"), "now"); + NormalizedNode payload = initInputAction(QName.create(DEVICE_QNAME, "start-at"), "now"); NetconfMessage actionRequest = actionNetconfMessageTransformer.toActionRequest( - SchemaPath.create(true, actionStartQName), domDataTreeIdentifier, payload); + START_DEVICE_PATH, domDataTreeIdentifier, payload); Node childAction = checkBasePartOfActionRequest(actionRequest); Node childDevice = childAction.getFirstChild(); - checkNode(childDevice, "device", "device", qname.getNamespace().toString()); + checkNode(childDevice, "device", "device", URN_EXAMPLE_SERVER_FARM); - checkAction(actionStartQName, childDevice.getFirstChild(), "start-at", "start-at", "now"); + checkAction(START_QNAME, childDevice.getFirstChild(), "start-at", "start-at", "now"); } @Test public void toActionRequestContainerInContainerTest() { - QName boxOutQName = QName.create(URN_EXAMPLE_SERVER_FARM, REVISION_EXAMPLE_SERVER_FARM, "box-out"); - QName boxInQName = QName.create(URN_EXAMPLE_SERVER_FARM, REVISION_EXAMPLE_SERVER_FARM, "box-in"); - QName actionOpenQName = QName.create(boxOutQName, "open"); - List nodeIdentifiers = new ArrayList<>(); - nodeIdentifiers.add(NodeIdentifier.create(boxOutQName)); - nodeIdentifiers.add(NodeIdentifier.create(boxInQName)); + nodeIdentifiers.add(NodeIdentifier.create(BOX_OUT_QNAME)); + nodeIdentifiers.add(NodeIdentifier.create(BOX_IN_QNAME)); DOMDataTreeIdentifier domDataTreeIdentifier = prepareDataTreeId(nodeIdentifiers); - NormalizedNode payload = initInputAction(QName.create(boxOutQName, "start-at"), "now"); + NormalizedNode payload = initInputAction(QName.create(BOX_OUT_QNAME, "start-at"), "now"); NetconfMessage actionRequest = actionNetconfMessageTransformer.toActionRequest( - SchemaPath.create(true, actionOpenQName), domDataTreeIdentifier, payload); + OPEN_BOXES_PATH, domDataTreeIdentifier, payload); Node childAction = checkBasePartOfActionRequest(actionRequest); Node childBoxOut = childAction.getFirstChild(); - checkNode(childBoxOut, "box-out", "box-out", boxOutQName.getNamespace().toString()); + checkNode(childBoxOut, "box-out", "box-out", URN_EXAMPLE_SERVER_FARM); Node childBoxIn = childBoxOut.getFirstChild(); - checkNode(childBoxIn, "box-in", "box-in", boxOutQName.getNamespace().toString()); + checkNode(childBoxIn, "box-in", "box-in", URN_EXAMPLE_SERVER_FARM); Node action = childBoxIn.getFirstChild(); - checkNode(action, null, actionOpenQName.getLocalName(), null); + checkNode(action, null, OPEN_QNAME.getLocalName(), null); } @Test public void toActionRequestListInContainerTest() { - QName qnameDevice = QName.create(URN_EXAMPLE_SERVER_FARM, REVISION_EXAMPLE_SERVER_FARM, "device"); - QName qnameInterface = QName.create(URN_EXAMPLE_SERVER_FARM, REVISION_EXAMPLE_SERVER_FARM, "interface"); - QName nameQname = QName.create(qnameInterface, "name"); - QName actionEnableQName = QName.create(qnameInterface, "enable"); + QName nameQname = QName.create(INTERFACE_QNAME, "name"); List nodeIdentifiers = new ArrayList<>(); - nodeIdentifiers.add(NodeIdentifier.create(qnameDevice)); - nodeIdentifiers.add(NodeIdentifier.create(qnameInterface)); - nodeIdentifiers.add(new NodeIdentifierWithPredicates(qnameInterface, nameQname, "test")); + nodeIdentifiers.add(NodeIdentifier.create(DEVICE_QNAME)); + nodeIdentifiers.add(NodeIdentifier.create(INTERFACE_QNAME)); + nodeIdentifiers.add(new NodeIdentifierWithPredicates(INTERFACE_QNAME, nameQname, "test")); DOMDataTreeIdentifier domDataTreeIdentifier = prepareDataTreeId(nodeIdentifiers); - NormalizedNode payload = initEmptyInputAction(qnameInterface); + NormalizedNode payload = initEmptyInputAction(INTERFACE_QNAME); NetconfMessage actionRequest = actionNetconfMessageTransformer.toActionRequest( - SchemaPath.create(true, actionEnableQName), domDataTreeIdentifier, payload); + ENABLE_INTERFACE_PATH, domDataTreeIdentifier, payload); Node childAction = checkBasePartOfActionRequest(actionRequest); Node childDevice = childAction.getFirstChild(); - checkNode(childDevice, "device", "device", qnameDevice.getNamespace().toString()); + checkNode(childDevice, "device", "device", URN_EXAMPLE_SERVER_FARM); Node childInterface = childDevice.getFirstChild(); - checkNode(childInterface, "interface", "interface", qnameInterface.getNamespace().toString()); + checkNode(childInterface, "interface", "interface", URN_EXAMPLE_SERVER_FARM); Node childName = childInterface.getFirstChild(); checkNode(childName, "name", "name", nameQname.getNamespace().toString()); @@ -539,77 +572,145 @@ public class NetconfMessageTransformerTest { assertEquals(childTest.getNodeValue(), "test"); Node action = childInterface.getLastChild(); - checkNode(action, null, actionEnableQName.getLocalName(), null); + checkNode(action, null, ENABLE_QNAME.getLocalName(), null); } @Test public void toActionRequestListInContainerAugmentedIntoListTest() { - QName qnameServer = QName.create(URN_EXAMPLE_SERVER_FARM, REVISION_EXAMPLE_SERVER_FARM, "server"); - QName serverNameQname = QName.create(qnameServer, "name"); - QName qnameAppliactions = QName.create(URN_EXAMPLE_SERVER_FARM_2, - REVISION_EXAMPLE_SERVER_FARM_2, "applications"); - QName qnameAppliaction = QName.create(URN_EXAMPLE_SERVER_FARM_2, - REVISION_EXAMPLE_SERVER_FARM_2, "application"); - QName applicationNameQname = QName.create(qnameAppliaction, "name"); - QName actionKillQName = QName.create(qnameAppliaction, "kill"); + QName serverNameQname = QName.create(SERVER_QNAME, "name"); + QName applicationNameQname = QName.create(APPLICATION_QNAME, "name"); List nodeIdentifiers = new ArrayList<>(); - nodeIdentifiers.add(NodeIdentifier.create(qnameServer)); - nodeIdentifiers.add(new NodeIdentifierWithPredicates(qnameServer, serverNameQname, "testServer")); + nodeIdentifiers.add(NodeIdentifier.create(SERVER_QNAME)); + nodeIdentifiers.add(new NodeIdentifierWithPredicates(SERVER_QNAME, serverNameQname, "testServer")); nodeIdentifiers.add(new YangInstanceIdentifier - .AugmentationIdentifier(Collections.singleton(qnameAppliactions))); - nodeIdentifiers.add(NodeIdentifier.create(qnameAppliactions)); - nodeIdentifiers.add(NodeIdentifier.create(qnameAppliaction)); - nodeIdentifiers.add(new NodeIdentifierWithPredicates(qnameAppliaction, + .AugmentationIdentifier(Collections.singleton(APPLICATIONS_QNAME))); + nodeIdentifiers.add(NodeIdentifier.create(APPLICATIONS_QNAME)); + nodeIdentifiers.add(NodeIdentifier.create(APPLICATION_QNAME)); + nodeIdentifiers.add(new NodeIdentifierWithPredicates(APPLICATION_QNAME, applicationNameQname, "testApplication")); DOMDataTreeIdentifier domDataTreeIdentifier = prepareDataTreeId(nodeIdentifiers); - NormalizedNode payload = initEmptyInputAction(qnameAppliaction); + NormalizedNode payload = initEmptyInputAction(APPLICATION_QNAME); NetconfMessage actionRequest = actionNetconfMessageTransformer.toActionRequest( - SchemaPath.create(true, actionKillQName), domDataTreeIdentifier, payload); + KILL_SERVER_APP_PATH, domDataTreeIdentifier, payload); Node childAction = checkBasePartOfActionRequest(actionRequest); Node childServer = childAction.getFirstChild(); - checkNode(childServer, "server", "server", qnameServer.getNamespace().toString()); + checkNode(childServer, "server", "server", URN_EXAMPLE_SERVER_FARM); Node childServerName = childServer.getFirstChild(); - checkNode(childServerName, "name", "name", serverNameQname.getNamespace().toString()); + checkNode(childServerName, "name", "name", URN_EXAMPLE_SERVER_FARM); Node childServerNameTest = childServerName.getFirstChild(); assertEquals(childServerNameTest.getNodeValue(), "testServer"); Node childApplications = childServer.getLastChild(); - checkNode(childApplications, "applications", "applications", qnameAppliactions.getNamespace().toString()); + checkNode(childApplications, "applications", "applications", URN_EXAMPLE_SERVER_FARM_2); Node childApplication = childApplications.getFirstChild(); - checkNode(childApplication, "application", "application", qnameAppliaction.getNamespace().toString()); + checkNode(childApplication, "application", "application", URN_EXAMPLE_SERVER_FARM_2); Node childApplicationName = childApplication.getFirstChild(); - checkNode(childApplicationName, "name", "name", applicationNameQname.getNamespace().toString()); + checkNode(childApplicationName, "name", "name", URN_EXAMPLE_SERVER_FARM_2); Node childApplicationNameTest = childApplicationName.getFirstChild(); assertEquals(childApplicationNameTest.getNodeValue(), "testApplication"); Node childKillAction = childApplication.getLastChild(); - checkNode(childApplication, "application", "application", qnameAppliaction.getNamespace().toString()); - checkNode(childKillAction, null, actionKillQName.getLocalName(), null); + checkNode(childApplication, "application", "application", URN_EXAMPLE_SERVER_FARM_2); + checkNode(childKillAction, null, KILL_QNAME.getLocalName(), null); + } + + @Test + public void toActionRequestConflictingInListTest() { + QName barInputQname = QName.create(BAR_QNAME, "bar"); + QName barIdQname = QName.create(BAR_QNAME, "bar-id"); + Byte barInput = new Byte("1"); + + List nodeIdentifiers = new ArrayList<>(); + nodeIdentifiers.add(NodeIdentifier.create(BAR_QNAME)); + nodeIdentifiers.add(new NodeIdentifierWithPredicates(BAR_QNAME, barIdQname, "test")); + + DOMDataTreeIdentifier domDataTreeIdentifier = prepareDataTreeId(nodeIdentifiers); + + ImmutableLeafNodeBuilder immutableLeafNodeBuilder = new ImmutableLeafNodeBuilder<>(); + DataContainerChild build = immutableLeafNodeBuilder.withNodeIdentifier( + NodeIdentifier.create(barInputQname)).withValue(barInput).build(); + NormalizedNode payload = ImmutableContainerNodeBuilder.create().withNodeIdentifier(NodeIdentifier.create( + QName.create(barInputQname, "input"))).withChild(build).build(); + + NetconfMessage actionRequest = actionNetconfMessageTransformer.toActionRequest( + XYZZY_BAR_PATH, domDataTreeIdentifier, payload); + + Node childAction = checkBasePartOfActionRequest(actionRequest); + + Node childBar = childAction.getFirstChild(); + checkNode(childBar, "bar", "bar", URN_EXAMPLE_CONFLICT); + + Node childBarId = childBar.getFirstChild(); + checkNode(childBarId, "bar-id", "bar-id", URN_EXAMPLE_CONFLICT); + + Node childTest = childBarId.getFirstChild(); + assertEquals(childTest.getNodeValue(), "test"); + + Node action = childBar.getLastChild(); + checkNode(action, null, XYZZY_QNAME.getLocalName(), null); + } + + @Test + public void toActionRequestConflictingInContainerTest() { + QName fooInputQname = QName.create(FOO_QNAME, "foo"); + + List nodeIdentifiers = new ArrayList<>(); + nodeIdentifiers.add(NodeIdentifier.create(FOO_QNAME)); + DOMDataTreeIdentifier domDataTreeIdentifier = prepareDataTreeId(nodeIdentifiers); + NormalizedNode payload = initInputAction(fooInputQname, "test"); + + NetconfMessage actionRequest = actionNetconfMessageTransformer.toActionRequest( + XYZZY_FOO_PATH, domDataTreeIdentifier, payload); + + Node childAction = checkBasePartOfActionRequest(actionRequest); + + Node childBar = childAction.getFirstChild(); + checkNode(childBar, "foo", "foo", URN_EXAMPLE_CONFLICT); + + Node action = childBar.getLastChild(); + checkNode(action, null, XYZZY_QNAME.getLocalName(), null); + } + + @Test + @Ignore + public void toActionRequestChoiceTest() { + List nodeIdentifiers = new ArrayList<>(); + nodeIdentifiers.add(NodeIdentifier.create(CHOICE_CONT_QNAME)); + DOMDataTreeIdentifier domDataTreeIdentifier = prepareDataTreeId(nodeIdentifiers); + NormalizedNode payload = initEmptyInputAction(CHOICE_ACTION_QNAME); + + NetconfMessage actionRequest = actionNetconfMessageTransformer.toActionRequest( + CHOICE_ACTION_PATH, domDataTreeIdentifier, payload); + + Node childAction = checkBasePartOfActionRequest(actionRequest); + + Node childChoiceCont = childAction.getFirstChild(); + checkNode(childChoiceCont, "choice-cont", "choice-cont", URN_EXAMPLE_CONFLICT); + + Node action = childChoiceCont.getLastChild(); + checkNode(action, null, CHOICE_ACTION_QNAME.getLocalName(), null); } @SuppressWarnings({ "rawtypes", "unchecked" }) @Test public void toActionResultTest() throws Exception { - QName qname = QName.create(URN_EXAMPLE_SERVER_FARM, REVISION_EXAMPLE_SERVER_FARM, "reset"); - NetconfMessage message = new NetconfMessage(XmlUtil.readXmlToDocument( "" + "" + "now" + "" + "")); - DOMActionResult actionResult = actionNetconfMessageTransformer.toActionResult( - SchemaPath.create(true, qname), message); + DOMActionResult actionResult = actionNetconfMessageTransformer.toActionResult(RESET_SERVER_PATH, message); assertNotNull(actionResult); ContainerNode containerNode = actionResult.getOutput().get(); assertNotNull(containerNode); diff --git a/netconf/sal-netconf-connector/src/test/resources/schemas/conflicting-actions.yang b/netconf/sal-netconf-connector/src/test/resources/schemas/conflicting-actions.yang new file mode 100644 index 0000000000..1505541460 --- /dev/null +++ b/netconf/sal-netconf-connector/src/test/resources/schemas/conflicting-actions.yang @@ -0,0 +1,35 @@ +module conflicting-actions { + yang-version 1.1; + namespace "urn:example:conflict"; + prefix "conflict"; + + container foo { + action xyzzy { + input { + leaf foo { + type string; + } + } + } + } + + list bar { + key "bar-id"; + leaf bar-id { + type string; + } + action xyzzy { + input { + leaf bar { + type int8; + } + } + } + } + + choice conflict-choice { + container choice-cont { + action choice-action; + } + } +} \ No newline at end of file