- We have a CLI-based app that leverages YANG models .
- This App is probably parsing YANG models under the hood and exposing variables in YANG as arguments on the CLI.
example: lets say the app is doing BGP YANG model as CLI arguments, where they will look like this:
./app.py -a bgp_neighbor -b bgp_source -c bgp_port -d remote_AS_number -e local_AS_number
- Want to make sure that all the arguments are there and nothing is missing, without having to read every single argument, so basically looking for automating that task of comparing CLI arguments with YANG models.
- Probably need to write some code to validate that CLI will expose all the YANG variables in the model, we need to make sure that CLI is not missing any variables.
- Are there any tools out there that can be stitched together with YDK to do something similar, without having to write code from scratch
There's anything the YDK can help with here out of the box. It seems that the arguments you need to validate would completely depend on the YANG model, so have you thought about expressing those arguments in a way that allows you to map them to paths in the yang model you care about.
Without knowing bit more about what you are trying to achieve and how it relates to your potential target models, it's hard to conclude how the YDK may or may not be able to help you, or if some other solution is more appropriate.
This App is probably parsing YANG models under the hood and exposing variables in YANG as arguments on the CLI.
example: lets say the app is doing BGP YANG model as CLI arguments, where they will look like this:
./app.py -a bgp_neighbor -b bgp_source -c bgp_port -d remote_AS_number -e local_AS_number
Nodes should really be specified by path instead of name. A name can be used at different places in a model. Also, the size of an average model will make a CLI-argument approach rather impractical.
Maybe if you describe the underlying problem that the app is trying to achieve, we could see if YDK can help.
you are right, its a full path, something like :
./app.py create <CPENAME> pe <PENAME> network <NETWORKNAME> force
./app.py delete <CPENAME> pe <PENAME> network <NETWORKNAME> force
Once a create is used then all recursive arguments are populated from that yang model.
In this case, say the latter argument called 'force' is already in the YANG model but it doesn't serve any purpose/function, which was a valid test case where we tried 'force' and it crashed the app., so just trying to find a way to automatically generate test cases for checking similar kind of issues, as these YANG models keep getting updated all the time.
Comments
0 comments
Please sign in to leave a comment.