On 01/16/2018 09:06 PM, Juergen Schoenwaelder wrote:
On Tue, Jan 16, 2018 at 08:19:38PM +0100, Vladimir Vassilev wrote:
As for the automated validation of the tree diagrams as an added value to
the human readability I have the following thoughts. I would like to be able
to compare unlimited line length tree outputs generated by different YANG
compilers for equality. This is mainly a way to have some partial common
denominator output for validating YANG is correctly compiled which we did
not have until now. For example as soon as I have support for Schema mount I
would compare the tree output with another tool known to work and add some
testcases based on that. I do not see any automated alternative for doing
this except writing NETCONF chat scripts (also module specific), or writing
not only YANG module specific but also API specific test cases as 3rd
option. 1) does not compromise this automated validation option since space
sequences can be collapsed to single space. If the alignment algorithm was
creating a possibility for nontrivial output variation then I would have
supported strongly 3) but this is not the current case.

If you want to make sure a YANG compiler is correct, simply write a
backend that generates a serialized YANG module in canonical
form. They YANG modules should be the same. Determining YANG compiler
correctness by comparing tree diagrams does not seem to be a
convincing approach since tree diagrams by design leave many details
out.
The advantage I see is that 'uses' and 'augments' are resolved in the tree output. For example one can not cach bug in the reolution of the configure flag in a uses expanded under case with "configure false;" by generating YANG with unresolved 'uses'.  Another example - one can not represent the result of multiple modules augmenting e.g. /interfaces with a YANG module. The only universal representation is the YANG tree.

Vladimir
/js


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

Reply via email to