Re: [netmod] Question about tooling for YANG Instance Data

Michal Vasko <> Mon, 06 June 2022 06:00 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 4D16BC157903 for <>; Sun, 5 Jun 2022 23:00:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -8.884
X-Spam-Status: No, score=-8.884 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=0.1, NICE_REPLY_A=-1.876, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id eqHm4-UaOye4 for <>; Sun, 5 Jun 2022 22:59:56 -0700 (PDT)
Received: from ( []) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by (Postfix) with ESMTPS id 239CCC157908 for <>; Sun, 5 Jun 2022 22:59:55 -0700 (PDT)
Received: from [IPV6:2001:67c:1220:80c:76:4a3a:d717:4a09] (unknown [IPv6:2001:67c:1220:80c:76:4a3a:d717:4a09]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by (Postfix) with ESMTPSA id 9803040006D; Mon, 6 Jun 2022 07:59:52 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=office2-2020; t=1654495192; bh=HSuUhXEEG7D2VeKc5Da7+aVGT1/9IiKDn0PGWotbOhM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=K1uZUk5aS4xM5lQwFbx2u7DIshmyPwYYd3QECwh16c0B673nEdc13unAzhUEyULKl qovatSIDlQDmH2Xm6fV9OsJ+klrjjU+N9D/MVGc6fyzfsyKcOn5aAEamUqJS1OB7h4 euwhlrQ7sJgOLCiCGg3fnUTo3G00nSuKLG4HEqYDGyDTXtM9CjMjyS69FcJNyFI/cP mC75nbExnkIK+hKTRWWiBKAAOfWSN6wJv3SrTzwev+Ypf9bBVQUQhXWvqWGaPlY1GB RFOrrZtRmUO3URe/J3SFN3lLo2yWDWVEolfl+LXAiv9CIKdTOW+UnDfuAAf54L4GWY +d2eU/eFdsaow==
Message-ID: <>
Date: Mon, 06 Jun 2022 07:59:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0
Content-Language: en-US
To: Scott Mansfield <>, Kent Watsen <>
Cc: "" <>
References: <> <> <>
From: Michal Vasko <>
In-Reply-To: <>
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="------------ms000501080504040507010604"
Archived-At: <>
Subject: Re: [netmod] Question about tooling for YANG Instance Data
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 06 Jun 2022 06:00:02 -0000

Hi Scott,

the main developer of libyang commenting. In your example there is a 
"structure" extension instance, which we do not support currently so you 
will not be able to validate it no matter what you do. I have already 
looked at this extension recently and think that we can support it 
without much trouble but I am currently swamped by lots of other issues 
so I have no idea when I will get to this.


On 5. 6. 2022 1:35, Scott Mansfield wrote:
> Excellent ideas.  I will package up a tiny example and post to libyang.
> I am using yanglint 2.0.200.
> Since I’m starting from an example that is in RFC 9195, it is easy to 
> build a small example and package up an expect script to show the issue.
> Regards,
> -scott.
> *From:* Kent Watsen <>
> *Sent:* Saturday, June 4, 2022 5:22 PM
> *To:* Scott Mansfield <>
> *Cc:*
> *Subject:* Re: [netmod] Question about tooling for YANG Instance Data
> Hi Scott,
> I consider myself a heavy `yanglint` user, as all examples in all my 
> drafts are validated each time I "make" each draft, and I have several 
> other projects that make heavy use of `yanglint` validation.   I have 
> run into a number of validation issues over years and generally first 
> try to validate that my understanding of YANG is correct  and, if 
> unsure, I'll ping the NETMOD list (note: there are many YANG 
> subtleties, such as the recent discovery that a module needs to be 
> "implemented" in order for its features to be defined).   Otherwise, I 
> submit an Issue to the `libyang` GitHub issue tracker, typically 
> containing the smallest possible module (or number of modules) 
> demonstrating the issue, while also pointing out all relevant facts 
> (e.g., foo is implemented, bar is defined, RFC 7950 Section X says 
> this, etc.).  Radek and Michal are pretty good with providing a 
> response in 1-2 business days.   Sometimes my YANG-understanding is 
> challenged, at which point we bring it to the NETMOD list.
> FWIW, `yanglint` recently switched from the 1.x to the 2.x code base. 
>   A number of regressions were introduced at this time (resolved now, 
> at least the ones affecting me) but, nicely, the 2.x code catches some 
> issues that the 1.x code never did (it's a better validator).  The CLI 
> changed some, and I'm now very careful to ensure all modules that need 
> to be implemented are, and that all features that need to be defined 
> are.  I now explicitly disable all features for implemented modules 
> when no features from it are needed.   I find that the new 2.x is 
> picky, in a good way and that, after painstakingly working through 
> each issue, all my validation tests are passing now.
> Best of luck,
> Kent
>     On Jun 3, 2022, at 3:35 PM, Scott Mansfield
>     <> wrote:
>     I am trying to use two of the examples found in RFC 9195
>     <> and
>     <> to
>     test out how to validate that instance data is formatted correctly.
>     Using yanglint, I load all the yang necessary and then load the
>     data from either the xml file (read-only-acm-rules) or the json
>     file (acme-router-netconf-diagnostics).  I get a similar error for
>     both...
>     data -t data -f xml acme-router-netconf-diagnostics.json
>     libyang[0]: Node "instance-data-set" not found in the
>     "ietf-yang-instance-data" module. (path: Line number 2.)
>     YANGLINT[E]: Failed to parse input data file
>     "acme-router-netconf-diagnostics.json".
>     What is the best tooling to use to validate the instance data? 
>     What tooling was used to validate the contents used in the
>     examples?  I'm trying to determine if this a yanglint issue, user
>     error, or I'm just using the wrong tool.
>     Here is a link to a github with my testing:
>     <>
>     If interested in the expect script for
>     the acme-router-netconf-diagnostics.json example and is the
>     expect script for the read-only-acm-rules.xml example.
>     regards,
>     -scott.
>     _______________________________________________
>     netmod mailing list
> <>
>     <>
> _______________________________________________
> netmod mailing list