forked from trigger/trigger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Moved TextFSM vendor mapping functionality into the NetDevices object. The NetDevices object now has an "os" attribute. * Added more tests including a test for the template parser.
- Loading branch information
Showing
9 changed files
with
168 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
10 changes: 10 additions & 0 deletions
10
tests/data/vendor/ntc_templates/cisco_ios_show_clock.template
This file contains 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,10 @@ | ||
Value TIME (\d+:\d+:\d+\.\d+) | ||
Value TIMEZONE (\w+) | ||
Value DAYWEEK (\w+) | ||
Value MONTH (\w+) | ||
Value DAY (\d+) | ||
Value YEAR (\d+) | ||
|
||
Start | ||
^[\*]?${TIME}\s${TIMEZONE}\s${DAYWEEK}\s${MONTH}\s${DAY}\s${YEAR} -> Record | ||
|
15 changes: 15 additions & 0 deletions
15
tests/data/vendor/ntc_templates/cisco_ios_show_version.template
This file contains 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,15 @@ | ||
Value VERSION (\d+\.\d+(.+).*) | ||
Value HOSTNAME (\S+) | ||
Value UPTIME (.+) | ||
Value RUNNING_IMAGE (\S+) | ||
Value HARDWARE ((WS-C\S+)|(\d+)|(CSR\S+)) | ||
Value SERIAL (\S+) | ||
Value CONFIG_REGISTER (\S+) | ||
|
||
Start | ||
^.*Software\s.+\),\sVersion\s${VERSION}, RELEASE.* | ||
^${HOSTNAME}\s+uptime\s+is\s+${UPTIME} | ||
^[sS]ystem\s+image\s+file\s+is\s+".*flash:${RUNNING_IMAGE}" | ||
^[Cc]isco\s+${HARDWARE}.+ | ||
^[Ss]ystem serial number\s+:\s+${SERIAL} | ||
^[Cc]onfiguration\s+register\s+is\s+${CONFIG_REGISTER} -> Record |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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