# -*- coding: utf-8 -*-
##----------------------------------------------------------------------
## Cisco.IOS.get_spanning_tree test
## Auto-generated by manage.py debug-script at 2010-10-18 14:48:21
##----------------------------------------------------------------------
## Copyright (C) 2007-2010 The NOC Project
## See LICENSE for details
##----------------------------------------------------------------------
from noc.lib.test import ScriptTestCase
class Cisco_IOS_get_spanning_tree_Test(ScriptTestCase):
    script="Cisco.IOS.get_spanning_tree"
    vendor="Cisco"
    platform='s72033_rp'
    version='12.2(18)SXF14'
    input={}
    result={'instances': [{'bridge_id': '00:14:1B:33:1C:C0',
                'bridge_priority': 24576,
                'id': 1,
                'interfaces': [{'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1025',
                                'edge': False,
                                'interface': 'Te 9/1',
                                'point_to_point': True,
                                'port_id': '128.1025',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1026',
                                'edge': False,
                                'interface': 'Te 9/2',
                                'point_to_point': True,
                                'port_id': '128.1026',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1153',
                                'edge': False,
                                'interface': 'Te 10/1',
                                'point_to_point': True,
                                'port_id': '128.1153',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1154',
                                'edge': False,
                                'interface': 'Te 10/2',
                                'point_to_point': True,
                                'port_id': '128.1154',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1155',
                                'edge': False,
                                'interface': 'Te 10/3',
                                'point_to_point': True,
                                'port_id': '128.1155',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1156',
                                'edge': False,
                                'interface': 'Te 10/4',
                                'point_to_point': True,
                                'port_id': '128.1156',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1285',
                                'edge': False,
                                'interface': 'Gi 11/5',
                                'point_to_point': True,
                                'port_id': '128.1285',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1292',
                                'edge': False,
                                'interface': 'Gi 11/12',
                                'point_to_point': True,
                                'port_id': '128.1292',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1667',
                                'edge': True,
                                'interface': 'Po 257',
                                'point_to_point': True,
                                'port_id': '128.1667',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'}],
                'root_id': '00:14:1B:33:1C:C0',
                'root_priority': 24576,
                'vlans': '1'},
               {'bridge_id': '00:14:1B:33:1C:C0',
                'bridge_priority': 24576,
                'id': 50,
                'interfaces': [{'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1025',
                                'edge': False,
                                'interface': 'Te 9/1',
                                'point_to_point': True,
                                'port_id': '128.1025',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1026',
                                'edge': False,
                                'interface': 'Te 9/2',
                                'point_to_point': True,
                                'port_id': '128.1026',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1153',
                                'edge': False,
                                'interface': 'Te 10/1',
                                'point_to_point': True,
                                'port_id': '128.1153',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1154',
                                'edge': False,
                                'interface': 'Te 10/2',
                                'point_to_point': True,
                                'port_id': '128.1154',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1155',
                                'edge': False,
                                'interface': 'Te 10/3',
                                'point_to_point': True,
                                'port_id': '128.1155',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1156',
                                'edge': False,
                                'interface': 'Te 10/4',
                                'point_to_point': True,
                                'port_id': '128.1156',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1285',
                                'edge': False,
                                'interface': 'Gi 11/5',
                                'point_to_point': True,
                                'port_id': '128.1285',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1292',
                                'edge': False,
                                'interface': 'Gi 11/12',
                                'point_to_point': True,
                                'port_id': '128.1292',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'}],
                'root_id': '00:14:1B:33:1C:C0',
                'root_priority': 24576,
                'vlans': '50'}],
 'mode': 'PVST+'}
    motd=' \n\n'
    cli={
## 'show spanning-tree detail'
'show spanning-tree detail': """show spanning-tree detail

 VLAN0001 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 24576, sysid 1, address 0014.1b33.1cc0
  Configured hello time 2, max age 20, forward delay 15
  We are the root of the spanning tree
  Topology change flag not set, detected flag not set
  Number of topology changes 185 last change occurred 2d17h ago
          from TenGigabitEthernet9/2
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15 
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 1025 (TenGigabitEthernet9/1) of VLAN0001 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1025.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 24577, address 0014.1b33.1cc0
   Designated port id is 128.1025, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959531, received 94

 Port 1026 (TenGigabitEthernet9/2) of VLAN0001 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1026.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 24577, address 0014.1b33.1cc0
   Designated port id is 128.1026, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 7376999, received 16

 Port 1153 (TenGigabitEthernet10/1) of VLAN0001 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1153.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 24577, address 0014.1b33.1cc0
   Designated port id is 128.1153, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959453, received 7

 Port 1154 (TenGigabitEthernet10/2) of VLAN0001 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1154.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 24577, address 0014.1b33.1cc0
   Designated port id is 128.1154, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 6977918, received 12

 Port 1155 (TenGigabitEthernet10/3) of VLAN0001 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1155.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 24577, address 0014.1b33.1cc0
   Designated port id is 128.1155, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959521, received 77

 Port 1156 (TenGigabitEthernet10/4) of VLAN0001 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1156.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 24577, address 0014.1b33.1cc0
   Designated port id is 128.1156, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959447, received 2

 Port 1285 (GigabitEthernet11/5) of VLAN0001 is forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.1285.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 24577, address 0014.1b33.1cc0
   Designated port id is 128.1285, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959454, received 6

 Port 1292 (GigabitEthernet11/12) of VLAN0001 is forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.1292.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 24577, address 0014.1b33.1cc0
   Designated port id is 128.1292, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959478, received 36

 Port 1667 (Port-channel257) of VLAN0001 is forwarding 
   Port path cost 3, Port priority 128, Port Identifier 128.1667.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 24577, address 0014.1b33.1cc0
   Designated port id is 128.1667, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   The port is in the portfast mode by portfast trunk configuration
   Link type is point-to-point by default
   BPDU: sent 30628339, received 0


 VLAN0050 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 24576, sysid 50, address 0014.1b33.1cc0
  Configured hello time 2, max age 20, forward delay 15
  We are the root of the spanning tree
  Topology change flag not set, detected flag not set
  Number of topology changes 247 last change occurred 2d17h ago
          from TenGigabitEthernet9/2
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15 
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 1025 (TenGigabitEthernet9/1) of VLAN0050 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1025.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 24626, address 0014.1b33.1cc0
   Designated port id is 128.1025, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959475, received 23

 Port 1026 (TenGigabitEthernet9/2) of VLAN0050 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1026.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 24626, address 0014.1b33.1cc0
   Designated port id is 128.1026, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 7376994, received 10

 Port 1153 (TenGigabitEthernet10/1) of VLAN0050 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1153.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 24626, address 0014.1b33.1cc0
   Designated port id is 128.1153, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959453, received 7

 Port 1154 (TenGigabitEthernet10/2) of VLAN0050 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1154.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 24626, address 0014.1b33.1cc0
   Designated port id is 128.1154, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 6977958, received 51

 Port 1155 (TenGigabitEthernet10/3) of VLAN0050 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1155.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 24626, address 0014.1b33.1cc0
   Designated port id is 128.1155, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959447, received 3

 Port 1156 (TenGigabitEthernet10/4) of VLAN0050 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1156.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 24626, address 0014.1b33.1cc0
   Designated port id is 128.1156, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959447, received 2

 Port 1285 (GigabitEthernet11/5) of VLAN0050 is forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.1285.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 24626, address 0014.1b33.1cc0
   Designated port id is 128.1285, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959454, received 6

 Port 1292 (GigabitEthernet11/12) of VLAN0050 is forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.1292.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 24626, address 0014.1b33.1cc0
   Designated port id is 128.1292, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 32959453, received 5
""",
## 'show spanning-tree'
'show spanning-tree': """show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     0014.1b33.1cc0
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24577  (priority 24576 sys-id-ext 1)
             Address     0014.1b33.1cc0
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Te9/1            Desg FWD 2         128.1025 P2p 
Te9/2            Desg FWD 2         128.1026 P2p 
Te10/1           Desg FWD 2         128.1153 P2p 
Te10/2           Desg FWD 2         128.1154 P2p 
Te10/3           Desg FWD 2         128.1155 P2p 
Te10/4           Desg FWD 2         128.1156 P2p 
Gi11/5           Desg FWD 4         128.1285 P2p 
Gi11/12          Desg FWD 4         128.1292 P2p 
Po257            Desg FWD 3         128.1667 Edge P2p 


VLAN0050
  Spanning tree enabled protocol ieee
  Root ID    Priority    24626
             Address     0014.1b33.1cc0
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24626  (priority 24576 sys-id-ext 50)
             Address     0014.1b33.1cc0
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Te9/1            Desg FWD 2         128.1025 P2p 
Te9/2            Desg FWD 2         128.1026 P2p 
Te10/1           Desg FWD 2         128.1153 P2p 
Te10/2           Desg FWD 2         128.1154 P2p 
Te10/3           Desg FWD 2         128.1155 P2p 
Te10/4           Desg FWD 2         128.1156 P2p 
Gi11/5           Desg FWD 4         128.1285 P2p 
Gi11/12          Desg FWD 4         128.1292 P2p 
""",
'terminal length 0':  'terminal length 0\n',
}
    snmp_get={}
    snmp_getnext={}
