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

Kent Watsen <> Sat, 04 June 2022 21:22 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 3F899C14F725 for <>; Sat, 4 Jun 2022 14:22:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, 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 (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id F0jINmTghZAm for <>; Sat, 4 Jun 2022 14:22:23 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 0E104C14F75F for <>; Sat, 4 Jun 2022 14:22:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw;; t=1654377741; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=60jNNJHabBOR5M/dAblo3Yb3ebyUH2sgVI49e3ruKjw=; b=gyAZB5Cpysqn5YuYcolWSdL2kp7InO8LK1+yNA17BWP4dXQSUlZ4nSy42/b30Bd9 amxGVdYetEeRTWWXSuuZwbDm6r+1lshuC8wy2d79x19n8GciUPoPt9l6ttOQtRIgtSX Ud+mBdsJSOL4Az5VDYOhSvSw08l0sKiXcrZgT7VU=
From: Kent Watsen <>
Message-ID: <>
Content-Type: multipart/alternative; boundary="Apple-Mail=_2DC29312-1D1C-4A21-AB71-D9AD946876BB"
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.\))
Date: Sat, 04 Jun 2022 21:22:21 +0000
In-Reply-To: <>
Cc: "" <>
To: Scott Mansfield <>
References: <>
X-Mailer: Apple Mail (2.3693.
X-SES-Outgoing: 2022.06.04-
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: Sat, 04 Jun 2022 21:22:29 -0000

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,

> 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
> <>
> <>