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

Scott Mansfield <scott.mansfield@ericsson.com> Sat, 04 June 2022 23:35 UTC

Return-Path: <scott.mansfield@ericsson.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 069D6C14CF06 for <netmod@ietfa.amsl.com>; Sat, 4 Jun 2022 16:35:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.75
X-Spam-Level:
X-Spam-Status: No, score=-2.75 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.745, 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, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fmDcvHxNv1Wk for <netmod@ietfa.amsl.com>; Sat, 4 Jun 2022 16:35:17 -0700 (PDT)
Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20609.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::609]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 50D56C14F6E5 for <netmod@ietf.org>; Sat, 4 Jun 2022 16:35:16 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KNku0WthpR20EMuja7jC61qLW8LzDJGKLo/G1iHlhvZf0rPLzpUdxpzw55XgEMkd3ZznvrD+qDHk+RNsR0+3ekYbv/5fZEa0d5/9ZdL98mfWs7r74UJLJ97AxXJQawIXYmz6XaMwap/mXAQqHaY5rjQYfd/J3RukTBWG6gJsgv+3GR7EfcSgXYECr2MDXi+CM0adXbtYBxJcwjJf1U/PGayYpPU5hz/vzfy4/cCjNV+6Wvyz3/8M2h5E1ZF1UWwyc/3hn05qqepdLYx9KbwwtFwoPhyzcbHjeB9Yuzswa10DNaqHhMNmiIG+vOibI+StjQJhcezMOMPOYctCtpOyig==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LtnhPK9U4XleUAHDyOr2N90crM7cMjf1bGFSItSI8b0=; b=Gq0Ni8rXIUY4YNK7aWsq7Cmx7M38UXGTysAFfRDtCLPHwwO4S2A170yzlVEFJtccPnSF8fTY6hjuKp0jQlWDyFqH7Kvo4DCXP1pKjb2q8703sFRpXHC53PrHEjRAI7jYkSghKXftkG4cwrcDg4oDIfpB/lLLP4cRXKdFlXxZ+0uJ3xe1un5up2ix5RGdHQYCiq/10I0vl1o61ku0jal3DrwOQ0Ksj7A4KQ+X4EkHMi6HQiKl3SUf0959/Pifj53Z1hflBuda0zok38pRmdmA3pPfI+awA2tpqoyHumkGmQOL4Yq2noEOERreZ1dIPhXPG1SJ/7oyHYolthmZZy/SFw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LtnhPK9U4XleUAHDyOr2N90crM7cMjf1bGFSItSI8b0=; b=ussm1u+XyLC4wMGRts7yf2YA8TvNjR/Y6sg6i3jplkk/QJDW3Pxf7sLBMVQXy8skYk56oDnzJI/C8NQSTZG/udz8zqDmR7sNMsoTDOsQyO8WAQEul1JypKp/hw3hlSJH5vEwB2YcbdCbEKLFZhz6e7nEcU6nW+62WbGzMx4Fld4=
Received: from BL0PR1501MB4130.namprd15.prod.outlook.com (2603:10b6:208:86::17) by DM6PR15MB2682.namprd15.prod.outlook.com (2603:10b6:5:1af::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.18; Sat, 4 Jun 2022 23:35:12 +0000
Received: from BL0PR1501MB4130.namprd15.prod.outlook.com ([fe80::e4d8:cf03:817f:207d]) by BL0PR1501MB4130.namprd15.prod.outlook.com ([fe80::e4d8:cf03:817f:207d%7]) with mapi id 15.20.5314.017; Sat, 4 Jun 2022 23:35:12 +0000
From: Scott Mansfield <scott.mansfield@ericsson.com>
To: Kent Watsen <kent@watsen.net>
CC: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] Question about tooling for YANG Instance Data
Thread-Index: AQHYd36ly1RAdbA1y02owRTPu6VrQ60/w1yAgAAkPtA=
Date: Sat, 04 Jun 2022 23:35:11 +0000
Message-ID: <BL0PR1501MB41306F6BF26D2D04C1176D078BA09@BL0PR1501MB4130.namprd15.prod.outlook.com>
References: <BL0PR1501MB41302D7A28A36A656DF595158BA19@BL0PR1501MB4130.namprd15.prod.outlook.com> <010001813098fd65-ed07df98-b72c-427e-b382-795895ac2f54-000000@email.amazonses.com>
In-Reply-To: <010001813098fd65-ed07df98-b72c-427e-b382-795895ac2f54-000000@email.amazonses.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ericsson.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 8e80983a-250c-4554-e814-08da4682dea5
x-ms-traffictypediagnostic: DM6PR15MB2682:EE_
x-microsoft-antispam-prvs: <DM6PR15MB2682EBCFC8AFEB556E9EF84C8BA09@DM6PR15MB2682.namprd15.prod.outlook.com>
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: EEzdhNGNu5G02H28fy/NEJEablEdP3bsD2BFkhq9Rf9BuHtsktfI/HeS0xXFcr4pyyqUxqihRKoGMxi3ASdbxFBa+uH3aouSe9oprwfMhO9z3NIlPr9VejrrCUyNZvwd0RAX0ez5BK2bSlvJFbNHVmjvNIgdO4lGN1eUw5WXX8bY8JT1krr9LO/44ClS7v6wjjqiC4hOQAUrgjZNiI/TR6OLGKNq8/w+Iq1IS/jfCUlfGPl4DUskjn0dGmcjCQx4WTCo2zsupkAU7QuwWUsgMYety5n0sdaKZm+mIKUJ8oQaDGvZ5kUTc6c7lzeNWj3awYHGNdcxi6pobloDf9WoDBzatuUzRIOGcyzKnvHkL8ALnRC+oTeQLL30SX8+TwVTUqhssDmUQ2NtAooGePpFiA6NxBk9qJP1oHikZquaqS2hbjLcMlqqihDfUApE1niN5wFyf5PfARzvXPwuYVUEjONUDs2zWF1rGiSc4+0UVZyI2KverszMEAUxmv5a1bceolaVdLs7GON7tWos9MoBddGaysKsQLMYQO4NoGTwmwpSow1PShi/gF5NNe/Pi8D91CSCYK104gJXyk3xG8qutxZAtl3ugS8Z0aZiKhdu7N0e+lIjUYzTGmbJdK/w18keXwtfla9XyPwlefTrgYMhJ6FHdiTB7KgrzeYkFeeqEttbQhbAB1MQEg8LfEXoNanQPsKq5NnETtaqYQuJEj32zQ4159LuQj56McipK8Y+g8iHNw42iJ+HQlC+dDU0Zogr1IqJzsx6HTvKIyNM6vGivmKMw6yEvEEJ2Oo7wevsbgs8pNxNWy4Q4RzpZPdI+c6mz+hIBNbcZ/v8lwiKM+x3sw==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR1501MB4130.namprd15.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66946007)(2906002)(66574015)(66476007)(76116006)(55016003)(66556008)(166002)(4326008)(8676002)(83380400001)(38100700002)(64756008)(66446008)(33656002)(53546011)(8936002)(6506007)(7696005)(6916009)(52536014)(26005)(966005)(186003)(44832011)(9686003)(5660300002)(86362001)(508600001)(316002)(82960400001)(122000001)(38070700005)(71200400001); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: K1GGWl/uNZ52fWviN3NC4zASJ0CaGGina3R6VwaGErdDgx4/6wPD5QgX9dWcttOCXgyC3lw5p16j8jw33l5j15pY6sPy8LZvSRsnNAu3snm/f0xUdDmVa2nb6pKvexU8u2emRmK/76R9fKpolwdHIMZwO5M2MWX3Bc52K7JpCXOvhzXhLmoMZ1ZW4zkDTHyJnnZtIsf2ixMjkI3yQ0FBbLgJbVGaCOsKsBNC1Y+p4z5jscqBHSfrz0egYKVGhN7I/FVWOcDEYI0olgOKlD7+41cYbWIlS3t6k00KjY/Sll9QW2/v4vyiCApFWSAoDHsc3FgZTfKcruUs8WPoaFIGj3+V47C63SFn/AvDzxRSndKAFwYn0YyKadq8c5O51XGJeG23UqZCNSAKf4uV6F7P88psKV4uIPr0+z0F+t26poSTtCeON7h5BSmEikBUlQuxUz5onHklKhKIjSNzToZwCw1z2tW1E127ZC9NJIRIVeEn8pBgNC+Nrr0RoHkKp6InGfD4ZPHRPUec/aC/LPMjGIYgJ1cFG1fUR6O5MjxQO0IcyX7v1G/ijOZCPwRI+KOjoAf9aElOz1VESzvs0UTnWvajiZ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iqbMOBrMWt1df3euUZKZisdmRpFVHfQDc6ijEOml9ZmhZkj3/sj4lZL/I2+90OLt1r33y4STVu2K8E=
Content-Type: multipart/alternative; boundary="_000_BL0PR1501MB41306F6BF26D2D04C1176D078BA09BL0PR1501MB4130_"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL0PR1501MB4130.namprd15.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8e80983a-250c-4554-e814-08da4682dea5
X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jun 2022 23:35:12.1297 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: pUcBONPU2cJ6GT1ffeeRTYeBPhpNJCFrQbnUVT+y/RATM/IvWRbZM8ty56pOuQ7J5wuAEHS++p33WyGFUqrVknT0qzCESF9LFq9Sld3AicU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR15MB2682
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/ShZXMCY4H2uFzMjc2s2Hhk6DeGc>
Subject: Re: [netmod] Question about tooling for YANG Instance Data
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 04 Jun 2022 23:35:22 -0000

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 <kent@watsen.net>
Sent: Saturday, June 4, 2022 5:22 PM
To: Scott Mansfield <scott.mansfield@ericsson.com>
Cc: netmod@ietf.org
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 <scott.mansfield=40ericsson.com@dmarc.ietf.org<mailto:scott.mansfield=40ericsson.com@dmarc.ietf.org>> wrote:

