Re: [yang-doctors] XPath validation during development

Mahesh Jethanandani <mjethanandani@gmail.com> Tue, 03 March 2020 19:09 UTC

Return-Path: <mjethanandani@gmail.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F0F0B3A040F for <yang-doctors@ietfa.amsl.com>; Tue, 3 Mar 2020 11:09:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 WDcxCGag2auM for <yang-doctors@ietfa.amsl.com>; Tue, 3 Mar 2020 11:09:44 -0800 (PST)
Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 410513A0407 for <yang-doctors@ietf.org>; Tue, 3 Mar 2020 11:09:44 -0800 (PST)
Received: by mail-pj1-x1034.google.com with SMTP id a18so1764438pjs.5 for <yang-doctors@ietf.org>; Tue, 03 Mar 2020 11:09:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=f2/vcmqPreM/WY4itbECkptvv0YzpdEBt4k5zS6O5ek=; b=EGLUD09L8y92/q2out8QtUmDqEdAJ3F1XdX29+iOLEXJvLDuta2hXPirgYWlO5ILhf 2oeT6zf3F1osxoWbFnaN/ekxy86BOEavieSD5+NztmPFyjYV/Ml1iBScXHsmn2X3PCUK tEW5XkyqrkzySvR5bs6IlNwrFZizUzgjF58YW6yt53/uPLJFA+EiVoNjtXJPWJXmg05y X69aAT3kH7H/sO2duONbnXdxRJv0H6yedKrdv2FAUxmMQnFUMYVPeSFcOZRx2VKzs5mw VwavJqZTpHVGCNb+o8Ne4xyXC45zufBcEPhSif3vFIpGACPIBHTkx4x4gdR7fpB87oJN oh/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=f2/vcmqPreM/WY4itbECkptvv0YzpdEBt4k5zS6O5ek=; b=X3HWF6NjnkyZ9VkOddQmtjO11KEUa696wjQFXggSPQ9rULVu0U7mdCGLEK5tuuhnVL XneCsdAT5W0l1T6NXeQoSC/a9hnVvI5xnAd733i8u7BanXzMweGjcH4ZGoSy9JGbd82q oDbrMxprVo9uCXVE/938q2mZCZz4DzIwUviW5ZK98JCWV+6i6gHm+qRibNrTdr6dkr6+ X9J/GUmJs0b3LDtxqwSF8to9FuK+z348uxM0IX9PB0H/Rxqbi5+/P44/sh/yxHCy8i1Q RIlqNVk4sBwHgkb9gJDCOaBTtz6PNIKMi02Vr2vO3OHKN0UUBX8Paz+5rurj4Ju+LAQ2 5otA==
X-Gm-Message-State: ANhLgQ359b0qE3+VV4JDs0ltjqcFHxqe3MZECpYBY+APfAHjQ99K0uC4 Z1HGAY3pGMeaKwMGTybxvFQ7/5xI
X-Google-Smtp-Source: ADFU+vtQAS4lQeXZ+/T43hN9wihUtMp/0vRXB32IbEiVDyVf2/pPwdibr+UgERELjn3UekcuPhihzw==
X-Received: by 2002:a17:902:123:: with SMTP id 32mr5665607plb.38.1583262583751; Tue, 03 Mar 2020 11:09:43 -0800 (PST)
Received: from ?IPv6:2601:647:5600:5020:b4f9:ed10:525:fab4? ([2601:647:5600:5020:b4f9:ed10:525:fab4]) by smtp.gmail.com with ESMTPSA id r13sm12302pjp.14.2020.03.03.11.09.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2020 11:09:42 -0800 (PST)
From: Mahesh Jethanandani <mjethanandani@gmail.com>
Message-Id: <383B302D-CB39-4D04-B778-E29EF87B1DEF@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_F2569EB0-D48D-41C0-B755-F23B099A682E"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Date: Tue, 03 Mar 2020 11:09:40 -0800
In-Reply-To: <010001709ce294c6-d6393ee5-9c3c-4d0f-80c6-3ffff2523742-000000@email.amazonses.com>
Cc: Scott Mansfield <scott.mansfield=40ericsson.com@dmarc.ietf.org>, "yang-doctors@ietf.org" <yang-doctors@ietf.org>
To: Kent Watsen <kent@watsen.net>
References: <DM5PR15MB1772033DBA980333DF41A5348BE70@DM5PR15MB1772.namprd15.prod.outlook.com> <010001709ce294c6-d6393ee5-9c3c-4d0f-80c6-3ffff2523742-000000@email.amazonses.com>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/I4s1WdGI5QXbBle6IcLRjKMc0D0>
Subject: Re: [yang-doctors] XPath validation during development
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Mar 2020 19:09:47 -0000

+1

I make sure I develop instance data examples as I am developing the model to make sure that if I do make changes, that they do not break the model. And I rely on other examples to develop some of my own.

Cheers.

> On Mar 2, 2020, at 12:14 PM, Kent Watsen <kent@watsen.net> wrote:
> 
> “Best” is hard to qualify, but perhaps best would be to 1) validate the YANG module(s) and 2) validate as many instance documents as it takes to have near 100% coverage; and doing both is these things with as many validation tools as possible.
> 
> I do this myself for all my models, though I only ave access to `yanglint` and `yangson`.  For drafts, my Makefiles do this for each build (pro-tip: the time setting up the automation pays for itself in the long run).
> 
> A couple additional comments:
> 
> 1) `yangson` has an ability to output test-coverage statistics per https://github.com/CZ-NIC/yangson/issues/13 <https://github.com/CZ-NIC/yangson/issues/13>.
> 
> 2) testing against multiple implementation has two benefits: a) some implementation catch things others don’t and b) sometimes inconsistencies arise that resolve by either i) one implementation being improved or ii) discovery of a clarification-issue with YANG (RFC 7950).  Example open clarification issues include how NP-containers and implicit-case statements are handled.  My modules are now constructed in such a way to be behaviorally-correct across a greater set of tools (e.g., avoid implicit-case statements, always use a presence-container if a descendent contains a “must” statement, etc.)
> 
> Kent
> 
> 
>> On Mar 2, 2020, at 2:24 PM, Scott Mansfield <scott.mansfield=40ericsson.com@dmarc.ietf.org <mailto:scott.mansfield=40ericsson.com@dmarc.ietf.org>> wrote:
>> 
>> Hello YANG Doctors!
>>  
>> I searched through the yang-doctors mailing list and didn’t see an answer to my question, so apologies if this has been covered before.
>>  
>> While development a YANG module, how is the best way to ensure that my XPath (must etc) statements are syntactically and semantically correct?  Is the best way to use YUMA123 or confd and build a set of test cases that can be run on an instantiated model?  What do you do to test your XPath during development of YANG?
>>  
>> Many thanks,
>> -scott.
>> _______________________________________________
>> yang-doctors mailing list
>> yang-doctors@ietf.org <mailto:yang-doctors@ietf.org>
>> https://www.ietf.org/mailman/listinfo/yang-doctors <https://www.ietf.org/mailman/listinfo/yang-doctors>
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors



Mahesh Jethanandani
mjethanandani@gmail.com