# -*- coding: utf-8 -*-
##----------------------------------------------------------------------
## Cisco.IOS.get_spanning_tree test
## Auto-generated by manage.py debug-script at 2010-10-18 14:46:10
##----------------------------------------------------------------------
## 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='C3750'
    version='12.2(35)SE1'
    input={}
    result={'instances': [{'bridge_id': '00:19:E8:85:F6:00',
                'bridge_priority': 32768,
                'id': 1,
                'interfaces': [{'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1153',
                                'edge': False,
                                'interface': 'Te 3/0/1',
                                'point_to_point': True,
                                'port_id': '128.125',
                                'priority': 128,
                                'role': 'root',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:19:E8:85:F6:00',
                                'designated_bridge_priority': 32769,
                                'designated_port_id': '128.272',
                                'edge': False,
                                'interface': 'Gi 6/0/2',
                                'point_to_point': True,
                                'port_id': '128.272',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'}],
                'root_id': '00:14:1B:33:1C:C0',
                'root_priority': 24577,
                'vlans': '1'},
               {'bridge_id': '00:19:E8:85:F6:00',
                'bridge_priority': 32768,
                'id': 50,
                'interfaces': [{'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1153',
                                'edge': False,
                                'interface': 'Te 3/0/1',
                                'point_to_point': True,
                                'port_id': '128.125',
                                'priority': 128,
                                'role': 'root',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:19:E8:85:F6:00',
                                'designated_bridge_priority': 32818,
                                'designated_port_id': '128.272',
                                'edge': False,
                                'interface': 'Gi 6/0/2',
                                'point_to_point': True,
                                'port_id': '128.272',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'}],
                'root_id': '00:14:1B:33:1C:C0',
                'root_priority': 24626,
                '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 32768, sysid 1, address 0019.e885.f600
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 24577, address 0014.1b33.1cc0
  Root port is 125 (TenGigabitEthernet3/0/1), cost of root path is 2
  Topology change flag not set, detected flag not set
  Number of topology changes 2 last change occurred 2y4w ago
  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 125 (TenGigabitEthernet3/0/1) of VLAN0001 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.125.
   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 1, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 7, received 32959379

 Port 272 (GigabitEthernet6/0/2) of VLAN0001 is forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.272.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 32769, address 0019.e885.f600
   Designated port id is 128.272, designated path cost 2
   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 41707879, received 0


 VLAN0050 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, sysid 50, address 0019.e885.f600
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 24626, address 0014.1b33.1cc0
  Root port is 125 (TenGigabitEthernet3/0/1), cost of root path is 2
  Topology change flag not set, detected flag not set
  Number of topology changes 2 last change occurred 2y4w ago
  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 125 (TenGigabitEthernet3/0/1) of VLAN0050 is forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.125.
   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 1, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 7, received 32959378

 Port 272 (GigabitEthernet6/0/2) of VLAN0050 is forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.272.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 32818, address 0019.e885.f600
   Designated port id is 128.272, designated path cost 2
   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 20853941, received 0
""",
## 'show spanning-tree'
'show spanning-tree': """show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     0014.1b33.1cc0
             Cost        2
             Port        125 (TenGigabitEthernet3/0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0019.e885.f600
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------

Te3/0/1          Root FWD 2         128.125  P2p 
Gi6/0/2          Desg FWD 4         128.272  P2p 


VLAN0050
  Spanning tree enabled protocol ieee
  Root ID    Priority    24626
             Address     0014.1b33.1cc0
             Cost        2
             Port        125 (TenGigabitEthernet3/0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32818  (priority 32768 sys-id-ext 50)
             Address     0019.e885.f600
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------

Te3/0/1          Root FWD 2         128.125  P2p 
Gi6/0/2          Desg FWD 4         128.272  P2p 
""",
'terminal length 0':  'terminal length 0\n',
}
    snmp_get={}
    snmp_getnext={}
