modules CHANGE move schemas to tests
... because they are not needed anywhere else.
diff --git a/tests/data/modules/ietf-netconf-acm.yin b/tests/data/modules/ietf-netconf-acm.yin
new file mode 100644
index 0000000..3257406
--- /dev/null
+++ b/tests/data/modules/ietf-netconf-acm.yin
@@ -0,0 +1,464 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module name="ietf-netconf-acm"
+ xmlns="urn:ietf:params:xml:ns:yang:yin:1"
+ xmlns:nacm="urn:ietf:params:xml:ns:yang:ietf-netconf-acm"
+ xmlns:yang="urn:ietf:params:xml:ns:yang:ietf-yang-types">
+ <namespace uri="urn:ietf:params:xml:ns:yang:ietf-netconf-acm"/>
+ <prefix value="nacm"/>
+ <import module="ietf-yang-types">
+ <prefix value="yang"/>
+ </import>
+ <organization>
+ <text>IETF NETCONF (Network Configuration) Working Group</text>
+ </organization>
+ <contact>
+ <text>WG Web: <https://datatracker.ietf.org/wg/netconf/>
+WG List: <mailto:netconf@ietf.org>
+
+Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com></text>
+ </contact>
+ <description>
+ <text>Network Configuration Access Control Model.
+
+Copyright (c) 2012 - 2018 IETF Trust and the persons
+identified as authors of the code. All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, is permitted pursuant to, and subject
+to the license terms contained in, the Simplified BSD
+License set forth in Section 4.c of the IETF Trust's
+Legal Provisions Relating to IETF Documents
+(https://trustee.ietf.org/license-info).
+
+This version of this YANG module is part of RFC 8341; see
+the RFC itself for full legal notices.</text>
+ </description>
+ <revision date="2018-02-14">
+ <description>
+ <text>Added support for YANG 1.1 actions and notifications tied to
+data nodes. Clarified how NACM extensions can be used by
+other data models.</text>
+ </description>
+ <reference>
+ <text>RFC 8341: Network Configuration Access Control Model</text>
+ </reference>
+ </revision>
+ <revision date="2012-02-22">
+ <description>
+ <text>Initial version.</text>
+ </description>
+ <reference>
+ <text>RFC 6536: Network Configuration Protocol (NETCONF)
+ Access Control Model</text>
+ </reference>
+ </revision>
+ <extension name="default-deny-write">
+ <description>
+ <text>Used to indicate that the data model node
+represents a sensitive security system parameter.
+
+If present, the NETCONF server will only allow the designated
+'recovery session' to have write access to the node. An
+explicit access control rule is required for all other users.
+
+If the NACM module is used, then it must be enabled (i.e.,
+/nacm/enable-nacm object equals 'true'), or this extension
+is ignored.
+
+The 'default-deny-write' extension MAY appear within a data
+definition statement. It is ignored otherwise.</text>
+ </description>
+ </extension>
+ <extension name="default-deny-all">
+ <description>
+ <text>Used to indicate that the data model node
+controls a very sensitive security system parameter.
+
+If present, the NETCONF server will only allow the designated
+'recovery session' to have read, write, or execute access to
+the node. An explicit access control rule is required for all
+other users.
+
+If the NACM module is used, then it must be enabled (i.e.,
+/nacm/enable-nacm object equals 'true'), or this extension
+is ignored.
+
+The 'default-deny-all' extension MAY appear within a data
+definition statement, 'rpc' statement, or 'notification'
+statement. It is ignored otherwise.</text>
+ </description>
+ </extension>
+ <typedef name="user-name-type">
+ <type name="string">
+ <length value="1..max"/>
+ </type>
+ <description>
+ <text>General-purpose username string.</text>
+ </description>
+ </typedef>
+ <typedef name="matchall-string-type">
+ <type name="string">
+ <pattern value="\*"/>
+ </type>
+ <description>
+ <text>The string containing a single asterisk '*' is used
+to conceptually represent all possible values
+for the particular leaf using this data type.</text>
+ </description>
+ </typedef>
+ <typedef name="access-operations-type">
+ <type name="bits">
+ <bit name="create">
+ <description>
+ <text>Any protocol operation that creates a
+new data node.</text>
+ </description>
+ </bit>
+ <bit name="read">
+ <description>
+ <text>Any protocol operation or notification that
+returns the value of a data node.</text>
+ </description>
+ </bit>
+ <bit name="update">
+ <description>
+ <text>Any protocol operation that alters an existing
+data node.</text>
+ </description>
+ </bit>
+ <bit name="delete">
+ <description>
+ <text>Any protocol operation that removes a data node.</text>
+ </description>
+ </bit>
+ <bit name="exec">
+ <description>
+ <text>Execution access to the specified protocol operation.</text>
+ </description>
+ </bit>
+ </type>
+ <description>
+ <text>Access operation.</text>
+ </description>
+ </typedef>
+ <typedef name="group-name-type">
+ <type name="string">
+ <length value="1..max"/>
+ <pattern value="[^\*].*"/>
+ </type>
+ <description>
+ <text>Name of administrative group to which
+users can be assigned.</text>
+ </description>
+ </typedef>
+ <typedef name="action-type">
+ <type name="enumeration">
+ <enum name="permit">
+ <description>
+ <text>Requested action is permitted.</text>
+ </description>
+ </enum>
+ <enum name="deny">
+ <description>
+ <text>Requested action is denied.</text>
+ </description>
+ </enum>
+ </type>
+ <description>
+ <text>Action taken by the server when a particular
+rule matches.</text>
+ </description>
+ </typedef>
+ <typedef name="node-instance-identifier">
+ <type name="yang:xpath1.0"/>
+ <description>
+ <text>Path expression used to represent a special
+data node, action, or notification instance-identifier
+string.
+
+A node-instance-identifier value is an
+unrestricted YANG instance-identifier expression.
+All the same rules as an instance-identifier apply,
+except that predicates for keys are optional. If a key
+predicate is missing, then the node-instance-identifier
+represents all possible server instances for that key.
+
+This XML Path Language (XPath) expression is evaluated in the
+following context:
+
+ o The set of namespace declarations are those in scope on
+ the leaf element where this type is used.
+
+ o The set of variable bindings contains one variable,
+ 'USER', which contains the name of the user of the
+ current session.
+
+ o The function library is the core function library, but
+ note that due to the syntax restrictions of an
+ instance-identifier, no functions are allowed.
+
+ o The context node is the root node in the data tree.
+
+The accessible tree includes actions and notifications tied
+to data nodes.</text>
+ </description>
+ </typedef>
+ <container name="nacm">
+ <nacm:default-deny-all/>
+ <description>
+ <text>Parameters for NETCONF access control model.</text>
+ </description>
+ <leaf name="enable-nacm">
+ <type name="boolean"/>
+ <default value="true"/>
+ <description>
+ <text>Enables or disables all NETCONF access control
+enforcement. If 'true', then enforcement
+is enabled. If 'false', then enforcement
+is disabled.</text>
+ </description>
+ </leaf>
+ <leaf name="read-default">
+ <type name="action-type"/>
+ <default value="permit"/>
+ <description>
+ <text>Controls whether read access is granted if
+no appropriate rule is found for a
+particular read request.</text>
+ </description>
+ </leaf>
+ <leaf name="write-default">
+ <type name="action-type"/>
+ <default value="deny"/>
+ <description>
+ <text>Controls whether create, update, or delete access
+is granted if no appropriate rule is found for a
+particular write request.</text>
+ </description>
+ </leaf>
+ <leaf name="exec-default">
+ <type name="action-type"/>
+ <default value="permit"/>
+ <description>
+ <text>Controls whether exec access is granted if no appropriate
+rule is found for a particular protocol operation request.</text>
+ </description>
+ </leaf>
+ <leaf name="enable-external-groups">
+ <type name="boolean"/>
+ <default value="true"/>
+ <description>
+ <text>Controls whether the server uses the groups reported by the
+NETCONF transport layer when it assigns the user to a set of
+NACM groups. If this leaf has the value 'false', any group
+names reported by the transport layer are ignored by the
+server.</text>
+ </description>
+ </leaf>
+ <leaf name="denied-operations">
+ <type name="yang:zero-based-counter32"/>
+ <config value="false"/>
+ <mandatory value="true"/>
+ <description>
+ <text>Number of times since the server last restarted that a
+protocol operation request was denied.</text>
+ </description>
+ </leaf>
+ <leaf name="denied-data-writes">
+ <type name="yang:zero-based-counter32"/>
+ <config value="false"/>
+ <mandatory value="true"/>
+ <description>
+ <text>Number of times since the server last restarted that a
+protocol operation request to alter
+a configuration datastore was denied.</text>
+ </description>
+ </leaf>
+ <leaf name="denied-notifications">
+ <type name="yang:zero-based-counter32"/>
+ <config value="false"/>
+ <mandatory value="true"/>
+ <description>
+ <text>Number of times since the server last restarted that
+a notification was dropped for a subscription because
+access to the event type was denied.</text>
+ </description>
+ </leaf>
+ <container name="groups">
+ <description>
+ <text>NETCONF access control groups.</text>
+ </description>
+ <list name="group">
+ <key value="name"/>
+ <description>
+ <text>One NACM group entry. This list will only contain
+configured entries, not any entries learned from
+any transport protocols.</text>
+ </description>
+ <leaf name="name">
+ <type name="group-name-type"/>
+ <description>
+ <text>Group name associated with this entry.</text>
+ </description>
+ </leaf>
+ <leaf-list name="user-name">
+ <type name="user-name-type"/>
+ <description>
+ <text>Each entry identifies the username of
+a member of the group associated with
+this entry.</text>
+ </description>
+ </leaf-list>
+ </list>
+ </container>
+ <list name="rule-list">
+ <key value="name"/>
+ <ordered-by value="user"/>
+ <description>
+ <text>An ordered collection of access control rules.</text>
+ </description>
+ <leaf name="name">
+ <type name="string">
+ <length value="1..max"/>
+ </type>
+ <description>
+ <text>Arbitrary name assigned to the rule-list.</text>
+ </description>
+ </leaf>
+ <leaf-list name="group">
+ <type name="union">
+ <type name="matchall-string-type"/>
+ <type name="group-name-type"/>
+ </type>
+ <description>
+ <text>List of administrative groups that will be
+assigned the associated access rights
+defined by the 'rule' list.
+
+The string '*' indicates that all groups apply to the
+entry.</text>
+ </description>
+ </leaf-list>
+ <list name="rule">
+ <key value="name"/>
+ <ordered-by value="user"/>
+ <description>
+ <text>One access control rule.
+
+Rules are processed in user-defined order until a match is
+found. A rule matches if 'module-name', 'rule-type', and
+'access-operations' match the request. If a rule
+matches, the 'action' leaf determines whether or not
+access is granted.</text>
+ </description>
+ <leaf name="name">
+ <type name="string">
+ <length value="1..max"/>
+ </type>
+ <description>
+ <text>Arbitrary name assigned to the rule.</text>
+ </description>
+ </leaf>
+ <leaf name="module-name">
+ <type name="union">
+ <type name="matchall-string-type"/>
+ <type name="string"/>
+ </type>
+ <default value="*"/>
+ <description>
+ <text>Name of the module associated with this rule.
+
+This leaf matches if it has the value '*' or if the
+object being accessed is defined in the module with the
+specified module name.</text>
+ </description>
+ </leaf>
+ <choice name="rule-type">
+ <description>
+ <text>This choice matches if all leafs present in the rule
+match the request. If no leafs are present, the
+choice matches all requests.</text>
+ </description>
+ <case name="protocol-operation">
+ <leaf name="rpc-name">
+ <type name="union">
+ <type name="matchall-string-type"/>
+ <type name="string"/>
+ </type>
+ <description>
+ <text>This leaf matches if it has the value '*' or if
+its value equals the requested protocol operation
+name.</text>
+ </description>
+ </leaf>
+ </case>
+ <case name="notification">
+ <leaf name="notification-name">
+ <type name="union">
+ <type name="matchall-string-type"/>
+ <type name="string"/>
+ </type>
+ <description>
+ <text>This leaf matches if it has the value '*' or if its
+value equals the requested notification name.</text>
+ </description>
+ </leaf>
+ </case>
+ <case name="data-node">
+ <leaf name="path">
+ <type name="node-instance-identifier"/>
+ <mandatory value="true"/>
+ <description>
+ <text>Data node instance-identifier associated with the
+data node, action, or notification controlled by
+this rule.
+
+Configuration data or state data
+instance-identifiers start with a top-level
+data node. A complete instance-identifier is
+required for this type of path value.
+
+The special value '/' refers to all possible
+datastore contents.</text>
+ </description>
+ </leaf>
+ </case>
+ </choice>
+ <leaf name="access-operations">
+ <type name="union">
+ <type name="matchall-string-type"/>
+ <type name="access-operations-type"/>
+ </type>
+ <default value="*"/>
+ <description>
+ <text>Access operations associated with this rule.
+
+This leaf matches if it has the value '*' or if the
+bit corresponding to the requested operation is set.</text>
+ </description>
+ </leaf>
+ <leaf name="action">
+ <type name="action-type"/>
+ <mandatory value="true"/>
+ <description>
+ <text>The access control action associated with the
+rule. If a rule has been determined to match a
+particular request, then this object is used
+to determine whether to permit or deny the
+request.</text>
+ </description>
+ </leaf>
+ <leaf name="comment">
+ <type name="string"/>
+ <description>
+ <text>A textual description of the access rule.</text>
+ </description>
+ </leaf>
+ </list>
+ </list>
+ </container>
+</module>
diff --git a/tests/data/modules/ietf-netconf-monitoring.yin b/tests/data/modules/ietf-netconf-monitoring.yin
new file mode 100644
index 0000000..1f99694
--- /dev/null
+++ b/tests/data/modules/ietf-netconf-monitoring.yin
@@ -0,0 +1,600 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module name="ietf-netconf-monitoring"
+ xmlns="urn:ietf:params:xml:ns:yang:yin:1"
+ xmlns:ncm="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"
+ xmlns:yang="urn:ietf:params:xml:ns:yang:ietf-yang-types"
+ xmlns:inet="urn:ietf:params:xml:ns:yang:ietf-inet-types">
+ <namespace uri="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"/>
+ <prefix value="ncm"/>
+ <import module="ietf-yang-types">
+ <prefix value="yang"/>
+ </import>
+ <import module="ietf-inet-types">
+ <prefix value="inet"/>
+ </import>
+ <organization>
+ <text>IETF NETCONF (Network Configuration) Working Group</text>
+ </organization>
+ <contact>
+ <text>WG Web: <http://tools.ietf.org/wg/netconf/>
+WG List: <mailto:netconf@ietf.org>
+
+WG Chair: Mehmet Ersue
+ <mailto:mehmet.ersue@nsn.com>
+
+WG Chair: Bert Wijnen
+ <mailto:bertietf@bwijnen.net>
+
+Editor: Mark Scott
+ <mailto:mark.scott@ericsson.com>
+
+Editor: Martin Bjorklund
+ <mailto:mbj@tail-f.com></text>
+ </contact>
+ <description>
+ <text>NETCONF Monitoring Module.
+All elements in this module are read-only.
+
+Copyright (c) 2010 IETF Trust and the persons identified as
+authors of the code. All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, is permitted pursuant to, and subject
+to the license terms contained in, the Simplified BSD
+License set forth in Section 4.c of the IETF Trust's
+Legal Provisions Relating to IETF Documents
+(http://trustee.ietf.org/license-info).
+
+This version of this YANG module is part of RFC 6022; see
+the RFC itself for full legal notices.</text>
+ </description>
+ <revision date="2010-10-04">
+ <description>
+ <text>Initial revision.</text>
+ </description>
+ <reference>
+ <text>RFC 6022: YANG Module for NETCONF Monitoring</text>
+ </reference>
+ </revision>
+ <typedef name="netconf-datastore-type">
+ <type name="enumeration">
+ <enum name="running"/>
+ <enum name="candidate"/>
+ <enum name="startup"/>
+ </type>
+ <description>
+ <text>Enumeration of possible NETCONF datastore types.</text>
+ </description>
+ <reference>
+ <text>RFC 4741: NETCONF Configuration Protocol</text>
+ </reference>
+ </typedef>
+ <identity name="transport">
+ <description>
+ <text>Base identity for NETCONF transport types.</text>
+ </description>
+ </identity>
+ <identity name="netconf-ssh">
+ <base name="transport"/>
+ <description>
+ <text>NETCONF over Secure Shell (SSH).</text>
+ </description>
+ <reference>
+ <text>RFC 4742: Using the NETCONF Configuration Protocol
+ over Secure SHell (SSH)</text>
+ </reference>
+ </identity>
+ <identity name="netconf-soap-over-beep">
+ <base name="transport"/>
+ <description>
+ <text>NETCONF over Simple Object Access Protocol (SOAP) over
+Blocks Extensible Exchange Protocol (BEEP).</text>
+ </description>
+ <reference>
+ <text>RFC 4743: Using NETCONF over the Simple Object
+ Access Protocol (SOAP)</text>
+ </reference>
+ </identity>
+ <identity name="netconf-soap-over-https">
+ <base name="transport"/>
+ <description>
+ <text>NETCONF over Simple Object Access Protocol (SOAP)
+over Hypertext Transfer Protocol Secure (HTTPS).</text>
+ </description>
+ <reference>
+ <text>RFC 4743: Using NETCONF over the Simple Object
+ Access Protocol (SOAP)</text>
+ </reference>
+ </identity>
+ <identity name="netconf-beep">
+ <base name="transport"/>
+ <description>
+ <text>NETCONF over Blocks Extensible Exchange Protocol (BEEP).</text>
+ </description>
+ <reference>
+ <text>RFC 4744: Using the NETCONF Protocol over the
+ Blocks Extensible Exchange Protocol (BEEP)</text>
+ </reference>
+ </identity>
+ <identity name="netconf-tls">
+ <base name="transport"/>
+ <description>
+ <text>NETCONF over Transport Layer Security (TLS).</text>
+ </description>
+ <reference>
+ <text>RFC 5539: NETCONF over Transport Layer Security (TLS)</text>
+ </reference>
+ </identity>
+ <identity name="schema-format">
+ <description>
+ <text>Base identity for data model schema languages.</text>
+ </description>
+ </identity>
+ <identity name="xsd">
+ <base name="schema-format"/>
+ <description>
+ <text>W3C XML Schema Definition.</text>
+ </description>
+ <reference>
+ <text>W3C REC REC-xmlschema-1-20041028:
+ XML Schema Part 1: Structures</text>
+ </reference>
+ </identity>
+ <identity name="yang">
+ <base name="schema-format"/>
+ <description>
+ <text>The YANG data modeling language for NETCONF.</text>
+ </description>
+ <reference>
+ <text>RFC 6020: YANG - A Data Modeling Language for the
+ Network Configuration Protocol (NETCONF)</text>
+ </reference>
+ </identity>
+ <identity name="yin">
+ <base name="schema-format"/>
+ <description>
+ <text>The YIN syntax for YANG.</text>
+ </description>
+ <reference>
+ <text>RFC 6020: YANG - A Data Modeling Language for the
+ Network Configuration Protocol (NETCONF)</text>
+ </reference>
+ </identity>
+ <identity name="rng">
+ <base name="schema-format"/>
+ <description>
+ <text>Regular Language for XML Next Generation (RELAX NG).</text>
+ </description>
+ <reference>
+ <text>ISO/IEC 19757-2:2008: RELAX NG</text>
+ </reference>
+ </identity>
+ <identity name="rnc">
+ <base name="schema-format"/>
+ <description>
+ <text>Relax NG Compact Syntax</text>
+ </description>
+ <reference>
+ <text>ISO/IEC 19757-2:2008: RELAX NG</text>
+ </reference>
+ </identity>
+ <grouping name="common-counters">
+ <description>
+ <text>Counters that exist both per session, and also globally,
+accumulated from all sessions.</text>
+ </description>
+ <leaf name="in-rpcs">
+ <type name="yang:zero-based-counter32"/>
+ <description>
+ <text>Number of correct <rpc> messages received.</text>
+ </description>
+ </leaf>
+ <leaf name="in-bad-rpcs">
+ <type name="yang:zero-based-counter32"/>
+ <description>
+ <text>Number of messages received when an <rpc> message was expected,
+that were not correct <rpc> messages. This includes XML parse
+errors and errors on the rpc layer.</text>
+ </description>
+ </leaf>
+ <leaf name="out-rpc-errors">
+ <type name="yang:zero-based-counter32"/>
+ <description>
+ <text>Number of <rpc-reply> messages sent that contained an
+<rpc-error> element.</text>
+ </description>
+ </leaf>
+ <leaf name="out-notifications">
+ <type name="yang:zero-based-counter32"/>
+ <description>
+ <text>Number of <notification> messages sent.</text>
+ </description>
+ </leaf>
+ </grouping>
+ <container name="netconf-state">
+ <config value="false"/>
+ <description>
+ <text>The netconf-state container is the root of the monitoring
+data model.</text>
+ </description>
+ <container name="capabilities">
+ <description>
+ <text>Contains the list of NETCONF capabilities supported by the
+server.</text>
+ </description>
+ <leaf-list name="capability">
+ <type name="inet:uri"/>
+ <description>
+ <text>List of NETCONF capabilities supported by the server.</text>
+ </description>
+ </leaf-list>
+ </container>
+ <container name="datastores">
+ <description>
+ <text>Contains the list of NETCONF configuration datastores.</text>
+ </description>
+ <list name="datastore">
+ <key value="name"/>
+ <description>
+ <text>List of NETCONF configuration datastores supported by
+the NETCONF server and related information.</text>
+ </description>
+ <leaf name="name">
+ <type name="netconf-datastore-type"/>
+ <description>
+ <text>Name of the datastore associated with this list entry.</text>
+ </description>
+ </leaf>
+ <container name="locks">
+ <presence value="This container is present only if the datastore is locked."/>
+ <description>
+ <text>The NETCONF <lock> and <partial-lock> operations allow
+a client to lock specific resources in a datastore. The
+NETCONF server will prevent changes to the locked
+resources by all sessions except the one that acquired
+the lock(s).
+
+Monitoring information is provided for each datastore
+entry including details such as the session that acquired
+the lock, the type of lock (global or partial) and the
+list of locked resources. Multiple locks per datastore
+are supported.</text>
+ </description>
+ <grouping name="lock-info">
+ <description>
+ <text>Lock related parameters, common to both global and
+partial locks.</text>
+ </description>
+ <leaf name="locked-by-session">
+ <type name="uint32"/>
+ <mandatory value="true"/>
+ <description>
+ <text>The session ID of the session that has locked
+this resource. Both a global lock and a partial
+lock MUST contain the NETCONF session-id.
+
+If the lock is held by a session that is not managed
+by the NETCONF server (e.g., a CLI session), a session
+id of 0 (zero) is reported.</text>
+ </description>
+ <reference>
+ <text>RFC 4741: NETCONF Configuration Protocol</text>
+ </reference>
+ </leaf>
+ <leaf name="locked-time">
+ <type name="yang:date-and-time"/>
+ <mandatory value="true"/>
+ <description>
+ <text>The date and time of when the resource was
+locked.</text>
+ </description>
+ </leaf>
+ </grouping>
+ <choice name="lock-type">
+ <description>
+ <text>Indicates if a global lock or a set of partial locks
+are set.</text>
+ </description>
+ <container name="global-lock">
+ <description>
+ <text>Present if the global lock is set.</text>
+ </description>
+ <uses name="lock-info"/>
+ </container>
+ <list name="partial-lock">
+ <key value="lock-id"/>
+ <description>
+ <text>List of partial locks.</text>
+ </description>
+ <reference>
+ <text>RFC 5717: Partial Lock Remote Procedure Call (RPC) for
+ NETCONF</text>
+ </reference>
+ <leaf name="lock-id">
+ <type name="uint32"/>
+ <description>
+ <text>This is the lock id returned in the <partial-lock>
+response.</text>
+ </description>
+ </leaf>
+ <uses name="lock-info"/>
+ <leaf-list name="select">
+ <type name="yang:xpath1.0"/>
+ <min-elements value="1"/>
+ <description>
+ <text>The xpath expression that was used to request
+the lock. The select expression indicates the
+original intended scope of the lock.</text>
+ </description>
+ </leaf-list>
+ <leaf-list name="locked-node">
+ <type name="instance-identifier"/>
+ <description>
+ <text>The list of instance-identifiers (i.e., the
+locked nodes).
+
+The scope of the partial lock is defined by the list
+of locked nodes.</text>
+ </description>
+ </leaf-list>
+ </list>
+ </choice>
+ </container>
+ </list>
+ </container>
+ <container name="schemas">
+ <description>
+ <text>Contains the list of data model schemas supported by the
+server.</text>
+ </description>
+ <list name="schema">
+ <key value="identifier version format"/>
+ <description>
+ <text>List of data model schemas supported by the server.</text>
+ </description>
+ <leaf name="identifier">
+ <type name="string"/>
+ <description>
+ <text>Identifier to uniquely reference the schema. The
+identifier is used in the <get-schema> operation and may
+be used for other purposes such as file retrieval.
+
+For modeling languages that support or require a data
+model name (e.g., YANG module name) the identifier MUST
+match that name. For YANG data models, the identifier is
+the name of the module or submodule. In other cases, an
+identifier such as a filename MAY be used instead.</text>
+ </description>
+ </leaf>
+ <leaf name="version">
+ <type name="string"/>
+ <description>
+ <text>Version of the schema supported. Multiple versions MAY be
+supported simultaneously by a NETCONF server. Each
+version MUST be reported individually in the schema list,
+i.e., with same identifier, possibly different location,
+but different version.
+
+For YANG data models, version is the value of the most
+recent YANG 'revision' statement in the module or
+submodule, or the empty string if no 'revision' statement
+is present.</text>
+ </description>
+ </leaf>
+ <leaf name="format">
+ <type name="identityref">
+ <base name="schema-format"/>
+ </type>
+ <description>
+ <text>The data modeling language the schema is written
+in (currently xsd, yang, yin, rng, or rnc).
+For YANG data models, 'yang' format MUST be supported and
+'yin' format MAY also be provided.</text>
+ </description>
+ </leaf>
+ <leaf name="namespace">
+ <type name="inet:uri"/>
+ <mandatory value="true"/>
+ <description>
+ <text>The XML namespace defined by the data model.
+
+For YANG data models, this is the module's namespace.
+If the list entry describes a submodule, this field
+contains the namespace of the module to which the
+submodule belongs.</text>
+ </description>
+ </leaf>
+ <leaf-list name="location">
+ <type name="union">
+ <type name="enumeration">
+ <enum name="NETCONF"/>
+ </type>
+ <type name="inet:uri"/>
+ </type>
+ <description>
+ <text>One or more locations from which the schema can be
+retrieved. This list SHOULD contain at least one
+entry per schema.
+
+A schema entry may be located on a remote file system
+(e.g., reference to file system for ftp retrieval) or
+retrieved directly from a server supporting the
+<get-schema> operation (denoted by the value 'NETCONF').</text>
+ </description>
+ </leaf-list>
+ </list>
+ </container>
+ <container name="sessions">
+ <description>
+ <text>The sessions container includes session-specific data for
+NETCONF management sessions. The session list MUST include
+all currently active NETCONF sessions.</text>
+ </description>
+ <list name="session">
+ <key value="session-id"/>
+ <description>
+ <text>All NETCONF sessions managed by the NETCONF server
+MUST be reported in this list.</text>
+ </description>
+ <leaf name="session-id">
+ <type name="uint32">
+ <range value="1..max"/>
+ </type>
+ <description>
+ <text>Unique identifier for the session. This value is the
+NETCONF session identifier, as defined in RFC 4741.</text>
+ </description>
+ <reference>
+ <text>RFC 4741: NETCONF Configuration Protocol</text>
+ </reference>
+ </leaf>
+ <leaf name="transport">
+ <type name="identityref">
+ <base name="transport"/>
+ </type>
+ <mandatory value="true"/>
+ <description>
+ <text>Identifies the transport for each session, e.g.,
+'netconf-ssh', 'netconf-soap', etc.</text>
+ </description>
+ </leaf>
+ <leaf name="username">
+ <type name="string"/>
+ <mandatory value="true"/>
+ <description>
+ <text>The username is the client identity that was authenticated
+by the NETCONF transport protocol. The algorithm used to
+derive the username is NETCONF transport protocol specific
+and in addition specific to the authentication mechanism
+used by the NETCONF transport protocol.</text>
+ </description>
+ </leaf>
+ <leaf name="source-host">
+ <type name="inet:host"/>
+ <description>
+ <text>Host identifier of the NETCONF client. The value
+returned is implementation specific (e.g., hostname,
+IPv4 address, IPv6 address)</text>
+ </description>
+ </leaf>
+ <leaf name="login-time">
+ <type name="yang:date-and-time"/>
+ <mandatory value="true"/>
+ <description>
+ <text>Time at the server at which the session was established.</text>
+ </description>
+ </leaf>
+ <uses name="common-counters">
+ <description>
+ <text>Per-session counters. Zero based with following reset
+behaviour:
+ - at start of a session
+ - when max value is reached</text>
+ </description>
+ </uses>
+ </list>
+ </container>
+ <container name="statistics">
+ <description>
+ <text>Statistical data pertaining to the NETCONF server.</text>
+ </description>
+ <leaf name="netconf-start-time">
+ <type name="yang:date-and-time"/>
+ <description>
+ <text>Date and time at which the management subsystem was
+started.</text>
+ </description>
+ </leaf>
+ <leaf name="in-bad-hellos">
+ <type name="yang:zero-based-counter32"/>
+ <description>
+ <text>Number of sessions silently dropped because an
+invalid <hello> message was received. This includes <hello>
+messages with a 'session-id' attribute, bad namespace, and
+bad capability declarations.</text>
+ </description>
+ </leaf>
+ <leaf name="in-sessions">
+ <type name="yang:zero-based-counter32"/>
+ <description>
+ <text>Number of sessions started. This counter is incremented
+when a <hello> message with a <session-id> is sent.
+
+'in-sessions' - 'in-bad-hellos' =
+ 'number of correctly started netconf sessions'</text>
+ </description>
+ </leaf>
+ <leaf name="dropped-sessions">
+ <type name="yang:zero-based-counter32"/>
+ <description>
+ <text>Number of sessions that were abnormally terminated, e.g.,
+due to idle timeout or transport close. This counter is not
+incremented when a session is properly closed by a
+<close-session> operation, or killed by a <kill-session>
+operation.</text>
+ </description>
+ </leaf>
+ <uses name="common-counters">
+ <description>
+ <text>Global counters, accumulated from all sessions.
+Zero based with following reset behaviour:
+ - re-initialization of NETCONF server
+ - when max value is reached</text>
+ </description>
+ </uses>
+ </container>
+ </container>
+ <rpc name="get-schema">
+ <description>
+ <text>This operation is used to retrieve a schema from the
+NETCONF server.
+
+Positive Response:
+ The NETCONF server returns the requested schema.
+
+Negative Response:
+ If requested schema does not exist, the <error-tag> is
+ 'invalid-value'.
+
+ If more than one schema matches the requested parameters, the
+ <error-tag> is 'operation-failed', and <error-app-tag> is
+ 'data-not-unique'.</text>
+ </description>
+ <input>
+ <leaf name="identifier">
+ <type name="string"/>
+ <mandatory value="true"/>
+ <description>
+ <text>Identifier for the schema list entry.</text>
+ </description>
+ </leaf>
+ <leaf name="version">
+ <type name="string"/>
+ <description>
+ <text>Version of the schema requested. If this parameter is not
+present, and more than one version of the schema exists on
+the server, a 'data-not-unique' error is returned, as
+described above.</text>
+ </description>
+ </leaf>
+ <leaf name="format">
+ <type name="identityref">
+ <base name="schema-format"/>
+ </type>
+ <description>
+ <text>The data modeling language of the schema. If this
+parameter is not present, and more than one formats of
+the schema exists on the server, a 'data-not-unique' error
+is returned, as described above.</text>
+ </description>
+ </leaf>
+ </input>
+ <output>
+ <anyxml name="data">
+ <description>
+ <text>Contains the schema content.</text>
+ </description>
+ </anyxml>
+ </output>
+ </rpc>
+</module>
diff --git a/tests/data/modules/ietf-netconf-notifications.yin b/tests/data/modules/ietf-netconf-notifications.yin
new file mode 100644
index 0000000..6d9e285
--- /dev/null
+++ b/tests/data/modules/ietf-netconf-notifications.yin
@@ -0,0 +1,353 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module name="ietf-netconf-notifications"
+ xmlns="urn:ietf:params:xml:ns:yang:yin:1"
+ xmlns:ncn="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications"
+ xmlns:inet="urn:ietf:params:xml:ns:yang:ietf-inet-types"
+ xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <namespace uri="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications"/>
+ <prefix value="ncn"/>
+ <import module="ietf-inet-types">
+ <prefix value="inet"/>
+ </import>
+ <import module="ietf-netconf">
+ <prefix value="nc"/>
+ </import>
+ <organization>
+ <text>IETF NETCONF (Network Configuration Protocol) Working Group</text>
+ </organization>
+ <contact>
+ <text>WG Web: <http://tools.ietf.org/wg/netconf/>
+WG List: <mailto:netconf@ietf.org>
+
+WG Chair: Bert Wijnen
+ <mailto:bertietf@bwijnen.net>
+
+WG Chair: Mehmet Ersue
+ <mailto:mehmet.ersue@nsn.com>
+
+Editor: Andy Bierman
+ <mailto:andy@netconfcentral.org></text>
+ </contact>
+ <description>
+ <text>This module defines a YANG data model for use with the
+NETCONF protocol that allows the NETCONF client to
+receive common NETCONF base event notifications.
+
+Copyright (c) 2012 IETF Trust and the persons identified as
+the document authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, is permitted pursuant to, and subject
+to the license terms contained in, the Simplified BSD License
+
+
+
+set forth in Section 4.c of the IETF Trust's Legal Provisions
+Relating to IETF Documents
+(http://trustee.ietf.org/license-info).
+
+This version of this YANG module is part of RFC 6470; see
+the RFC itself for full legal notices.</text>
+ </description>
+ <revision date="2012-02-06">
+ <description>
+ <text>Initial version.</text>
+ </description>
+ <reference>
+ <text>RFC 6470: NETCONF Base Notifications</text>
+ </reference>
+ </revision>
+ <grouping name="common-session-parms">
+ <description>
+ <text>Common session parameters to identify a
+management session.</text>
+ </description>
+ <leaf name="username">
+ <type name="string"/>
+ <mandatory value="true"/>
+ <description>
+ <text>Name of the user for the session.</text>
+ </description>
+ </leaf>
+ <leaf name="session-id">
+ <type name="nc:session-id-or-zero-type"/>
+ <mandatory value="true"/>
+ <description>
+ <text>Identifier of the session.
+A NETCONF session MUST be identified by a non-zero value.
+A non-NETCONF session MAY be identified by the value zero.</text>
+ </description>
+ </leaf>
+ <leaf name="source-host">
+ <type name="inet:ip-address"/>
+ <description>
+ <text>Address of the remote host for the session.</text>
+ </description>
+ </leaf>
+ </grouping>
+ <grouping name="changed-by-parms">
+ <description>
+ <text>Common parameters to identify the source
+of a change event, such as a configuration
+or capability change.</text>
+ </description>
+ <container name="changed-by">
+ <description>
+ <text>Indicates the source of the change.
+If caused by internal action, then the
+empty leaf 'server' will be present.
+If caused by a management session, then
+the name, remote host address, and session ID
+of the session that made the change will be reported.</text>
+ </description>
+ <choice name="server-or-user">
+ <mandatory value="true"/>
+ <leaf name="server">
+ <type name="empty"/>
+ <description>
+ <text>If present, the change was caused
+by the server.</text>
+ </description>
+ </leaf>
+ <case name="by-user">
+ <uses name="common-session-parms"/>
+ </case>
+ </choice>
+ </container>
+ </grouping>
+ <notification name="netconf-config-change">
+ <description>
+ <text>Generated when the NETCONF server detects that the
+<running> or <startup> configuration datastore
+has been changed by a management session.
+The notification summarizes the edits that
+have been detected.
+
+The server MAY choose to also generate this
+notification while loading a datastore during the
+boot process for the device.</text>
+ </description>
+ <uses name="changed-by-parms"/>
+ <leaf name="datastore">
+ <type name="enumeration">
+ <enum name="running">
+ <description>
+ <text>The <running> datastore has changed.</text>
+ </description>
+ </enum>
+ <enum name="startup">
+ <description>
+ <text>The <startup> datastore has changed</text>
+ </description>
+ </enum>
+ </type>
+ <default value="running"/>
+ <description>
+ <text>Indicates which configuration datastore has changed.</text>
+ </description>
+ </leaf>
+ <list name="edit">
+ <description>
+ <text>An edit record SHOULD be present for each distinct
+edit operation that the server has detected on
+the target datastore. This list MAY be omitted
+if the detailed edit operations are not known.
+The server MAY report entries in this list for
+changes not made by a NETCONF session (e.g., CLI).</text>
+ </description>
+ <leaf name="target">
+ <type name="instance-identifier"/>
+ <description>
+ <text>Topmost node associated with the configuration change.
+A server SHOULD set this object to the node within
+the datastore that is being altered. A server MAY
+set this object to one of the ancestors of the actual
+node that was changed, or omit this object, if the
+exact node is not known.</text>
+ </description>
+ </leaf>
+ <leaf name="operation">
+ <type name="nc:edit-operation-type"/>
+ <description>
+ <text>Type of edit operation performed.
+A server MUST set this object to the NETCONF edit
+operation performed on the target datastore.</text>
+ </description>
+ </leaf>
+ </list>
+ </notification>
+ <notification name="netconf-capability-change">
+ <description>
+ <text>Generated when the NETCONF server detects that
+the server capabilities have changed.
+Indicates which capabilities have been added, deleted,
+and/or modified. The manner in which a server
+capability is changed is outside the scope of this
+document.</text>
+ </description>
+ <uses name="changed-by-parms"/>
+ <leaf-list name="added-capability">
+ <type name="inet:uri"/>
+ <description>
+ <text>List of capabilities that have just been added.</text>
+ </description>
+ </leaf-list>
+ <leaf-list name="deleted-capability">
+ <type name="inet:uri"/>
+ <description>
+ <text>List of capabilities that have just been deleted.</text>
+ </description>
+ </leaf-list>
+ <leaf-list name="modified-capability">
+ <type name="inet:uri"/>
+ <description>
+ <text>List of capabilities that have just been modified.
+A capability is considered to be modified if the
+base URI for the capability has not changed, but
+one or more of the parameters encoded at the end of
+the capability URI have changed.
+The new modified value of the complete URI is returned.</text>
+ </description>
+ </leaf-list>
+ </notification>
+ <notification name="netconf-session-start">
+ <description>
+ <text>Generated when a NETCONF server detects that a
+NETCONF session has started. A server MAY generate
+this event for non-NETCONF management sessions.
+Indicates the identity of the user that started
+the session.</text>
+ </description>
+ <uses name="common-session-parms"/>
+ </notification>
+ <notification name="netconf-session-end">
+ <description>
+ <text>Generated when a NETCONF server detects that a
+NETCONF session has terminated.
+A server MAY optionally generate this event for
+non-NETCONF management sessions. Indicates the
+identity of the user that owned the session,
+and why the session was terminated.</text>
+ </description>
+ <uses name="common-session-parms"/>
+ <leaf name="killed-by">
+ <when condition="../termination-reason = 'killed'"/>
+ <type name="nc:session-id-type"/>
+ <description>
+ <text>The ID of the session that directly caused this session
+to be abnormally terminated. If this session was abnormally
+terminated by a non-NETCONF session unknown to the server,
+then this leaf will not be present.</text>
+ </description>
+ </leaf>
+ <leaf name="termination-reason">
+ <type name="enumeration">
+ <enum name="closed">
+ <description>
+ <text>The session was terminated by the client in normal
+fashion, e.g., by the NETCONF <close-session>
+protocol operation.</text>
+ </description>
+ </enum>
+ <enum name="killed">
+ <description>
+ <text>The session was terminated in abnormal
+fashion, e.g., by the NETCONF <kill-session>
+protocol operation.</text>
+ </description>
+ </enum>
+ <enum name="dropped">
+ <description>
+ <text>The session was terminated because the transport layer
+connection was unexpectedly closed.</text>
+ </description>
+ </enum>
+ <enum name="timeout">
+ <description>
+ <text>The session was terminated because of inactivity,
+e.g., waiting for the <hello> message or <rpc>
+messages.</text>
+ </description>
+ </enum>
+ <enum name="bad-hello">
+ <description>
+ <text>The client's <hello> message was invalid.</text>
+ </description>
+ </enum>
+ <enum name="other">
+ <description>
+ <text>The session was terminated for some other reason.</text>
+ </description>
+ </enum>
+ </type>
+ <mandatory value="true"/>
+ <description>
+ <text>Reason the session was terminated.</text>
+ </description>
+ </leaf>
+ </notification>
+ <notification name="netconf-confirmed-commit">
+ <description>
+ <text>Generated when a NETCONF server detects that a
+confirmed-commit event has occurred. Indicates the event
+and the current state of the confirmed-commit procedure
+in progress.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.4</text>
+ </reference>
+ <uses name="common-session-parms">
+ <when condition="confirm-event != 'timeout'"/>
+ </uses>
+ <leaf name="confirm-event">
+ <type name="enumeration">
+ <enum name="start">
+ <description>
+ <text>The confirmed-commit procedure has started.</text>
+ </description>
+ </enum>
+ <enum name="cancel">
+ <description>
+ <text>The confirmed-commit procedure has been canceled,
+e.g., due to the session being terminated, or an
+explicit <cancel-commit> operation.</text>
+ </description>
+ </enum>
+ <enum name="timeout">
+ <description>
+ <text>The confirmed-commit procedure has been canceled
+due to the confirm-timeout interval expiring.
+The common session parameters will not be present
+in this sub-mode.</text>
+ </description>
+ </enum>
+ <enum name="extend">
+ <description>
+ <text>The confirmed-commit timeout has been extended,
+e.g., by a new <confirmed-commit> operation.</text>
+ </description>
+ </enum>
+ <enum name="complete">
+ <description>
+ <text>The confirmed-commit procedure has been completed.</text>
+ </description>
+ </enum>
+ </type>
+ <mandatory value="true"/>
+ <description>
+ <text>Indicates the event that caused the notification.</text>
+ </description>
+ </leaf>
+ <leaf name="timeout">
+ <when condition="../confirm-event = 'start' or ../confirm-event = 'extend'"/>
+ <type name="uint32"/>
+ <units name="seconds"/>
+ <description>
+ <text>The configured timeout value if the event type
+is 'start' or 'extend'. This value represents
+the approximate number of seconds from the event
+time when the 'timeout' event might occur.</text>
+ </description>
+ </leaf>
+ </notification>
+</module>
diff --git a/tests/data/modules/ietf-netconf-with-defaults.yin b/tests/data/modules/ietf-netconf-with-defaults.yin
new file mode 100644
index 0000000..96521a7
--- /dev/null
+++ b/tests/data/modules/ietf-netconf-with-defaults.yin
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module name="ietf-netconf-with-defaults"
+ xmlns="urn:ietf:params:xml:ns:yang:yin:1"
+ xmlns:ncwd="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults"
+ xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <namespace uri="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults"/>
+ <prefix value="ncwd"/>
+ <import module="ietf-netconf">
+ <prefix value="nc"/>
+ </import>
+ <organization>
+ <text>IETF NETCONF (Network Configuration Protocol) Working Group</text>
+ </organization>
+ <contact>
+ <text>WG Web: <http://tools.ietf.org/wg/netconf/>
+
+WG List: <netconf@ietf.org>
+
+WG Chair: Bert Wijnen
+ <bertietf@bwijnen.net>
+
+WG Chair: Mehmet Ersue
+ <mehmet.ersue@nsn.com>
+
+Editor: Andy Bierman
+ <andy.bierman@brocade.com>
+
+Editor: Balazs Lengyel
+ <balazs.lengyel@ericsson.com></text>
+ </contact>
+ <description>
+ <text>This module defines an extension to the NETCONF protocol
+that allows the NETCONF client to control how default
+values are handled by the server in particular NETCONF
+operations.
+
+Copyright (c) 2011 IETF Trust and the persons identified as
+the document authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, is permitted pursuant to, and subject
+to the license terms contained in, the Simplified BSD License
+set forth in Section 4.c of the IETF Trust's Legal Provisions
+Relating to IETF Documents
+(http://trustee.ietf.org/license-info).
+
+This version of this YANG module is part of RFC 6243; see
+the RFC itself for full legal notices.</text>
+ </description>
+ <revision date="2011-06-01">
+ <description>
+ <text>Initial version.</text>
+ </description>
+ <reference>
+ <text>RFC 6243: With-defaults Capability for NETCONF</text>
+ </reference>
+ </revision>
+ <typedef name="with-defaults-mode">
+ <description>
+ <text>Possible modes to report default data.</text>
+ </description>
+ <reference>
+ <text>RFC 6243; Section 3.</text>
+ </reference>
+ <type name="enumeration">
+ <enum name="report-all">
+ <description>
+ <text>All default data is reported.</text>
+ </description>
+ <reference>
+ <text>RFC 6243; Section 3.1</text>
+ </reference>
+ </enum>
+ <enum name="report-all-tagged">
+ <description>
+ <text>All default data is reported.
+Any nodes considered to be default data
+will contain a 'default' XML attribute,
+set to 'true' or '1'.</text>
+ </description>
+ <reference>
+ <text>RFC 6243; Section 3.4</text>
+ </reference>
+ </enum>
+ <enum name="trim">
+ <description>
+ <text>Values are not reported if they contain the default.</text>
+ </description>
+ <reference>
+ <text>RFC 6243; Section 3.2</text>
+ </reference>
+ </enum>
+ <enum name="explicit">
+ <description>
+ <text>Report values that contain the definition of
+explicitly set data.</text>
+ </description>
+ <reference>
+ <text>RFC 6243; Section 3.3</text>
+ </reference>
+ </enum>
+ </type>
+ </typedef>
+ <grouping name="with-defaults-parameters">
+ <description>
+ <text>Contains the <with-defaults> parameter for control
+of defaults in NETCONF retrieval operations.</text>
+ </description>
+ <leaf name="with-defaults">
+ <description>
+ <text>The explicit defaults processing mode requested.</text>
+ </description>
+ <reference>
+ <text>RFC 6243; Section 4.5.1</text>
+ </reference>
+ <type name="with-defaults-mode"/>
+ </leaf>
+ </grouping>
+ <augment target-node="/nc:get-config/nc:input">
+ <description>
+ <text>Adds the <with-defaults> parameter to the
+input of the NETCONF <get-config> operation.</text>
+ </description>
+ <reference>
+ <text>RFC 6243; Section 4.5.1</text>
+ </reference>
+ <uses name="with-defaults-parameters"/>
+ </augment>
+ <augment target-node="/nc:get/nc:input">
+ <description>
+ <text>Adds the <with-defaults> parameter to
+the input of the NETCONF <get> operation.</text>
+ </description>
+ <reference>
+ <text>RFC 6243; Section 4.5.1</text>
+ </reference>
+ <uses name="with-defaults-parameters"/>
+ </augment>
+ <augment target-node="/nc:copy-config/nc:input">
+ <description>
+ <text>Adds the <with-defaults> parameter to
+the input of the NETCONF <copy-config> operation.</text>
+ </description>
+ <reference>
+ <text>RFC 6243; Section 4.5.1</text>
+ </reference>
+ <uses name="with-defaults-parameters"/>
+ </augment>
+</module>
diff --git a/tests/data/modules/ietf-netconf.yin b/tests/data/modules/ietf-netconf.yin
new file mode 100644
index 0000000..bb7ae31
--- /dev/null
+++ b/tests/data/modules/ietf-netconf.yin
@@ -0,0 +1,1032 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module name="ietf-netconf"
+ xmlns="urn:ietf:params:xml:ns:yang:yin:1"
+ xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
+ xmlns:inet="urn:ietf:params:xml:ns:yang:ietf-inet-types"
+ xmlns:nacm="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
+ <namespace uri="urn:ietf:params:xml:ns:netconf:base:1.0"/>
+ <prefix value="nc"/>
+ <import module="ietf-inet-types">
+ <prefix value="inet"/>
+ </import>
+ <import module="ietf-netconf-acm">
+ <prefix value="nacm"/>
+ </import>
+ <organization>
+ <text>IETF NETCONF (Network Configuration) Working Group</text>
+ </organization>
+ <contact>
+ <text>WG Web: <http://tools.ietf.org/wg/netconf/>
+WG List: <netconf@ietf.org>
+
+WG Chair: Bert Wijnen
+ <bertietf@bwijnen.net>
+
+WG Chair: Mehmet Ersue
+ <mehmet.ersue@nsn.com>
+
+Editor: Martin Bjorklund
+ <mbj@tail-f.com>
+
+Editor: Juergen Schoenwaelder
+ <j.schoenwaelder@jacobs-university.de>
+
+Editor: Andy Bierman
+ <andy.bierman@brocade.com></text>
+ </contact>
+ <description>
+ <text>NETCONF Protocol Data Types and Protocol Operations.
+
+Copyright (c) 2011 IETF Trust and the persons identified as
+the document authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, is permitted pursuant to, and subject
+to the license terms contained in, the Simplified BSD License
+set forth in Section 4.c of the IETF Trust's Legal Provisions
+Relating to IETF Documents
+(http://trustee.ietf.org/license-info).
+
+This version of this YANG module is part of RFC 6241; see
+the RFC itself for full legal notices.</text>
+ </description>
+ <revision date="2011-06-01">
+ <description>
+ <text>Initial revision;
+2013-09-29: Updated to include NACM attributes,
+as specified in RFC 6536: sec 3.2.5 and 3.2.8</text>
+ </description>
+ <reference>
+ <text>RFC 6241: Network Configuration Protocol</text>
+ </reference>
+ </revision>
+ <extension name="get-filter-element-attributes">
+ <description>
+ <text>If this extension is present within an 'anyxml'
+statement named 'filter', which must be conceptually
+defined within the RPC input section for the <get>
+and <get-config> protocol operations, then the
+following unqualified XML attribute is supported
+within the <filter> element, within a <get> or
+<get-config> protocol operation:
+
+ type : optional attribute with allowed
+ value strings 'subtree' and 'xpath'.
+ If missing, the default value is 'subtree'.
+
+If the 'xpath' feature is supported, then the
+following unqualified XML attribute is
+also supported:
+
+ select: optional attribute containing a
+ string representing an XPath expression.
+ The 'type' attribute must be equal to 'xpath'
+ if this attribute is present.</text>
+ </description>
+ </extension>
+ <feature name="writable-running">
+ <description>
+ <text>NETCONF :writable-running capability;
+If the server advertises the :writable-running
+capability for a session, then this feature must
+also be enabled for that session. Otherwise,
+this feature must not be enabled.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.2</text>
+ </reference>
+ </feature>
+ <feature name="candidate">
+ <description>
+ <text>NETCONF :candidate capability;
+If the server advertises the :candidate
+capability for a session, then this feature must
+also be enabled for that session. Otherwise,
+this feature must not be enabled.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.3</text>
+ </reference>
+ </feature>
+ <feature name="confirmed-commit">
+ <if-feature name="candidate"/>
+ <description>
+ <text>NETCONF :confirmed-commit:1.1 capability;
+If the server advertises the :confirmed-commit:1.1
+capability for a session, then this feature must
+also be enabled for that session. Otherwise,
+this feature must not be enabled.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.4</text>
+ </reference>
+ </feature>
+ <feature name="rollback-on-error">
+ <description>
+ <text>NETCONF :rollback-on-error capability;
+If the server advertises the :rollback-on-error
+capability for a session, then this feature must
+also be enabled for that session. Otherwise,
+this feature must not be enabled.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.5</text>
+ </reference>
+ </feature>
+ <feature name="validate">
+ <description>
+ <text>NETCONF :validate:1.1 capability;
+If the server advertises the :validate:1.1
+capability for a session, then this feature must
+also be enabled for that session. Otherwise,
+this feature must not be enabled.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.6</text>
+ </reference>
+ </feature>
+ <feature name="startup">
+ <description>
+ <text>NETCONF :startup capability;
+If the server advertises the :startup
+capability for a session, then this feature must
+also be enabled for that session. Otherwise,
+this feature must not be enabled.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.7</text>
+ </reference>
+ </feature>
+ <feature name="url">
+ <description>
+ <text>NETCONF :url capability;
+If the server advertises the :url
+capability for a session, then this feature must
+also be enabled for that session. Otherwise,
+this feature must not be enabled.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.8</text>
+ </reference>
+ </feature>
+ <feature name="xpath">
+ <description>
+ <text>NETCONF :xpath capability;
+If the server advertises the :xpath
+capability for a session, then this feature must
+also be enabled for that session. Otherwise,
+this feature must not be enabled.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.9</text>
+ </reference>
+ </feature>
+ <typedef name="session-id-type">
+ <type name="uint32">
+ <range value="1..max"/>
+ </type>
+ <description>
+ <text>NETCONF Session Id</text>
+ </description>
+ </typedef>
+ <typedef name="session-id-or-zero-type">
+ <type name="uint32"/>
+ <description>
+ <text>NETCONF Session Id or Zero to indicate none</text>
+ </description>
+ </typedef>
+ <typedef name="error-tag-type">
+ <type name="enumeration">
+ <enum name="in-use">
+ <description>
+ <text>The request requires a resource that
+already is in use.</text>
+ </description>
+ </enum>
+ <enum name="invalid-value">
+ <description>
+ <text>The request specifies an unacceptable value for one
+or more parameters.</text>
+ </description>
+ </enum>
+ <enum name="too-big">
+ <description>
+ <text>The request or response (that would be generated) is
+too large for the implementation to handle.</text>
+ </description>
+ </enum>
+ <enum name="missing-attribute">
+ <description>
+ <text>An expected attribute is missing.</text>
+ </description>
+ </enum>
+ <enum name="bad-attribute">
+ <description>
+ <text>An attribute value is not correct; e.g., wrong type,
+out of range, pattern mismatch.</text>
+ </description>
+ </enum>
+ <enum name="unknown-attribute">
+ <description>
+ <text>An unexpected attribute is present.</text>
+ </description>
+ </enum>
+ <enum name="missing-element">
+ <description>
+ <text>An expected element is missing.</text>
+ </description>
+ </enum>
+ <enum name="bad-element">
+ <description>
+ <text>An element value is not correct; e.g., wrong type,
+out of range, pattern mismatch.</text>
+ </description>
+ </enum>
+ <enum name="unknown-element">
+ <description>
+ <text>An unexpected element is present.</text>
+ </description>
+ </enum>
+ <enum name="unknown-namespace">
+ <description>
+ <text>An unexpected namespace is present.</text>
+ </description>
+ </enum>
+ <enum name="access-denied">
+ <description>
+ <text>Access to the requested protocol operation or
+data model is denied because authorization failed.</text>
+ </description>
+ </enum>
+ <enum name="lock-denied">
+ <description>
+ <text>Access to the requested lock is denied because the
+lock is currently held by another entity.</text>
+ </description>
+ </enum>
+ <enum name="resource-denied">
+ <description>
+ <text>Request could not be completed because of
+insufficient resources.</text>
+ </description>
+ </enum>
+ <enum name="rollback-failed">
+ <description>
+ <text>Request to roll back some configuration change (via
+rollback-on-error or <discard-changes> operations)
+was not completed for some reason.</text>
+ </description>
+ </enum>
+ <enum name="data-exists">
+ <description>
+ <text>Request could not be completed because the relevant
+data model content already exists. For example,
+a 'create' operation was attempted on data that
+already exists.</text>
+ </description>
+ </enum>
+ <enum name="data-missing">
+ <description>
+ <text>Request could not be completed because the relevant
+data model content does not exist. For example,
+a 'delete' operation was attempted on
+data that does not exist.</text>
+ </description>
+ </enum>
+ <enum name="operation-not-supported">
+ <description>
+ <text>Request could not be completed because the requested
+operation is not supported by this implementation.</text>
+ </description>
+ </enum>
+ <enum name="operation-failed">
+ <description>
+ <text>Request could not be completed because the requested
+operation failed for some reason not covered by
+any other error condition.</text>
+ </description>
+ </enum>
+ <enum name="partial-operation">
+ <description>
+ <text>This error-tag is obsolete, and SHOULD NOT be sent
+by servers conforming to this document.</text>
+ </description>
+ </enum>
+ <enum name="malformed-message">
+ <description>
+ <text>A message could not be handled because it failed to
+be parsed correctly. For example, the message is not
+well-formed XML or it uses an invalid character set.</text>
+ </description>
+ </enum>
+ </type>
+ <description>
+ <text>NETCONF Error Tag</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Appendix A</text>
+ </reference>
+ </typedef>
+ <typedef name="error-severity-type">
+ <type name="enumeration">
+ <enum name="error">
+ <description>
+ <text>Error severity</text>
+ </description>
+ </enum>
+ <enum name="warning">
+ <description>
+ <text>Warning severity</text>
+ </description>
+ </enum>
+ </type>
+ <description>
+ <text>NETCONF Error Severity</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 4.3</text>
+ </reference>
+ </typedef>
+ <typedef name="edit-operation-type">
+ <type name="enumeration">
+ <enum name="merge">
+ <description>
+ <text>The configuration data identified by the
+element containing this attribute is merged
+with the configuration at the corresponding
+level in the configuration datastore identified
+by the target parameter.</text>
+ </description>
+ </enum>
+ <enum name="replace">
+ <description>
+ <text>The configuration data identified by the element
+containing this attribute replaces any related
+configuration in the configuration datastore
+identified by the target parameter. If no such
+configuration data exists in the configuration
+datastore, it is created. Unlike a
+<copy-config> operation, which replaces the
+entire target configuration, only the configuration
+actually present in the config parameter is affected.</text>
+ </description>
+ </enum>
+ <enum name="create">
+ <description>
+ <text>The configuration data identified by the element
+containing this attribute is added to the
+configuration if and only if the configuration
+data does not already exist in the configuration
+datastore. If the configuration data exists, an
+<rpc-error> element is returned with an
+<error-tag> value of 'data-exists'.</text>
+ </description>
+ </enum>
+ <enum name="delete">
+ <description>
+ <text>The configuration data identified by the element
+containing this attribute is deleted from the
+configuration if and only if the configuration
+data currently exists in the configuration
+datastore. If the configuration data does not
+exist, an <rpc-error> element is returned with
+an <error-tag> value of 'data-missing'.</text>
+ </description>
+ </enum>
+ <enum name="remove">
+ <description>
+ <text>The configuration data identified by the element
+containing this attribute is deleted from the
+configuration if the configuration
+data currently exists in the configuration
+datastore. If the configuration data does not
+exist, the 'remove' operation is silently ignored
+by the server.</text>
+ </description>
+ </enum>
+ </type>
+ <default value="merge"/>
+ <description>
+ <text>NETCONF 'operation' attribute values</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.2</text>
+ </reference>
+ </typedef>
+ <rpc name="get-config">
+ <description>
+ <text>Retrieve all or part of a specified configuration.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.1</text>
+ </reference>
+ <input>
+ <container name="source">
+ <description>
+ <text>Particular configuration to retrieve.</text>
+ </description>
+ <choice name="config-source">
+ <mandatory value="true"/>
+ <description>
+ <text>The configuration to retrieve.</text>
+ </description>
+ <leaf name="candidate">
+ <if-feature name="candidate"/>
+ <type name="empty"/>
+ <description>
+ <text>The candidate configuration is the config source.</text>
+ </description>
+ </leaf>
+ <leaf name="running">
+ <type name="empty"/>
+ <description>
+ <text>The running configuration is the config source.</text>
+ </description>
+ </leaf>
+ <leaf name="startup">
+ <if-feature name="startup"/>
+ <type name="empty"/>
+ <description>
+ <text>The startup configuration is the config source.
+This is optional-to-implement on the server because
+not all servers will support filtering for this
+datastore.</text>
+ </description>
+ </leaf>
+ </choice>
+ </container>
+ <anyxml name="filter">
+ <description>
+ <text>Subtree or XPath filter to use.</text>
+ </description>
+ <nc:get-filter-element-attributes/>
+ </anyxml>
+ </input>
+ <output>
+ <anyxml name="data">
+ <description>
+ <text>Copy of the source datastore subset that matched
+the filter criteria (if any). An empty data container
+indicates that the request did not produce any results.</text>
+ </description>
+ </anyxml>
+ </output>
+ </rpc>
+ <rpc name="edit-config">
+ <description>
+ <text>The <edit-config> operation loads all or part of a specified
+configuration to the specified target configuration.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.2</text>
+ </reference>
+ <input>
+ <container name="target">
+ <description>
+ <text>Particular configuration to edit.</text>
+ </description>
+ <choice name="config-target">
+ <mandatory value="true"/>
+ <description>
+ <text>The configuration target.</text>
+ </description>
+ <leaf name="candidate">
+ <if-feature name="candidate"/>
+ <type name="empty"/>
+ <description>
+ <text>The candidate configuration is the config target.</text>
+ </description>
+ </leaf>
+ <leaf name="running">
+ <if-feature name="writable-running"/>
+ <type name="empty"/>
+ <description>
+ <text>The running configuration is the config source.</text>
+ </description>
+ </leaf>
+ </choice>
+ </container>
+ <leaf name="default-operation">
+ <type name="enumeration">
+ <enum name="merge">
+ <description>
+ <text>The default operation is merge.</text>
+ </description>
+ </enum>
+ <enum name="replace">
+ <description>
+ <text>The default operation is replace.</text>
+ </description>
+ </enum>
+ <enum name="none">
+ <description>
+ <text>There is no default operation.</text>
+ </description>
+ </enum>
+ </type>
+ <default value="merge"/>
+ <description>
+ <text>The default operation to use.</text>
+ </description>
+ </leaf>
+ <leaf name="test-option">
+ <if-feature name="validate"/>
+ <type name="enumeration">
+ <enum name="test-then-set">
+ <description>
+ <text>The server will test and then set if no errors.</text>
+ </description>
+ </enum>
+ <enum name="set">
+ <description>
+ <text>The server will set without a test first.</text>
+ </description>
+ </enum>
+ <enum name="test-only">
+ <description>
+ <text>The server will only test and not set, even
+if there are no errors.</text>
+ </description>
+ </enum>
+ </type>
+ <default value="test-then-set"/>
+ <description>
+ <text>The test option to use.</text>
+ </description>
+ </leaf>
+ <leaf name="error-option">
+ <type name="enumeration">
+ <enum name="stop-on-error">
+ <description>
+ <text>The server will stop on errors.</text>
+ </description>
+ </enum>
+ <enum name="continue-on-error">
+ <description>
+ <text>The server may continue on errors.</text>
+ </description>
+ </enum>
+ <enum name="rollback-on-error">
+ <description>
+ <text>The server will roll back on errors.
+This value can only be used if the 'rollback-on-error'
+feature is supported.</text>
+ </description>
+ </enum>
+ </type>
+ <default value="stop-on-error"/>
+ <description>
+ <text>The error option to use.</text>
+ </description>
+ </leaf>
+ <choice name="edit-content">
+ <mandatory value="true"/>
+ <description>
+ <text>The content for the edit operation.</text>
+ </description>
+ <anyxml name="config">
+ <description>
+ <text>Inline Config content.</text>
+ </description>
+ </anyxml>
+ <leaf name="url">
+ <if-feature name="url"/>
+ <type name="inet:uri"/>
+ <description>
+ <text>URL-based config content.</text>
+ </description>
+ </leaf>
+ </choice>
+ </input>
+ </rpc>
+ <rpc name="copy-config">
+ <description>
+ <text>Create or replace an entire configuration datastore with the
+contents of another complete configuration datastore.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.3</text>
+ </reference>
+ <input>
+ <container name="target">
+ <description>
+ <text>Particular configuration to copy to.</text>
+ </description>
+ <choice name="config-target">
+ <mandatory value="true"/>
+ <description>
+ <text>The configuration target of the copy operation.</text>
+ </description>
+ <leaf name="candidate">
+ <if-feature name="candidate"/>
+ <type name="empty"/>
+ <description>
+ <text>The candidate configuration is the config target.</text>
+ </description>
+ </leaf>
+ <leaf name="running">
+ <if-feature name="writable-running"/>
+ <type name="empty"/>
+ <description>
+ <text>The running configuration is the config target.
+This is optional-to-implement on the server.</text>
+ </description>
+ </leaf>
+ <leaf name="startup">
+ <if-feature name="startup"/>
+ <type name="empty"/>
+ <description>
+ <text>The startup configuration is the config target.</text>
+ </description>
+ </leaf>
+ <leaf name="url">
+ <if-feature name="url"/>
+ <type name="inet:uri"/>
+ <description>
+ <text>The URL-based configuration is the config target.</text>
+ </description>
+ </leaf>
+ </choice>
+ </container>
+ <container name="source">
+ <description>
+ <text>Particular configuration to copy from.</text>
+ </description>
+ <choice name="config-source">
+ <mandatory value="true"/>
+ <description>
+ <text>The configuration source for the copy operation.</text>
+ </description>
+ <leaf name="candidate">
+ <if-feature name="candidate"/>
+ <type name="empty"/>
+ <description>
+ <text>The candidate configuration is the config source.</text>
+ </description>
+ </leaf>
+ <leaf name="running">
+ <type name="empty"/>
+ <description>
+ <text>The running configuration is the config source.</text>
+ </description>
+ </leaf>
+ <leaf name="startup">
+ <if-feature name="startup"/>
+ <type name="empty"/>
+ <description>
+ <text>The startup configuration is the config source.</text>
+ </description>
+ </leaf>
+ <leaf name="url">
+ <if-feature name="url"/>
+ <type name="inet:uri"/>
+ <description>
+ <text>The URL-based configuration is the config source.</text>
+ </description>
+ </leaf>
+ <anyxml name="config">
+ <description>
+ <text>Inline Config content: <config> element. Represents
+an entire configuration datastore, not
+a subset of the running datastore.</text>
+ </description>
+ </anyxml>
+ </choice>
+ </container>
+ </input>
+ </rpc>
+ <rpc name="delete-config">
+ <nacm:default-deny-all/>
+ <description>
+ <text>Delete a configuration datastore.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.4</text>
+ </reference>
+ <input>
+ <container name="target">
+ <description>
+ <text>Particular configuration to delete.</text>
+ </description>
+ <choice name="config-target">
+ <mandatory value="true"/>
+ <description>
+ <text>The configuration target to delete.</text>
+ </description>
+ <leaf name="startup">
+ <if-feature name="startup"/>
+ <type name="empty"/>
+ <description>
+ <text>The startup configuration is the config target.</text>
+ </description>
+ </leaf>
+ <leaf name="url">
+ <if-feature name="url"/>
+ <type name="inet:uri"/>
+ <description>
+ <text>The URL-based configuration is the config target.</text>
+ </description>
+ </leaf>
+ </choice>
+ </container>
+ </input>
+ </rpc>
+ <rpc name="lock">
+ <description>
+ <text>The lock operation allows the client to lock the configuration
+system of a device.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.5</text>
+ </reference>
+ <input>
+ <container name="target">
+ <description>
+ <text>Particular configuration to lock.</text>
+ </description>
+ <choice name="config-target">
+ <mandatory value="true"/>
+ <description>
+ <text>The configuration target to lock.</text>
+ </description>
+ <leaf name="candidate">
+ <if-feature name="candidate"/>
+ <type name="empty"/>
+ <description>
+ <text>The candidate configuration is the config target.</text>
+ </description>
+ </leaf>
+ <leaf name="running">
+ <type name="empty"/>
+ <description>
+ <text>The running configuration is the config target.</text>
+ </description>
+ </leaf>
+ <leaf name="startup">
+ <if-feature name="startup"/>
+ <type name="empty"/>
+ <description>
+ <text>The startup configuration is the config target.</text>
+ </description>
+ </leaf>
+ </choice>
+ </container>
+ </input>
+ </rpc>
+ <rpc name="unlock">
+ <description>
+ <text>The unlock operation is used to release a configuration lock,
+previously obtained with the 'lock' operation.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.6</text>
+ </reference>
+ <input>
+ <container name="target">
+ <description>
+ <text>Particular configuration to unlock.</text>
+ </description>
+ <choice name="config-target">
+ <mandatory value="true"/>
+ <description>
+ <text>The configuration target to unlock.</text>
+ </description>
+ <leaf name="candidate">
+ <if-feature name="candidate"/>
+ <type name="empty"/>
+ <description>
+ <text>The candidate configuration is the config target.</text>
+ </description>
+ </leaf>
+ <leaf name="running">
+ <type name="empty"/>
+ <description>
+ <text>The running configuration is the config target.</text>
+ </description>
+ </leaf>
+ <leaf name="startup">
+ <if-feature name="startup"/>
+ <type name="empty"/>
+ <description>
+ <text>The startup configuration is the config target.</text>
+ </description>
+ </leaf>
+ </choice>
+ </container>
+ </input>
+ </rpc>
+ <rpc name="get">
+ <description>
+ <text>Retrieve running configuration and device state information.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.7</text>
+ </reference>
+ <input>
+ <anyxml name="filter">
+ <description>
+ <text>This parameter specifies the portion of the system
+configuration and state data to retrieve.</text>
+ </description>
+ <nc:get-filter-element-attributes/>
+ </anyxml>
+ </input>
+ <output>
+ <anyxml name="data">
+ <description>
+ <text>Copy of the running datastore subset and/or state
+data that matched the filter criteria (if any).
+An empty data container indicates that the request did not
+produce any results.</text>
+ </description>
+ </anyxml>
+ </output>
+ </rpc>
+ <rpc name="close-session">
+ <description>
+ <text>Request graceful termination of a NETCONF session.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.8</text>
+ </reference>
+ </rpc>
+ <rpc name="kill-session">
+ <nacm:default-deny-all/>
+ <description>
+ <text>Force the termination of a NETCONF session.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 7.9</text>
+ </reference>
+ <input>
+ <leaf name="session-id">
+ <type name="session-id-type"/>
+ <mandatory value="true"/>
+ <description>
+ <text>Particular session to kill.</text>
+ </description>
+ </leaf>
+ </input>
+ </rpc>
+ <rpc name="commit">
+ <if-feature name="candidate"/>
+ <description>
+ <text>Commit the candidate configuration as the device's new
+current configuration.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.3.4.1</text>
+ </reference>
+ <input>
+ <leaf name="confirmed">
+ <if-feature name="confirmed-commit"/>
+ <type name="empty"/>
+ <description>
+ <text>Requests a confirmed commit.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.3.4.1</text>
+ </reference>
+ </leaf>
+ <leaf name="confirm-timeout">
+ <if-feature name="confirmed-commit"/>
+ <type name="uint32">
+ <range value="1..max"/>
+ </type>
+ <units name="seconds"/>
+ <default value="600"/>
+ <description>
+ <text>The timeout interval for a confirmed commit.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.3.4.1</text>
+ </reference>
+ </leaf>
+ <leaf name="persist">
+ <if-feature name="confirmed-commit"/>
+ <type name="string"/>
+ <description>
+ <text>This parameter is used to make a confirmed commit
+persistent. A persistent confirmed commit is not aborted
+if the NETCONF session terminates. The only way to abort
+a persistent confirmed commit is to let the timer expire,
+or to use the <cancel-commit> operation.
+
+The value of this parameter is a token that must be given
+in the 'persist-id' parameter of <commit> or
+<cancel-commit> operations in order to confirm or cancel
+the persistent confirmed commit.
+
+The token should be a random string.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.3.4.1</text>
+ </reference>
+ </leaf>
+ <leaf name="persist-id">
+ <if-feature name="confirmed-commit"/>
+ <type name="string"/>
+ <description>
+ <text>This parameter is given in order to commit a persistent
+confirmed commit. The value must be equal to the value
+given in the 'persist' parameter to the <commit> operation.
+If it does not match, the operation fails with an
+'invalid-value' error.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.3.4.1</text>
+ </reference>
+ </leaf>
+ </input>
+ </rpc>
+ <rpc name="discard-changes">
+ <if-feature name="candidate"/>
+ <description>
+ <text>Revert the candidate configuration to the current
+running configuration.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.3.4.2</text>
+ </reference>
+ </rpc>
+ <rpc name="cancel-commit">
+ <if-feature name="confirmed-commit"/>
+ <description>
+ <text>This operation is used to cancel an ongoing confirmed commit.
+If the confirmed commit is persistent, the parameter
+'persist-id' must be given, and it must match the value of the
+'persist' parameter.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.4.4.1</text>
+ </reference>
+ <input>
+ <leaf name="persist-id">
+ <type name="string"/>
+ <description>
+ <text>This parameter is given in order to cancel a persistent
+confirmed commit. The value must be equal to the value
+given in the 'persist' parameter to the <commit> operation.
+If it does not match, the operation fails with an
+'invalid-value' error.</text>
+ </description>
+ </leaf>
+ </input>
+ </rpc>
+ <rpc name="validate">
+ <if-feature name="validate"/>
+ <description>
+ <text>Validates the contents of the specified configuration.</text>
+ </description>
+ <reference>
+ <text>RFC 6241, Section 8.6.4.1</text>
+ </reference>
+ <input>
+ <container name="source">
+ <description>
+ <text>Particular configuration to validate.</text>
+ </description>
+ <choice name="config-source">
+ <mandatory value="true"/>
+ <description>
+ <text>The configuration source to validate.</text>
+ </description>
+ <leaf name="candidate">
+ <if-feature name="candidate"/>
+ <type name="empty"/>
+ <description>
+ <text>The candidate configuration is the config source.</text>
+ </description>
+ </leaf>
+ <leaf name="running">
+ <type name="empty"/>
+ <description>
+ <text>The running configuration is the config source.</text>
+ </description>
+ </leaf>
+ <leaf name="startup">
+ <if-feature name="startup"/>
+ <type name="empty"/>
+ <description>
+ <text>The startup configuration is the config source.</text>
+ </description>
+ </leaf>
+ <leaf name="url">
+ <if-feature name="url"/>
+ <type name="inet:uri"/>
+ <description>
+ <text>The URL-based configuration is the config source.</text>
+ </description>
+ </leaf>
+ <anyxml name="config">
+ <description>
+ <text>Inline Config content: <config> element. Represents
+an entire configuration datastore, not
+a subset of the running datastore.</text>
+ </description>
+ </anyxml>
+ </choice>
+ </container>
+ </input>
+ </rpc>
+</module>
diff --git a/tests/data/modules/module-a-dv.yang b/tests/data/modules/module-a-dv.yang
new file mode 100644
index 0000000..20f0f46
--- /dev/null
+++ b/tests/data/modules/module-a-dv.yang
@@ -0,0 +1,16 @@
+module module-a-dv {
+
+ namespace "urn:jmu:params:xml:ns:yang:module-a-dv";
+ prefix dv;
+
+ import module-a {
+ prefix a;
+ }
+
+ description
+ "Contains some deviations to module-a";
+
+ deviation "/a:top/a:hidden" {
+ deviate not-supported;
+ }
+}
\ No newline at end of file
diff --git a/tests/data/modules/module-a-dv2.yang b/tests/data/modules/module-a-dv2.yang
new file mode 100644
index 0000000..906d222
--- /dev/null
+++ b/tests/data/modules/module-a-dv2.yang
@@ -0,0 +1,21 @@
+module module-a-dv2 {
+
+ namespace "urn:jmu:params:xml:ns:yang:module-a-dv2";
+ prefix dv2;
+
+ import module-a {
+ prefix a;
+ }
+
+ description
+ "Contains some deviations to module-a";
+
+ deviation "/a:top/a:type" {
+ deviate add {
+ default "admin";
+ must "count(.) = 1";
+ }
+ }
+
+}
+
diff --git a/tests/data/modules/module-a.yang b/tests/data/modules/module-a.yang
new file mode 100644
index 0000000..39a5ae2
--- /dev/null
+++ b/tests/data/modules/module-a.yang
@@ -0,0 +1,23 @@
+module module-a {
+
+ namespace "urn:jmu:params:xml:ns:yang:module-a";
+ prefix a;
+
+ description "This is a simple user module";
+
+ container top {
+
+ leaf name {
+ type string;
+ }
+
+ leaf type {
+ type string;
+ }
+
+ leaf hidden {
+ type boolean;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/tests/data/modules/nc-notifications.yin b/tests/data/modules/nc-notifications.yin
new file mode 100644
index 0000000..2d33f04
--- /dev/null
+++ b/tests/data/modules/nc-notifications.yin
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module name="nc-notifications"
+ xmlns="urn:ietf:params:xml:ns:yang:yin:1"
+ xmlns:manageEvent="urn:ietf:params:xml:ns:netmod:notification"
+ xmlns:yang="urn:ietf:params:xml:ns:yang:ietf-yang-types"
+ xmlns:ncEvent="urn:ietf:params:xml:ns:netconf:notification:1.0">
+ <namespace uri="urn:ietf:params:xml:ns:netmod:notification"/>
+ <prefix value="manageEvent"/>
+ <import module="ietf-yang-types">
+ <prefix value="yang"/>
+ </import>
+ <import module="notifications">
+ <prefix value="ncEvent"/>
+ </import>
+ <organization>
+ <text>IETF NETCONF WG</text>
+ </organization>
+ <contact>
+ <text>netconf@ietf.org</text>
+ </contact>
+ <description>
+ <text>Conversion of the 'manageEvent' XSD in the NETCONF
+Notifications RFC.</text>
+ </description>
+ <reference>
+ <text>RFC 5277</text>
+ </reference>
+ <revision date="2008-07-14">
+ <description>
+ <text>RFC 5277 version.</text>
+ </description>
+ </revision>
+ <container name="netconf">
+ <description>
+ <text>Top-level element in the notification namespace</text>
+ </description>
+ <config value="false"/>
+ <container name="streams">
+ <description>
+ <text>The list of event streams supported by the system. When
+a query is issued, the returned set of streams is
+determined based on user privileges.</text>
+ </description>
+ <list name="stream">
+ <description>
+ <text>Stream name, description and other information.</text>
+ </description>
+ <key value="name"/>
+ <min-elements value="1"/>
+ <leaf name="name">
+ <description>
+ <text>The name of the event stream. If this is the default
+NETCONF stream, this must have the value 'NETCONF'.</text>
+ </description>
+ <type name="ncEvent:streamNameType"/>
+ </leaf>
+ <leaf name="description">
+ <description>
+ <text>A description of the event stream, including such
+information as the type of events that are sent over
+this stream.</text>
+ </description>
+ <type name="string"/>
+ <mandatory value="true"/>
+ </leaf>
+ <leaf name="replaySupport">
+ <description>
+ <text>A description of the event stream, including such
+information as the type of events that are sent over
+this stream.</text>
+ </description>
+ <type name="boolean"/>
+ <mandatory value="true"/>
+ </leaf>
+ <leaf name="replayLogCreationTime">
+ <description>
+ <text>The timestamp of the creation of the log used to support
+the replay function on this stream. Note that this might
+be earlier then the earliest available notification in
+the log. This object is updated if the log resets for
+some reason. This object MUST be present if replay is
+supported.</text>
+ </description>
+ <type name="yang:date-and-time"/>
+ </leaf>
+ </list>
+ </container>
+ </container>
+ <notification name="replayComplete">
+ <description>
+ <text>This notification is sent to signal the end of a replay
+portion of a subscription.</text>
+ </description>
+ </notification>
+ <notification name="notificationComplete">
+ <description>
+ <text>This notification is sent to signal the end of a notification
+subscription. It is sent in the case that stopTime was
+specified during the creation of the subscription..</text>
+ </description>
+ </notification>
+</module>
diff --git a/tests/data/modules/notifications.yin b/tests/data/modules/notifications.yin
new file mode 100644
index 0000000..2a4f422
--- /dev/null
+++ b/tests/data/modules/notifications.yin
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module name="notifications"
+ xmlns="urn:ietf:params:xml:ns:yang:yin:1"
+ xmlns:ncEvent="urn:ietf:params:xml:ns:netconf:notification:1.0"
+ xmlns:yang="urn:ietf:params:xml:ns:yang:ietf-yang-types">
+ <namespace uri="urn:ietf:params:xml:ns:netconf:notification:1.0"/>
+ <prefix value="ncEvent"/>
+ <import module="ietf-yang-types">
+ <prefix value="yang"/>
+ </import>
+ <organization>
+ <text>IETF NETCONF WG</text>
+ </organization>
+ <contact>
+ <text>netconf@ops.ietf.org</text>
+ </contact>
+ <description>
+ <text>Conversion of the 'ncEvent' XSD in the
+NETCONF Notifications RFC.</text>
+ </description>
+ <reference>
+ <text>RFC 5277.</text>
+ </reference>
+ <revision date="2008-07-14">
+ <description>
+ <text>RFC 5277 version.</text>
+ </description>
+ </revision>
+ <typedef name="streamNameType">
+ <description>
+ <text>The name of an event stream.</text>
+ </description>
+ <type name="string"/>
+ </typedef>
+ <rpc name="create-subscription">
+ <description>
+ <text>The command to create a notification subscription. It
+takes as argument the name of the notification stream
+and filter. Both of those options limit the content of
+the subscription. In addition, there are two time-related
+parameters, startTime and stopTime, which can be used to
+select the time interval of interest to the notification
+replay feature.</text>
+ </description>
+ <input>
+ <leaf name="stream">
+ <description>
+ <text>An optional parameter that indicates which stream of events
+is of interest. If not present, then events in the default
+NETCONF stream will be sent.</text>
+ </description>
+ <type name="streamNameType"/>
+ <default value="NETCONF"/>
+ </leaf>
+ <anyxml name="filter">
+ <description>
+ <text>An optional parameter that indicates which subset of all
+possible events is of interest. The format of this
+parameter is the same as that of the filter parameter
+in the NETCONF protocol operations. If not present,
+all events not precluded by other parameters will
+be sent.</text>
+ </description>
+ </anyxml>
+ <leaf name="startTime">
+ <description>
+ <text>A parameter used to trigger the replay feature and
+indicates that the replay should start at the time
+specified. If start time is not present, this is not a
+replay subscription.</text>
+ </description>
+ <type name="yang:date-and-time"/>
+ </leaf>
+ <leaf name="stopTime">
+ <description>
+ <text>An optional parameter used with the optional replay
+feature to indicate the newest notifications of
+interest. If stop time is not present, the notifications
+will continue until the subscription is terminated.
+Must be used with startTime.</text>
+ </description>
+ <type name="yang:date-and-time"/>
+ </leaf>
+ </input>
+ </rpc>
+ <container name="notification">
+ <description>
+ <text>internal struct to start a notification</text>
+ </description>
+ <config value="false"/>
+ <leaf name="eventTime">
+ <mandatory value="true"/>
+ <type name="yang:date-and-time"/>
+ </leaf>
+ </container>
+</module>
diff --git a/tests/test_fd_comm.c b/tests/test_fd_comm.c
index 59a787b..3265452 100644
--- a/tests/test_fd_comm.c
+++ b/tests/test_fd_comm.c
@@ -495,7 +495,7 @@
const struct lys_node *node;
/* create ctx */
- ctx = ly_ctx_new(TESTS_DIR"/../schemas", 0);
+ ctx = ly_ctx_new(TESTS_DIR"/data/modules", 0);
assert_non_null(ctx);
/* load modules */
diff --git a/tests/test_io.c b/tests/test_io.c
index 0c42d9b..4dd31a3 100644
--- a/tests/test_io.c
+++ b/tests/test_io.c
@@ -46,10 +46,10 @@
w = malloc(sizeof *w);
w->session = calloc(1, sizeof *w->session);
- w->session->ctx = ly_ctx_new(TESTS_DIR"/../schemas", 0);
+ w->session->ctx = ly_ctx_new(TESTS_DIR"/data/modules", 0);
/* ietf-netconf */
- fd = open(TESTS_DIR"/../schemas/ietf-netconf.yin", O_RDONLY);
+ fd = open(TESTS_DIR"/data/modules/ietf-netconf.yin", O_RDONLY);
if (fd == -1) {
free(w);
return -1;
diff --git a/tests/test_server_thread.c b/tests/test_server_thread.c
index 5cc0114..0daf387 100644
--- a/tests/test_server_thread.c
+++ b/tests/test_server_thread.c
@@ -226,26 +226,40 @@
char buf[9];
struct nc_session *session;
+ fprintf(stdout, "SSH client start.\n");
+
ret = read(read_pipe, buf, 9);
nc_assert(ret == 9);
nc_assert(!strncmp(buf, "ssh_ready", 9));
+ fprintf(stdout, "SSH #1\n");
+
/* skip the knownhost check */
nc_client_ssh_set_auth_hostkey_check_clb(ssh_hostkey_check_clb, NULL);
+ fprintf(stdout, "SSH #2\n");
+
ret = nc_client_ssh_set_username("test");
nc_assert(!ret);
+ fprintf(stdout, "SSH #3\n");
+
ret = nc_client_ssh_add_keypair(TESTS_DIR"/data/key_ecdsa.pub", TESTS_DIR"/data/key_ecdsa");
nc_assert(!ret);
+ fprintf(stdout, "SSH #4\n");
+
nc_client_ssh_set_auth_pref(NC_SSH_AUTH_PUBLICKEY, 1);
nc_client_ssh_set_auth_pref(NC_SSH_AUTH_PASSWORD, -1);
nc_client_ssh_set_auth_pref(NC_SSH_AUTH_INTERACTIVE, -1);
+ fprintf(stdout, "SSH #5\n");
+
session = nc_connect_ssh("127.0.0.1", 6001, NULL);
nc_assert(session);
+ fprintf(stdout, "SSH #6\n");
+
nc_session_free(session, NULL);
fprintf(stdout, "SSH client finished.\n");
@@ -532,6 +546,8 @@
char buf[9];
struct nc_session *session;
+ fprintf(stdout, "TLS client start.\n");
+
ret = read(read_pipe, buf, 9);
nc_assert(ret == 9);
nc_assert(!strncmp(buf, "tls_ready", 9));
@@ -608,7 +624,7 @@
if (!(pids[clients] = fork())) {
nc_client_init();
- ret = nc_client_set_schema_searchpath(TESTS_DIR"/../schemas");
+ ret = nc_client_set_schema_searchpath(TESTS_DIR"/data/modules");
nc_assert(!ret);
/* close write */
@@ -630,7 +646,7 @@
if (!(pids[clients] = fork())) {
nc_client_init();
- ret = nc_client_set_schema_searchpath(TESTS_DIR"/../schemas");
+ ret = nc_client_set_schema_searchpath(TESTS_DIR"/data/modules");
nc_assert(!ret);
/* close write */
@@ -660,7 +676,7 @@
client_fork();
- ctx = ly_ctx_new(TESTS_DIR"/../schemas", 0);
+ ctx = ly_ctx_new(TESTS_DIR"/data/modules", 0);
nc_assert(ctx);
ly_ctx_load_module(ctx, "ietf-netconf", NULL);