-
Notifications
You must be signed in to change notification settings - Fork 788
Create HP Comware display version #2206
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
marcus-cain
wants to merge
3
commits into
networktocode:master
Choose a base branch
from
fidelity-contributions:hp_comware_display_version
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
Show all changes
3 commits
Select commit
Hold shift + click to select a range
4edf449
Created new template for display version. Added multidude of test fil…
marcus-cain babb07a
improved template by consolidating regex lines that had common patter…
marcus-cain 294d185
Added Record action to the regex Line that captures the model for Co…
marcus-cain 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
57 changes: 57 additions & 0 deletions
57
ntc_templates/templates/hp_comware_display_version.textfsm
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,57 @@ | ||
| Value SOFTWARE_VERSION (\S+) | ||
| Value SOFTWARE_RELEASE (\S+) | ||
| Value MODEL (.+?) | ||
| Value UPTIME (.+?) | ||
| Value LAST_REBOOT_REASON (.+) | ||
| Value SLOT_NUMBER (\d+) | ||
|
|
||
|
|
||
| Start | ||
| ^\s*(HPE?\s+)?Comware\s+Software,\s+Version\s+${SOFTWARE_VERSION},\s+(Feature|Release)\s+${SOFTWARE_RELEASE} | ||
| ^\s*(H3C|HP)\s+Comware\s+ | ||
| ^\s*Copyright\s+\(c\) | ||
| ^\s*(HPE?|H3C)\s+${MODEL}\s+(\d+-slot|EI|HI|Switch|\(\d+W\)).+uptime\s+is\s+${UPTIME}$$ | ||
| ^\s*(HPE?|H3C)\s+${MODEL}\s+uptime\s+is\s+${UPTIME}$$ -> Record | ||
| ^\s*Hardware\s+Version | ||
| ^\s*Bootrom\s+Version | ||
| ^\s*CPLD | ||
| ^\s*\d+[A-Z]\s+bytes | ||
| ^\s*Last\s+reboot\s+reason\s+:\s+${LAST_REBOOT_REASON} | ||
| ^\s*Boot\s+image(\s+version)?: | ||
| ^\s*Compiled\s*.+ | ||
| ^\s*System\s+image(\s+version)?: -> Record | ||
| ^\s*Feature\s+image | ||
| ^\s*Patch\s+image\(s\)\s*list: | ||
| ^\s*flash: | ||
| ^\s*(HPE?|H3C)\s+.+ | ||
| ^\s*Slot\s*${SLOT_NUMBER}:?\s* -> Slot | ||
| ^\s*MPU\([MS]\)\s+(Slot\s*)?${SLOT_NUMBER}:?\s* -> Slot | ||
| ^\s*LPU\s+${SLOT_NUMBER}:?\s* -> Slot | ||
| ^\s*\[SubSlot\s*\d+\] | ||
| ^\s*$$ | ||
| ^. -> Error | ||
|
|
||
| Slot | ||
| ^\s*Slot\s*${SLOT_NUMBER}:?\s* | ||
| ^\s*MPU\([MS]\)\s+(Slot\s*)?${SLOT_NUMBER}:?\s* | ||
| ^\s*LPU\s+${SLOT_NUMBER}:?\s* | ||
| ^\s*Uptime\s+is\s+${UPTIME}$$ | ||
| ^\s*Release\s+Version: | ||
| ^\s*BOARD\s+TYPE: | ||
| ^\s*HPE?\s+${MODEL}\s+(Switch|with) | ||
| ^\s*${MODEL}\s+(Switch|with) | ||
| ^\s*(DRAM|FLASH|NVRAM): | ||
| ^\s*PCB | ||
| ^\s*(Basic|Extended)\s+BootWare\s+Version | ||
| ^\s*FPGA | ||
| ^\s*Boot[rR]om\s+Version:? | ||
| ^\s*(Bootware|Hardware)\s+Version | ||
| ^\s*CPLD | ||
| ^\s*Patch\s+Version\s*: | ||
| ^\s*Reboot\s+Cause\s*:\s+${LAST_REBOOT_REASON} | ||
| ^\s*Last\s+reboot\s+reason\s+:\s+${LAST_REBOOT_REASON} | ||
| ^\s*\d+[A-Z]\s+bytes | ||
| ^\s*Config\s+Register | ||
| ^\s*\[SubSlot\s*\d+\] -> Record | ||
| ^\s*$$ -> Record | ||
| ^. -> Error |
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
190 changes: 190 additions & 0 deletions
190
tests/hp_comware/display_version/hp_comware_display_version_cw5_1.raw
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,190 @@ | ||
| H3C Comware Platform Software | ||
| Comware Software, Version 5.20, Feature 6709L25 | ||
| Copyright (c) 2004-2015 Hangzhou H3C Tech. Co., Ltd. All rights reserved. | ||
| H3C S7510E uptime is 309 weeks, 1 day, 16 hours, 15 minutes | ||
|
|
||
| LPU 0: | ||
| Uptime is 309 weeks,1 days,17 hours,37 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 1: | ||
| Uptime is 309 weeks,1 days,17 hours,36 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 2: | ||
| Uptime is 309 weeks,1 days,17 hours,47 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 3: | ||
| Uptime is 309 weeks,1 days,17 hours,37 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 4: | ||
| Uptime is 309 weeks,1 days,17 hours,42 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| MPU(M) 5: | ||
| Uptime is 309 weeks,1 days,16 hours,15 minutes | ||
| H3C S7510E MPU(M) with 1 BCM1125H Processor | ||
| BOARD TYPE: LSQ1SRP12GB | ||
| DRAM: 512M bytes | ||
| FLASH: 64M bytes | ||
| NVRAM: 512K bytes | ||
| PCB 1 Version: VER.C | ||
| PCB 2 Version: VER.B | ||
| Bootrom Version: 500 | ||
| CPLD 1 Version: 003 | ||
| CPLD 2 Version: 004 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| MPU(S) 6: | ||
| Uptime is 309 weeks,1 days,17 hours,38 minutes | ||
| H3C S7510E MPU(S) with 1 BCM1125H Processor | ||
| BOARD TYPE: LSQ1SRP12GB | ||
| DRAM: 512M bytes | ||
| FLASH: 64M bytes | ||
| NVRAM: 512K bytes | ||
| PCB 1 Version: VER.C | ||
| PCB 2 Version: VER.B | ||
| Bootrom Version: 500 | ||
| CPLD 1 Version: 003 | ||
| CPLD 2 Version: 004 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 7: | ||
| Uptime is 309 weeks,1 days,17 hours,51 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 8: | ||
| Uptime is 309 weeks,1 days,17 hours,43 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 9: | ||
| Uptime is 309 weeks,1 days,17 hours,46 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 10: | ||
| Uptime is 309 weeks,1 days,17 hours,40 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 11: | ||
| Uptime is 309 weeks,1 days,17 hours,37 minutes | ||
| H3C S7510E LPU with 1 XLS408 Processor | ||
| BOARD TYPE: LSQ3GV48SC | ||
| DRAM: 1024M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: VER.B | ||
| Bootware Version: 5.18 | ||
| CPLD 1 Version: 003 | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 12: | ||
| Uptime is 309 weeks,1 days,18 hours,8 minutes | ||
| H3C S7510E LPU with 1 BCM1122 Processor | ||
| BOARD TYPE: SRP12GBSLAVE | ||
| DRAM: 512M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: NA | ||
| Bootware Version: 3.06 | ||
| CPLD 1 Version: NA | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None | ||
|
|
||
| LPU 13: | ||
| Uptime is 309 weeks,1 days,18 hours,29 minutes | ||
| H3C S7510E LPU with 1 BCM1122 Processor | ||
| BOARD TYPE: SRP12GBSLAVE | ||
| DRAM: 512M bytes | ||
| FLASH: 0M bytes | ||
| NVRAM: 0K bytes | ||
| PCB 1 Version: NA | ||
| Bootware Version: 3.06 | ||
| CPLD 1 Version: NA | ||
| Release Version: H3C S7510E-6709L25 | ||
| Patch Version : None |
92 changes: 92 additions & 0 deletions
92
tests/hp_comware/display_version/hp_comware_display_version_cw5_1.yml
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,92 @@ | ||
| --- | ||
| parsed_sample: | ||
| - last_reboot_reason: "" | ||
| model: "S7510E" | ||
| slot_number: "" | ||
| software_release: "6709L25" | ||
| software_version: "5.20" | ||
| uptime: "309 weeks, 1 day, 16 hours, 15 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "0" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,37 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "1" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,36 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "2" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,47 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "3" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,37 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "4" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,42 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E MPU(M)" | ||
| slot_number: "5" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,16 hours,15 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E MPU(S)" | ||
| slot_number: "6" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,38 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "7" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,51 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "8" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,43 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "9" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,46 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "10" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,40 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "11" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,17 hours,37 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "12" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,18 hours,8 minutes" | ||
| - last_reboot_reason: "" | ||
| model: "H3C S7510E LPU" | ||
| slot_number: "13" | ||
| software_release: "" | ||
| software_version: "" | ||
| uptime: "309 weeks,1 days,18 hours,29 minutes" |
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
This cw5_1 file seems awful similar to cw5_2 (and thus its raw output too).
Is this correct @marcus-cain?
We should strive to keep test data to the cover the differences and reduce any duplication/redundancy.
In the case I've overlooked any meaningful differences, my apologies.