[netmod] validating instance data against YANG schema including 'must' statements

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> Thu, 12 December 2019 16:42 UTC

Return-Path: <jason.sterne@nokia.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 D6C561200A1 for <netmod@ietfa.amsl.com>; Thu, 12 Dec 2019 08:42:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nokia.onmicrosoft.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OIczHPsXKrnk for <netmod@ietfa.amsl.com>; Thu, 12 Dec 2019 08:42:13 -0800 (PST)
Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70128.outbound.protection.outlook.com [40.107.7.128]) (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 9411912008D for <netmod@ietf.org>; Thu, 12 Dec 2019 08:42:12 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mG7fnvxq8S7XxrGOVkVsBAP1BQJH6wnKhzVc4+7hF3KO3QVqM+MME1Ie0x7cz+QQNXYw2DvgSzl5Wihp+W4EtnO0Y64FT58A4byZD7yqyAaIagGv73Lb2Q+qdRaqhy6vLasnwUdme5QspiwbTbsvp33mOiQ8czxsIkep/20ZUrLg0E63A+KLyMeYQJQSh94/zoOZJIfT/KFMJVWrUp8K/CaciZz0ondQtVXFLm+ZaYRrNCsCQss1cdItkIWTBAUlGzIALrtcoUooyjlK3U7/w2A464L66nOBXv4ZA4tRtxfqzeTAT8ypIFhEklWH3tW5mLghkrX8yEIn3ugCiUjbpg==
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-SenderADCheck; bh=uZjsK8tFclDiiuU1uXsbdL9+zojlH5b8LWVd90mjYiY=; b=P6FczJh0P6LYvAdz1S95ELBBQd0hO1ya+KjmKoDdtF7RnsYX33Dphg9670/Rk9A30qHqIVDHwS5qsv0Pinft3my00FCc67lkUR5Ieytck+MNM+Oqio1HUThuuOtFjvkRRGPQko2l1M7z8S2IeLilsHmKlQHub0PE3EFfyDcs5uelmZHsGRzi+a3gPT239VVUoyHLRmilc1NX5DylUMH4wE8eCfS0fygaFq9PxVgldQhcuVFmQDP+jvUgYUh35ZJOZ8n0hBU4U5esYSuBUcTyMd8S5ZEG/6HtQujRxHMTHsJmyEPoeOo9Kb4L6I8B9xTJTT0r8kNHgjEFBgL4ZtWd0w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uZjsK8tFclDiiuU1uXsbdL9+zojlH5b8LWVd90mjYiY=; b=s6Dwjn2y/8N5xIbGeyXdXWV2SlsfzuNX/vWPvQ3YaJ1Mmj8jK1EFrEX2D/9jX8LNc9HE95VzWJUP77C0VsvxbNqleULXk0SBlJg/6PwjjyJ2G8tnvlAm/H3l+kUsRE4p582/MIiEvOlZjMmEx4j0gY9Hm34jrJKrvvC80b335nU=
Received: from VI1PR07MB3981.eurprd07.prod.outlook.com (52.134.29.24) by VI1PR07MB5325.eurprd07.prod.outlook.com (20.178.11.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.4; Thu, 12 Dec 2019 16:42:09 +0000
Received: from VI1PR07MB3981.eurprd07.prod.outlook.com ([fe80::f4ac:1bfd:a5a1:aadf]) by VI1PR07MB3981.eurprd07.prod.outlook.com ([fe80::f4ac:1bfd:a5a1:aadf%6]) with mapi id 15.20.2538.017; Thu, 12 Dec 2019 16:42:09 +0000
From: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: validating instance data against YANG schema including 'must' statements
Thread-Index: AdWxCsORBSgRrCTES6eC/F2G+Dspvg==
Date: Thu, 12 Dec 2019 16:42:09 +0000
Message-ID: <VI1PR07MB3981BBE54D2E235648758C209B550@VI1PR07MB3981.eurprd07.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=jason.sterne@nokia.com;
x-originating-ip: [45.72.135.40]
x-ms-publictraffictype: Email
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: 452bf5cb-0b02-4d06-49fe-08d77f223b5f
x-ms-traffictypediagnostic: VI1PR07MB5325:
x-microsoft-antispam-prvs: <VI1PR07MB53253670E47206E851CEC33F9B550@VI1PR07MB5325.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-forefront-prvs: 0249EFCB0B
x-forefront-antispam-report: SFV:NSPM; SFS:(10001)(10019020)(39860400002)(376002)(366004)(346002)(136003)(396003)(199004)(189003)(53754006)(2906002)(66446008)(66556008)(66476007)(66946007)(64756008)(76116006)(21615005)(8676002)(19273905006)(6916009)(52536014)(966005)(33656002)(81156014)(86362001)(81166006)(71200400001)(26005)(5660300002)(6506007)(53546011)(478600001)(316002)(8936002)(55016002)(9686003)(7696005)(186003)(562404015)(563064011); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB5325; H:VI1PR07MB3981.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: HWMu6/Z505Vk6r/xtq8LFxGojczXjRLFIfWnl76IM4IA9t6aVmExuevmWK4toXnwUFsGAr/Fxl1VHJSM9Nxnf69WiGUnYD7TyurNYTAymARYxgjkqc9UuGrIAUsPIQSWMFfLIyCNL0ly7fgZ0KQpXZqnVNVi+SIfZuuJJCi+uLfojmkoWfSHFaZJz16s71t0zi+BpxnvNhvx7yU3v2Vildx/F/fUOp3SwQJEr5XUFAulDe7aQSrFRmOPCBuDziKnssjGHr6GX6JDl6foWFAjOIcyfOx5eWqrpqxREpjf9rvy++pb2rD5P0Nxv6Mi6EB7YUmHJdCweXSo1qTKXdGc/PJ8oMyFfNWwAxfCJnGowli1tLQ+S4ecwuYQ5y1e9oVmWm6l7fjB55W3y7D+HdGUBLRCUI729XmntdbqpzZRHBvICrc6QtkumQi2iNt8nFU3BHcauKOcN0JbLqwBYMKqsXXlKeM2HS1m+3wjaeKG7TeR4Z7mMiuHDvUNlp/DwcSX1UXz3AbhXrH2imxspjhnI8eBmn+NRffMkRsbuMoYCNNu/2qH3srsMiesNRLEZ5KJuvZVAaMERjWnpk9iXuHFKiknDWWjS9IqHrlK3lK7rQRwUyFxMUakK9Lh9F4l8diXgdcmuuzIABZMEqGFzKTkBw==
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_VI1PR07MB3981BBE54D2E235648758C209B550VI1PR07MB3981eurp_"
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 452bf5cb-0b02-4d06-49fe-08d77f223b5f
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2019 16:42:09.6691 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: pojbQPLM/Ev8zmSybTdt/Vg6UvAHbFSNlAnaiiIT9rZr5JKhHUGcu5JsUN0ovDeplCpnJ+ZldGOpUssQEwzVQA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB5325
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/fWJzQoTC9VgqSpEGXMG4xuo4uZ4>
Subject: [netmod] validating instance data against YANG schema including 'must' statements
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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: Thu, 12 Dec 2019 16:42:16 -0000

Hi all,

A few years ago there were a few discussions on the list about tools to validate instance data (e.g. the data returned by a <get-config>) against a YANG model.

yang2dsdl is one option but I'm pretty sure it doesn't actually check the data against 'must' statements.

Are there some tools that check against 'must' (and 'when') statements?  Do those tools also work with YANG 1.1 modules?

Thx,
Jason

######################################################################################################
Re: [netmod] Toolchain upgraded to yangdump-pro 16.10-5 => 16.10-5.1

Ladislav Lhotka <lhotka@nic.cz> Tue, 07 March 2017 12:42 UTCShow header<https://mailarchive.ietf.org/arch/msg/netmod/u6-p884fv_R8SLZgLze1YYHBupk>

Kent Watsen <kwatsen@juniper.net><mailto:kwatsen@juniper.net&gt>; writes:



> Hi Benoit,

>

> You seem to know the ins and outs of many tools these days, maybe you

> can point me in the right direction...which tool is able to validate

> instance documents against YANG 1.1 modules?



Yangson can validate JSON documents:



https://github.com/CZ-NIC/yangson



>

> I've always used `yang2dsdl`, but currently it outputs "DSDL plugin

> supports only YANG version 1".



I considered updating the DSDL plugin to 1.1 but it turned up to be

immensely difficult - it would basically require a complete rewrite. And

even then, the Schematron implementation that is included in pyang

distribution won't support the new XPath functions.



Lada

######################################################################################################

Re: [netmod] DSDL plugin in pyang

Ladislav Lhotka <lhotka@nic.cz> Tue, 29 November 2016 13:39 UTCShow header<https://mailarchive.ietf.org/arch/msg/netmod/o6XNsZ2BA0kBL9bv4oG7LH1yq4k>

Hi William,



apart from yang2dsdl, I have personal experience with these two instance validation tools:



* yanglint - written in C, supports both XML and JSON instance encoding



  https://github.com/CESNET/libyang



* yangson - written in Python, supports only JSON



  https://github.com/CZ-NIC/yangson

  installation: pip install yangson

  manual page: http://yangson.readthedocs.io/en/latest/cmdline.html<https://yangson.readthedocs.io/en/latest/cmdline.html>



Lada



William Lupton <wlupton@broadband-forum.org><mailto:wlupton@broadband-forum.org&gt>; writes:



> Are you able to provide a list (either privately or via the NETMOD list) of other instance data validators that are available and cover YANG 1.1 features? Tx, W.

>

>> On 25 Nov 2016, at 14:33, Ladislav Lhotka <lhotka@nic.cz><mailto:lhotka@nic.cz&gt>; wrote:

>>

>> Hi,

>>

>> for users of $subj: I modified the plugin so that it now immediately refuses to process modules of yang-version greater than 1. Supporting some of the YANG 1.1 features (new XPath functions, leafref handling) would require massive changes and I cannot do them now - I am not even sure it is worth the effort given that other instance data validators are available.

>>

>> Lada



--


######################################################################################################