Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-734

yang-system-test: -p directories are for dependency search

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 7480

    Description

      This request is not very compatible with YANGTOOLS-726 so that would need to use option different from -p.

      Examining existing Yang validators, it turns out their focus is not on validating a whole set of Yang models, but on validating a single Yang file instead.
      This single file is given as an argument (not -p option).

      Of course most Yang modules are including other modules, so to ascertain validity those other modules should also be available. Thus a Yang validator needs to be able to search for dependencies, and -p directories are the locations the validator should search for the needed files in (defaulting to current working directory if no -p is given).

      In order for yang-system-test to be used as a Yang validator in existing validation frameworks, it should honor the same semantics.

      As a evidence, here [0] is description of -p in yanglint, and here [1] is how yangvalidator.com invokes pyang to validate a particular Yang file.

      [0] https://github.com/CESNET/libyang/blob/master/tools/lint/main_ni.c#L50
      [1] https://github.com/cmoberg/bottle-yang-extractor-validator/blob/master/bottle-yang-extractor-validator/main.py#L93

      P.S.: For purpose of validation of single files, perhaps odl-yang-validator would be a better name than yang-system-test.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pkajsa Peter Kajsa
            vrpolak Vratko Polak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: