Subject: [Netconf] draft-ietf-netconf-zerotouch-09.txt: new error from confdc

From: Benoit Claise <[email-masked]>
Date: Sat, 16 Jul 2016 20:25:32 +0200

Dear authors,

Part of the IETF hackathon today, I integrated confdc , as a second YANG 
module compiler, in http://www.claise.be/IETFYANGPageCompilation.html. 
Reason? For example, confdc validates xpath while pyang doesn't.
And confdc found an issue with your draft, which is now flagged as 
failing the YANG compilation.
Please correct this issue.
Note: you're not alone, look at the green dip today on green graph 
<http://claise.be/IETFYANGPageCompilation.png>!

During the hackathon today, Carl Moberg also integrated the confdc 
output in his www.yangalidtor.com.
This might help you.

Regards, Benoit

---

From: Kent Watsen <[email-masked]>
Date: Sun, 17 Jul 2016 10:34:20 +0000

Hi Benoit,

Thanks for the report.   For this item, Confdc found one issue:

        [email-masked]:256: error: unexpected keyword 'must'

Here is the line in question:

          anyxml configuration { // pyang validation doesn't support anydata yet
            must "../configuration-handling";
            description
              "Any configuration data model known to the device.  It may
               contain manufacturer-specific and/or standards-based data
               models.";
         }

From 6020bis, the ABNF is:

   anyxml-stmt         = anyxml-keyword sep identifier-arg-str optsep
                         (";" /
                          "{" stmtsep
                              ;; these stmts can appear in any order
                              [when-stmt]
                              *if-feature-stmt
                              *must-stmt
                              [config-stmt]
                              [mandatory-stmt]
                              [status-stmt]
                              [description-stmt]
                              [reference-stmt]
                           "}") stmtsep

As far as I can tell, this should be valid YANG.

PS: I would rather be using anydata (not anyxml) but, as the comment above mentions, pyang validation (e.g., yang2dsdl) doesn’t support YANG 1.1 statements yet, so I’m temporarily using anyxml...

yang2dsdl -t data ietf-zerotouch-bootstrap-server\@2016-07-17.yang
Unknown keyword anydata - this should not happen.

Thanks,
Kent

From: Benoit Claise <[email-masked]>
Date: Saturday, July 16, 2016 at 8:25 PM
To: "[email-masked]" <[email-masked]>, "[email-masked]" <[email-masked]>
Subject: draft-ietf-netconf-zerotouch-09.txt: new error from confdc
Resent-From: <[email-masked]>
Resent-To: Kent Watsen <[email-masked]>, <"[email-masked]"@ietfa.amsl.com>
Resent-Date: Saturday, July 16, 2016 at 8:25 PM

Dear authors,

Part of the IETF hackathon today, I integrated confdc , as a second YANG module compiler, in http://www.claise.be/IETFYANGPageCompilation.html. Reason? For example, confdc validates xpath while pyang doesn't.
And confdc found an issue with your draft, which is now flagged as failing the YANG compilation.
Please correct this issue.
Note: you're not alone, look at the green dip today on green graph<http://claise.be/IETFYANGPageCompilation.png>!

During the hackathon today, Carl Moberg also integrated the confdc output in his www.yangalidtor.com<http://www.yangalidtor.com>.
This might help you.

Regards, Benoit

---

From: "Sterne, Jason (Nokia - CA)" <[email-masked]>
Date: Sun, 17 Jul 2016 23:32:41 +0000

Hi Benoit,

I think your link is a bit broken below (for yangvalidator.com).

Is confdc available as a standalone tool ?  I took a quick look around but didn’t find it.

Jason

From: Netconf [mailto:[email-masked]] On Behalf Of Benoit Claise
Sent: Saturday, July 16, 2016 14:26
To: [email-masked]; NETCONF
Subject: [Netconf] draft-ietf-netconf-zerotouch-09.txt: new error from confdc

Dear authors,

Regards, Benoit

---

From: Benoit Claise <[email-masked]>
Date: Mon, 18 Jul 2016 01:36:05 +0200

Hi Jason,
> I think your link is a bit broken below (for yangvalidator.com).
http://www.yangvalidator.com/
> Is confdc available as a standalone tool ?  I took a quick look around 
https://developer.cisco.com/site/confD/downloads/

Regards, B.
>
> Jason
>
> *From:*Netconf [mailto:[email-masked]] *On Behalf Of *Benoit 
> Claise
> *Sent:* Saturday, July 16, 2016 14:26
> *To:* [email-masked]; NETCONF
> *Subject:* [Netconf] draft-ietf-netconf-zerotouch-09.txt: new error 
> from confdc
>
> Dear authors,
>
>
> Part of the IETF hackathon today, I integrated confdc , as a second 
> YANG module compiler, in 
> http://www.claise.be/IETFYANGPageCompilation.html. Reason? For 
> example, confdc validates xpath while pyang doesn't.
> output in his www.yangalidtor.com <http://www.yangalidtor.com>.
> This might help you.
>
> Regards, Benoit
>

---

From: Per Hedeland <[email-masked]>
Date: Mon, 18 Jul 2016 11:48:23 +0200

On 2016-07-18 01:36, Benoit Claise wrote:
>> Is confdc available as a standalone tool ?  I took a quick look around but didnt find it.
>>

Well, not exactly "standalone" I guess... But anyway, for the purpose of
YANG validation, I would suggest that 'yanger' is a more appropriate
tool than 'confdc' - 'yanger' is "An extensible YANG validator and
converter" just like pyang, though not written in Python. confdc used to
use pyang "under the cover", but nowadays uses yanger instead.

