There are two ways to contribute:
- Create a new template.
- Update an existing template.
- Create a TextFSM template for a given show command and store it in ntc_templates
- Add that TextFSM template to the index file.
- Create a test input file (containing the raw output of the show command) and give it the extension
.raw
. - Create a file containing the correct parsed results and give it the extentsion
.parsed
. - Store both the
.raw
and.parsed
files in tests/platform - (Optional) If creating more than one test case, i.e. more than one
.raw
and.parsed
files, repeat steps 3-5 but add a test_suffix_number to the files as described in File naming conventions below.
- Update the existing TextFSM template in ntc_templates
- Repeat steps 3-6 from Creating a new template above.
All files submitted for a show command should follow a strict naming convention:
base_filename + [_test_suffix_number] + extension
base_filename: platform_commandname
Template extension: .template
Raw test file extension: .raw
Parsed test file extension: .parsed
test_suffix_number: <integer>
Example: Cisco's
show vlan
command template file: cisco_ios_show_vlan.template raw test file: cisco_ios_show_vlan.raw parsed test file: cisco_ios_show_vlan.parsed alternate raw test file: cisco_ios_show_vlan_1.raw alternate parsed test file: cisco_ios_show_vlan_1.parsed
To test a template, run test-template.yml
as a playbook and follow the prompts.
Note:
platform
should be prefixed by a validnetmiko
device_type
- See "
platform
Naming Conventions" in the README
- See "
- device support in netmiko is required.
Documentation on TextFSM: https://github.com/google/textfsm/wiki/TextFSM