forked from networktocode/ntc-templates
-
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.
CiscoS300 'show interfaces switchport' template (networktocode#1524)
* Fix value names due to new Data model
- Loading branch information
1 parent
af7800d
commit bd98337
Showing
4 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
ntc_templates/templates/cisco_s300_show_interfaces_switchport.textfsm
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,53 @@ | ||
Value INTERFACE (\S+) | ||
Value INTERFACE_MODE (\S+) | ||
Value GVRP_STATUS (\S+) | ||
Value INGRESS_FILTERING_STATUS (\S+) | ||
Value ACCEPTABLE_FRAME_TYPE (\S+) | ||
Value NATIVE_VLAN (\S+) | ||
Value List VLAN (\d+) | ||
Value List NAME (.*?) | ||
Value List EGRESS_RULE (Untagged|Tagged) | ||
Value List INTERFACE_MEMBERSHIP_TYPE (\S+) | ||
Value List FORBIDDEN_VLAN (\d+) | ||
Value List FORBIDDEN_VLAN_NAME (.*) | ||
Value List MAC_BASED_VLAN_GROUP_ID (\d+) | ||
Value List MAC_BASED_VLAN_ID (\d+) | ||
|
||
Start | ||
^\s*Port\s*:\s*${INTERFACE}\s*$$ | ||
^\s*Port\s+Mode\s*:\s*${INTERFACE_MODE}\s*$$ | ||
^\s*Gvrp\s+Status\s*:\s*${GVRP_STATUS}\s*$$ | ||
^\s*Ingress\s+Filtering\s*:\s*${INGRESS_FILTERING_STATUS}\s*$$ | ||
^\s*Acceptable\s+Frame\s+Type\s*:\s*${ACCEPTABLE_FRAME_TYPE}\s*$$ | ||
^\s*Ingress\s+UnTagged\s+VLAN\s*\(\s*NATIVE\s*\)\s*:\s*${NATIVE_VLAN}\s*$$ | ||
^\s*Port\s+is\s+member\s+in:\s*$$ -> PartOfVlan | ||
^\s*$$ | ||
^. -> Error | ||
|
||
PartOfVlan | ||
^\s*Vlan\s+Name\s+Egress\s+rule\s+Port\s+Membership\s+Type\s*$$ | ||
^(\s*-*)*\s*$$ | ||
^\s*${VLAN}\s+${NAME}\s+${EGRESS_RULE}\s+${INTERFACE_MEMBERSHIP_TYPE}\s*$$ | ||
^\s*Forbidden\s+VLANS:\s*$$ -> ForbiddenVlans | ||
^\s*$$ | ||
^. -> Error | ||
|
||
ForbiddenVlans | ||
^\s*Vlan\s+Name\s*$$ | ||
^(\s*-*)*\s*$$ | ||
^\s*${FORBIDDEN_VLAN}\s+${FORBIDDEN_VLAN_NAME}\s*$$ | ||
^\s*Classification\s+rules:\s*$$ -> ClassificationRules | ||
^\s*$$ | ||
^. -> Error | ||
|
||
ClassificationRules | ||
^\s*Mac\s+based\s+VLANs:\s*$$ -> MacBasedVlans | ||
^\s*$$ | ||
^. -> Error | ||
|
||
MacBasedVlans | ||
^\s*Group\s+ID\s+Vlan\s+ID\s*$$ | ||
^(\s*-*)*\s*$$ | ||
^\s*${FORBIDDEN_VLAN}\s+${FORBIDDEN_VLAN_NAME}\s*$$ | ||
^\s*$$ | ||
^. -> Error |
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
25 changes: 25 additions & 0 deletions
25
tests/cisco_s300/show_interfaces_switchport/cisco_s300_show_interfaces_switchport.raw
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,25 @@ | ||
Port : fa1 | ||
Port Mode: Trunk | ||
Gvrp Status: disabled | ||
Ingress Filtering: true | ||
Acceptable Frame Type: admitAll | ||
Ingress UnTagged VLAN ( NATIVE ): 203 | ||
|
||
Port is member in: | ||
|
||
Vlan Name Egress rule Port Membership Type | ||
---- -------------------------------- ----------- -------------------- | ||
203 203 Untagged Static | ||
222 VOIP-1 Tagged Static | ||
|
||
|
||
Forbidden VLANS: | ||
Vlan Name | ||
---- -------------------------------- | ||
|
||
|
||
Classification rules: | ||
|
||
Mac based VLANs: | ||
Group ID Vlan ID | ||
------------ ------- |
24 changes: 24 additions & 0 deletions
24
tests/cisco_s300/show_interfaces_switchport/cisco_s300_show_interfaces_switchport.yml
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,24 @@ | ||
--- | ||
parsed_sample: | ||
- acceptable_frame_type: "admitAll" | ||
egress_rule: | ||
- "Untagged" | ||
- "Tagged" | ||
forbidden_vlan: [] | ||
forbidden_vlan_name: [] | ||
gvrp_status: "disabled" | ||
ingress_filtering_status: "true" | ||
mac_based_vlan_group_id: [] | ||
mac_based_vlan_id: [] | ||
name: | ||
- "203" | ||
- "VOIP-1" | ||
native_vlan: "203" | ||
interface: "fa1" | ||
interface_membership_type: | ||
- "Static" | ||
- "Static" | ||
interface_mode: "Trunk" | ||
vlan: | ||
- "203" | ||
- "222" |