Using yanger directly instead of via confdc will avoid getting reports
of tail-f-specific "errors" like "cannot compile submodules; compile the
module instead" or "cannot compile modules with top-level choices", and
will also avoid spending cycles on littering your file system with .fxs
files that are of no use in this context.

When using a ConfD installation per above, 'yanger' will be in your $PATH
just like 'confdc' - it doesn't have any actual documentation yet, but
invoking 'yanger -h' will give a usage summary. Typically you only need
to run 'yanger <file>' though.

--Per

> Regards, B.
> 
>> Jason
>>
>> *From:*Netconf [mailto:[email-masked]] *On Behalf Of *Benoit Claise
>> *Subject:* [Netconf] draft-ietf-netconf-zerotouch-09.txt: new error from confdc
>>
>> Dear authors,
>>
>>
>> Note: you're not alone, look at the green dip today on green graph <http://claise.be/IETFYANGPageCompilation.png>!
>>
>> During the hackathon today, Carl Moberg also integrated the confdc output in his www.yangalidtor.com <http://www.yangalidtor.com>.
>> This might help you.
>>
>> Regards, Benoit
>>
> 
> 
> 
> 
> _______________________________________________
> Netconf mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netconf
>

---

From: Per Hedeland <[email-masked]>
Date: Mon, 18 Jul 2016 12:15:48 +0200

Hi Kent,

This is clearly a bug in confdc, or rather in the 'yanger' validator
that it uses (see my previous message to netconf@) - will be fixed in an
upcoming release. (And FWIW, it has the same bug for anydata - will also
be fixed of course.) And unfortunately a "grammatical" error (even if
wrong:-) will terminate the analysis.

--Per

On 2016-07-17 12:34, Kent Watsen wrote:
> PS: I would rather be using anydata (not anyxml) but, as the comment above mentions, pyang validation (e.g., yang2dsdl) doesnt support YANG 1.1 statements yet, so Im temporarily using anyxml...
>

---

From: Per Hedeland <[email-masked]>
Date: Mon, 25 Jul 2016 13:03:40 +0200

Hi,

Unfortunately my advice below, to use yanger directly instead of via
confdc for the purpose of YANG validation, was a bit premature. Path
validation for 'must' and 'when' is only done (in a tail-f-specific
plugin) when yanger is invoked with '-f fxs', which confdc does - and I
gather this validation was a major reason to use confdc in this context.

Fixing this (i.e. making yanger "core" do this validation) is on the
TODO list, but for now it is probably preferable to use confdc (or
yanger with '-f fxs'), even though it will have the drawbacks I
mentioned below.

--Per

---

From: Reshad Rahman <[email-masked]>
Date: Mon, 25 Jul 2016 17:50:12 +0200

Hi,

Yes the main motivation to use confdc was to get the XPath validation which
pyang does not provide.

Regards,
Reshad.

On Mon, Jul 25, 2016 at 1:03 PM, Per Hedeland <[email-masked]> wrote:

> >>> Is confdc available as a standalone tool ?  I took a quick look around
> but didn t find it.
> >>>
> YANG module compiler, in http://www.claise.be/IETFYANGPageCompilation.html.
> >>> Note: you're not alone, look at the green dip today on green graph <
> http://claise.be/IETFYANGPageCompilation.png>!
> >>>

---

From: Per Hedeland <[email-masked]>
Date: Tue, 26 Jul 2016 13:22:48 +0200

> Yes the main motivation to use confdc was to get the XPath validation which

Well, hair-splitting perhaps, but yanger does do validation of the XPath
expression "as such" - but it doesn't (currently) validate that the
referenced nodes actually exist in the schema (what I referred to as
"path validation", there is probably some more correct term for it).
AFAIK an XPath expression that references such "impossible" nodes isn't
"invalid", but of course it is useful to find out that it does as part
of YANG validation.

--Per

---

From: Andy Bierman <[email-masked]>
Date: Tue, 26 Jul 2016 04:43:18 -0700

> "invalid", but of course it is useful to find out that it does as part

By useful, you mean must or when expressions that are not always false.

Because

    #if 0
       my-YANG ...
    #endif

is rarely what they had in mind

> --Per

Andy

> http://www.claise.be/IETFYANGPageCompilation.html.

---

From: Per Hedeland <[email-masked]>
Date: Tue, 26 Jul 2016 14:29:10 +0200

> By useful, you mean must or when expressions that are not always false.

No, I mean that it is useful that a tool for YANG validation reports on
"invalid nodes" in a must or when expression (AFAICT what the actual
result of the XPath evaluation will be, or even if it is always true or
false, will depend on exactly how those nodes appear in the full XPath
expression - but it could of course be "always false"). But I believe it
is not necessarily a requirement on a tool that claims to do "XPath
validation" to report on such nodes.

But it was just a clarification, since I (intentionally) wrote that
yanger didn't do "path validation", and got the reply that "XPath
validation" was indeed the important thing - feel free to ignore it.

--Per

---

From: Andy Bierman <[email-masked]>
Date: Tue, 26 Jul 2016 07:49:33 -0700

> validation" was indeed the important thing - feel free to ignore it.
Yes, you are more precise.
I would not ignore XPath validation.
I have not found any use-cases for explicitly stated node identifiers
that do not match any known YANG schema nodes in that context.
Valid XPath and correct XPath are not the same thing. (Just like source
code.)

--Per
Andy

> <