Skip to content

Commit

Permalink
add new mock data
Browse files Browse the repository at this point in the history
  • Loading branch information
vvas1lev committed Aug 12, 2024
1 parent d1f7e1e commit 5053858
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 7 deletions.
4 changes: 3 additions & 1 deletion napalm/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -3771,10 +3771,12 @@ def _get_vlan_all_ports(self, output, _vlan_id, _vlan_name):
vlans[vlan_id] = {"name": vlan_name, "interfaces": []}
if p_vlan_m:
was_vlan_or_cont = True
p_vlan_id = p_vlan_m.group(1)
vlan_id = p_vlan_m.group(2)
vlan_name = vlans.get(vlan_id)["name"]
interfaces = p_vlan_m.group(4) or ""
vlans[vlan_id] = {"name": vlan_name, "interfaces": []}
vlans[p_vlan_id] = {"name": vlan_name, "interfaces": []}

cont_m = None
if was_vlan_or_cont:
Expand All @@ -3797,7 +3799,7 @@ def _get_vlan_all_ports(self, output, _vlan_id, _vlan_name):
return vlans

def _get_vlan_from_id(self):
command = "show vlan brief"
command = "show vlan"
output = self._send_command(command)
vlan_regexp = r"^(\d+)\W+(.*?(?=active|act\/[isl]{1}shut|act\/unsup))"
find_vlan = re.findall(vlan_regexp, output, re.MULTILINE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@
"GigabitEthernet0/20"
]
},
"500": {
"name": "VLAN500",
"interfaces": [
"GigabitEthernet1/1",
"GigabitEthernet1/2",
"GigabitEthernet1/3"
]
},
"501": {
"name": "Vlan501",
"interfaces": [
"GigabitEthernet1/1",
"GigabitEthernet1/2"
]
},
"502": {
"name": "VLAN502",
"interfaces": [
"GigabitEthernet1/1",
"GigabitEthernet1/3"
]
},
"710": {
"name": "Vlan710",
"interfaces": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi0/17, Gi0/18, Gi0/19, Gi0/20
500 VLAN0500 active
501 Vlan0501 active
502 VLAN0502 active
710 Vlan710 active
736 Vlan736 active
748 Vlan748 active
Expand All @@ -12,3 +15,5 @@ VLAN Name Status Ports
1003 Vlan1003 act/unsup
1004 Vlan1004 act/unsup
1005 Vlan1005 act/unsup
500 501 community Gi1/1, Gi1/2
500 502 isolated Gi1/1, Gi1/3
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
500 VLAN0500 active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
500 enet 100500 1500 - - - - - 0 0

Remote SPAN VLAN
----------------
Disabled

Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
500 501 community Gi1/1, Gi1/2
500 502 isolated Gi1/1, Gi1/3
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
2432 Vlan2432 active
501 VLAN0501 active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
2432 enet 102432 1500 - - - - - 0 0
501 enet 100501 1500 - - - - - 0 0

Remote SPAN VLAN
----------------
Disabled

Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
2400 2432 isolated Gi0/1, Gi0/3
500 501 community Gi1/1, Gi1/2
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
2433 Vlan2433 active
502 VLAN0502 active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
2433 enet 102433 1500 - - - - - 0 0
502 enet 100502 1500 - - - - - 0 0

Remote SPAN VLAN
----------------
Disabled

Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
2400 2433 isolated Gi0/1, Gi0/3
500 502 isolated Gi1/1, Gi1/3

0 comments on commit 5053858

Please sign in to comment.