I am trying to use two of the examples found in RFC 9195 https://www.rfc-editor.org/rfc/rfc9195.html#name-preloading-default-configur<https://protect2.fireeye.com/v1/url?k=31323334-501d5122-313273af-454445555731-092ccfe7a6702a7c&q=1&e=4e9d6ab0-63b7-4e40-965d-5d89b0208d6e&u=https%3A%2F%2Fwww.rfc-editor.org%2Frfc%2Frfc9195.html%23name-preloading-default-configur> and https://www.rfc-editor.org/rfc/rfc9195.html#name-storing-diagnostics-data<https://protect2.fireeye.com/v1/url?k=31323334-501d5122-313273af-454445555731-4510ebc746564af0&q=1&e=4e9d6ab0-63b7-4e40-965d-5d89b0208d6e&u=https%3A%2F%2Fwww.rfc-editor.org%2Frfc%2Frfc9195.html%23name-storing-diagnostics-data> 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:  https://github.com/samans/testing-yang/tree/main/ieee-60802/60802<https://protect2.fireeye.com/v1/url?k=31323334-501d5122-313273af-454445555731-20ec105f5d2f3377&q=1&e=4e9d6ab0-63b7-4e40-965d-5d89b0208d6e&u=https%3A%2F%2Fgithub.com%2Fsamans%2Ftesting-yang%2Ftree%2Fmain%2Fieee-60802%2F60802>
If interested t.in in the expect script for the acme-router-netconf-diagnostics.json example and x.in is the expect script for the read-only-acm-rules.xml example.

regards,
-scott.

_______________________________________________
netmod mailing list
netmod@ietf.org<mailto:netmod@ietf.org>
https://www.ietf.org/mailman/listinfo/netmod