-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submodels #68
base: master
Are you sure you want to change the base?
Submodels #68
Conversation
Hmm, this is quite a substantial change. Can you be more specific about its purpose? Is it similar to schema mount [RFC 8528]? |
I don’t support adding more features to Yangson until the XML-feature is solid. I’m concerned about what XML-testing has been performed. What is needed are for XML-oriented test cases to be added to test/test_module.py, such as:
It may be that this PR is needed in order to process the nodes from the "subtest" module, but I don't see it yet. |
I was unaware of RFC 8528, but I think it should be the same or similar... I am using it to multiple YANG definition files into a larger YANG specification without any need to edit them. In my server I ususe the "ietf-restconf@2017-01-26.yang" unified model as a base... then hook in (at the "data" node) the users YANG model... than add the RPCs under the "operations" node (and so forth with "ietf-restconf-monitoring:restconf-state" and "ietf-yang-library:modules-state"). This makes it very easy to construct a representation of all Restconf nodes the server uses, which makes input and output checking very easy. No need to parse the incoming GET/PUT/POST Paths by hand to decide that I have to add the modules-state to the output, I can just add it to the instance data. |
I have a set of (machine readable) XML and JSON testcases I collected from the RFCs that I use to verify me servercode at https://github.com/fkie/ietf-restconf-testcases .
|
It is comforting to see the testing that exists for your server. But I think that XML-oriented tests need to exist in the Yangson tree as well. Regarding #1, yes, Regarding #4, a Yangson test would just serialize/deserialise a known-good instance document - no other "processing" needs to occur, AFAICT. |
I wonder what would be needed to use the same kind of tests with Yangson... maybe each test could have a JSON and a XML version of input output and we could test Yangson by converting between the two? An alternative would be to build a Yangson Data instance object "by hand" (in python code). |
This extension of yangson allows the user to hook multiple YANG trees together into a larger schemata without manually joining them. This make it easy to add IETF defined subtrees like "ietf-yang-library:modules-state" and process incoming requests in one yangson call.