snabb icon indicating copy to clipboard operation
snabb copied to clipboard

Add snabb config test functionality

Open benagricola opened this issue 7 years ago • 4 comments

@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.

benagricola avatar May 03 '18 16:05 benagricola

FWIW there is an ad-hoc implementation of this functionality in vita so this will be very useful to me! :heart:

eugeneia avatar Jun 01 '18 14:06 eugeneia

@wingo re: should we ever config test a compiled file - no, that's a good point 😃- I'll rework this as config compile.

benagricola avatar Jun 04 '18 09:06 benagricola

(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.)

lukego avatar Jul 30 '18 10:07 lukego

Yep, pending a rewrite I'm hoping to get around to after more $work related things :D

benagricola avatar Jul 30 '18 10:07 benagricola