-
Notifications
You must be signed in to change notification settings - Fork 42
Add sample xml skeleton plugin #42
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
Open
ljbevemyr
wants to merge
1
commit into
mbj4668:master
Choose a base branch
from
ljbevemyr:sample_xml_skeleton_plugin
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| include ../../support/*_testcases.mk | ||
|
|
||
| build: | ||
|
|
||
| clean: | ||
| rm -rf lux_logs _tmp_* | ||
|
|
||
| .PHONY: build clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| {string, "populate type string"}. | ||
| {unit8, "16"}. | ||
| {unit32, "32"}. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. uint32 - maybe? |
||
| {{yang, 'date-and-time'}, "1985-04-12T23:20:50.52Z"}. | ||
| {{inet,'ip-address'}, "192.168.1.5"}. | ||
317 changes: 317 additions & 0 deletions
317
test/lux/sample-xml-skeleton/sample_xml_skeleton_annotations.lux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,317 @@ | ||
| # author: lbevemyr@cisco.com | ||
| [doc] | ||
| Test of the yanger sample xml skeleton plugin with annotations option | ||
|
|
||
| The tests include the option --sample-xml-skeleton-annotations which adds | ||
| annotations in the output. The option is tested with both config true (config) | ||
| and config false (data). | ||
| [enddoc] | ||
|
|
||
|
|
||
| [macro sample-xml-skeleton_data FILE] | ||
| ~yanger -f sample-xml-skeleton -p ${DIR} ${DIR}/${FILE} | ||
| ! --sample-xml-skeleton-doctype data --sample-xml-skeleton-annotations | ||
| [endmacro] | ||
|
|
||
| [macro sample-xml-skeleton_config FILE] | ||
| ~yanger -f sample-xml-skeleton -p ${DIR} ${DIR}/${FILE} | ||
| ! --sample-xml-skeleton-doctype config --sample-xml-skeleton-annotations | ||
| [endmacro] | ||
|
|
||
| [shell test_yanger_sample-xml-skeleton] | ||
| [timeout 10] | ||
|
|
||
| [global DIR=../tree] | ||
| [invoke sample-xml-skeleton_data small3.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/> | ||
| """ | ||
| [invoke sample-xml-skeleton_config small3.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | ||
| <dynamic-profiles xmlns="http://xml.juniper.net/junos/10.0R3/junos"> | ||
| <!-- # keys: name --> | ||
| <!-- # entries: 0.. --> | ||
| <name> | ||
| <!-- type: string --> | ||
| </name> | ||
| <variables> | ||
| <!-- # keys: mandatory --> | ||
| <!-- # entries: 0.. --> | ||
| <name> | ||
| <!-- type: empty --> | ||
| </name> | ||
| <default-value> | ||
| <!-- type: empty --> | ||
| </default-value> | ||
| <mandatory> | ||
| <!-- type: string --> | ||
| </mandatory> | ||
| </variables> | ||
| </dynamic-profiles> | ||
| </config> | ||
| """ | ||
|
|
||
| [invoke sample-xml-skeleton_data small4.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/> | ||
| """ | ||
| [invoke sample-xml-skeleton_config small4.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | ||
| <dynamic-profiles xmlns="http://xml.juniper.net/junos/10.0R3/junos"> | ||
| <!-- # keys: name --> | ||
| <!-- # entries: 0.. --> | ||
| <name> | ||
| <!-- type: string --> | ||
| </name> | ||
| <inget> | ||
| <!-- # keys: name --> | ||
| <!-- # entries: 0.. --> | ||
| <name> | ||
| <!-- type: string --> | ||
| </name> | ||
| <variables> | ||
| <!-- # keys: mandatory --> | ||
| <!-- # entries: 0.. --> | ||
| <name> | ||
| <!-- type: empty --> | ||
| </name> | ||
| <default-value> | ||
| <!-- type: empty --> | ||
| </default-value> | ||
| <mandatory> | ||
| <!-- type: string --> | ||
| </mandatory> | ||
| </variables> | ||
| </inget> | ||
| </dynamic-profiles> | ||
| </config> | ||
| """ | ||
| [invoke sample-xml-skeleton_data small5.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/> | ||
| """ | ||
| [invoke sample-xml-skeleton_config small5.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | ||
| <d xmlns="urn:q"> | ||
| <e/> | ||
| </d> | ||
| </config> | ||
| """ | ||
| [invoke sample-xml-skeleton_data a.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | ||
| <x xmlns="urn:a"> | ||
| <foo> | ||
| <!-- # entries: 0.. --> | ||
| <bar> | ||
| <!-- type: int32 --> | ||
| </bar> | ||
| <baz> | ||
| <!-- type: int32 --> | ||
| </baz> | ||
| </foo> | ||
| </x> | ||
| </data> | ||
| """ | ||
| [invoke sample-xml-skeleton_config a.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/> | ||
| """ | ||
|
|
||
| # use pyang test modules | ||
| [global DIR=./test_good] | ||
| [invoke sample-xml-skeleton_data yt5.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/> | ||
| """ | ||
| [invoke sample-xml-skeleton_config yt5.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | ||
| <con2 xmlns="urn:ietf:params:xml:ns:yang:yt5"> | ||
| <con3> | ||
| <b> | ||
| <bb> | ||
| <e> | ||
| <f> | ||
| <g> | ||
| <!-- type: int64 --> | ||
| </g> | ||
| <h> | ||
| <!-- type: con2 --> | ||
| </h> | ||
| <i> | ||
| <!-- type: con2 --> | ||
| </i> | ||
| </f> | ||
| </e> | ||
| <d> | ||
| <!-- type: int8 --> | ||
| </d> | ||
| </bb> | ||
| </b> | ||
| </con3> | ||
| </con2> | ||
| <foo xmlns="urn:ietf:params:xml:ns:yang:yt5"> | ||
| <foo> | ||
| <!-- type: foo --> | ||
| </foo> | ||
| </foo> | ||
| <foo2 xmlns="urn:ietf:params:xml:ns:yang:yt5"> | ||
| <foo3> | ||
| <foo> | ||
| <!-- type: foo --> | ||
| </foo> | ||
| <foo4> | ||
| <!-- type: foobar --> | ||
| <!-- # entries: 0.. --> | ||
| </foo4> | ||
| </foo3> | ||
| <foo4> | ||
| <foo> | ||
| <!-- type: foo --> | ||
| </foo> | ||
| <foo4> | ||
| <!-- type: foobar --> | ||
| <!-- # entries: 0.. --> | ||
| </foo4> | ||
| </foo4> | ||
| </foo2> | ||
| <foo3 xmlns="urn:ietf:params:xml:ns:yang:yt5"> | ||
| <!-- # keys: foo --> | ||
| <!-- # entries: 0.. --> | ||
| <foo> | ||
| <!-- type: foo --> | ||
| </foo> | ||
| <bar> | ||
| <!-- type: foo --> | ||
| </bar> | ||
| <yyy> | ||
| <!-- type: binary --> | ||
| <!-- # entries: 2..12 --> | ||
| </yyy> | ||
| <yyy/> | ||
| <baz> | ||
| <!-- type: int16 --> | ||
| </baz> | ||
| <goo> | ||
| <!-- type: foo --> | ||
| </goo> | ||
| <zzz> | ||
| <zzzz> | ||
| <!-- type: uint32 --> | ||
| </zzzz> | ||
| </zzz> | ||
| </foo3> | ||
| </config> | ||
| """ | ||
|
|
||
| [invoke sample-xml-skeleton_data yt6.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | ||
| <bar xmlns="urn:ietf:params:xml:ns:yang:yt6"> | ||
| <!-- # keys: bar1 --> | ||
| <!-- # entries: 0.. --> | ||
| <zz3> | ||
| <!-- type: y:date-and-time --> | ||
| <!-- # entries: 4..14 --> | ||
| </zz3> | ||
| <zz3/> | ||
| <zz3/> | ||
| <zz3/> | ||
| </bar> | ||
| </data> | ||
| """ | ||
|
|
||
| [invoke sample-xml-skeleton_config yt6.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | ||
| <foo xmlns="urn:ietf:params:xml:ns:yang:yt6"> | ||
| <bar1> | ||
| <!-- type: y:counter32 --> | ||
| </bar1> | ||
| <bar3> | ||
| <!-- type: int32 --> | ||
| </bar3> | ||
| <bar4> | ||
| <!-- type: int32 --> | ||
| </bar4> | ||
| <bar5> | ||
| <!-- type: int32 --> | ||
| </bar5> | ||
| <x> | ||
| <!-- type: int32 --> | ||
| </x> | ||
| <y> | ||
| <!-- type: string --> | ||
| </y> | ||
| <z/> | ||
| <xxx> | ||
| <!-- type: binary --> | ||
| </xxx> | ||
| <zzz> | ||
| <!-- type: int64 --> | ||
| </zzz> | ||
| </foo> | ||
| </config> | ||
| """ | ||
|
|
||
| [invoke sample-xml-skeleton_data yt9.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/> | ||
| """ | ||
| [invoke sample-xml-skeleton_config yt9.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | ||
| <a1 xmlns="urn:ietf:params:xml:ns:yang:yt9"> | ||
| <!-- type: int32 --> | ||
| </a1> | ||
| <con1 xmlns="urn:ietf:params:xml:ns:yang:yt9"> | ||
| <a2> | ||
| <!-- type: string --> | ||
| </a2> | ||
| </con1> | ||
| </config> | ||
| """ | ||
|
|
||
| [invoke sample-xml-skeleton_data yt10.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/> | ||
| """ | ||
| [invoke sample-xml-skeleton_config yt10.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | ||
| <test xmlns="urn:ietf:params:xml:ns:yang:yt10"> | ||
| <X> | ||
| <!-- type: int32 --> | ||
| </X> | ||
| <Y> | ||
| <!-- type: uint32 --> | ||
| </Y> | ||
| </test> | ||
| </config> | ||
| """ | ||
|
|
||
| [invoke sample-xml-skeleton_data w.yang] | ||
| """??? | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/> | ||
| """ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint8 - maybe?