Skip to content

Resolve "Update yang model with valid-lifetime for classes"

Closes #2136 (closed).

This is obviously more than was requested, but I'm hoping that I don't get scolded for getting things done and that the reviewer sees the problems in the old code and the utility of the new changes and that the reviewer is not annoyed by the size of the changes and instead works with me to get things done. This whole thing took me five hours to do. It should take the reviewer far less.

  • "valid-lifetime", "min-valid-lifetime", "max-valid-lifetime", "preferred-lifetime", "min-preferred-lifetime", "max-preferred-lifetime" were added in YANG modules at the client class level.
  • In search of any existing tests, I found that some .json files in doc were not tested against. I've enabled all of them.
    • I suggest we leave all of them enabled. If a new config parameter is added in all-keys.json, it's important for these tests to fail so that we know that it's not enabled in YANG. The developer can find ways to silence the test. GTEST_FILTER supports inverse matching. GTEST_FILTER='-:Translator*' make check.
  • This revealed a problem with "store-extended-info" which was added in a recent issue. It was an operational node, instead of a config node. I moved it to the right place. This means it never worked.
  • Added all the other nodes which were missing from all-keys.json. These are: cache-*, on-fail, compatibility, lenient-option-parsing, ddns-*, ip-reservations-unique, multi-threading and its children, reservations-*, statistic-default-sample-age, statistic-default-sample-count. All tests with .json files are now passing.
  • Fixed two error messages in sysrepo_setup_tests.cc which were not accurate. The commands were for the old sysrepo. And actual revision and expected revision were swapped.
  • getParam() was moved from translator_config.(cc|h) to translator.(cc|h) so that I can use it in more places, and renamed to checkAndGetLeaf() to be more descriptive and also consistent with checkAndSetLeaf().
  • Made reinstall.sh now update your YANG module automatically if the revision in repo is newer. YANG data is also automatically migrated in the process. Closes #2048 (closed).
  • Added -u to reinstall.sh to uninstall YANG modules first. Very useful when developing and doing changes on the same YANG revision. Just reinstall.sh -u and make check.
  • Rewrote the pyang trees in comments to make sure the newly added nodes are there. I would delete these trees because nobody looks at them anyway and they need maintaining. If the reviewer feels the same way, do mention it.
Edited by Andrei Pavel

Merge request reports