snabb
snabb copied to clipboard
Add snabb config test functionality
@wingo as mentioned on Slack earlier 🙂
Reworks snabb config command line parsing slightly to implement snabb config test.
snabb config test loads a schema passed with -s either by name (if already known by snabb) or by file path, then validates a passed configuration FILE against the schema.
If no -s is given but ID is passed, then config test attempts to connect to the instance and grab the current schema.
Also modifies the log() function so that informational log messages like the ones below are only printed when verbose is passed to yang.load_configuration:
config/snabb.conf: loading compiled configuration from config/snabb.o
config/snabb.conf: compiled configuration is up to date.
NOTE: WIP as I haven't tested this against running snabb instances yet, will complete this next week.
FWIW there is an ad-hoc implementation of this functionality in vita so this will be very useful to me! :heart:
@wingo re: should we ever config test a compiled file - no, that's a good point 😃- I'll rework this as config compile.
(JFYI I didn't merge this on my sweep through open PRs just now because based on the discussion it seems like changes are pending.)
Yep, pending a rewrite I'm hoping to get around to after more $work related things :D