# -*- coding: utf-8 -*-
##----------------------------------------------------------------------
## Cisco.IOS.get_spanning_tree test
## Auto-generated by manage.py debug-script at 2010-10-18 14:43:25
##----------------------------------------------------------------------
## 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(33)SXH2a'
    input={}
    result={'instances': [{'bridge_id': '00:19:07:DA:AC:01',
                'bridge_priority': 32768,
                'id': 1,
                'interfaces': [{'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24577,
                                'designated_port_id': '128.1154',
                                'edge': False,
                                'interface': 'Te 1/1',
                                'point_to_point': True,
                                'port_id': '128.1',
                                'priority': 128,
                                'role': 'root',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:19:07:DA:AC:01',
                                'designated_bridge_priority': 32768,
                                'designated_port_id': '128.783',
                                'edge': False,
                                'interface': 'Gi 7/15',
                                'point_to_point': True,
                                'port_id': '128.783',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:19:07:DA:AC:01',
                                'designated_bridge_priority': 32768,
                                'designated_port_id': '128.785',
                                'edge': True,
                                'interface': 'Gi 7/17',
                                'point_to_point': True,
                                'port_id': '128.785',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'}],
                'root_id': '00:14:1B:33:1C:C0',
                'root_priority': 24577,
                'vlans': '1'},
               {'bridge_id': '00:19:07:DA:AC:32',
                'bridge_priority': 32768,
                'id': 50,
                'interfaces': [{'designated_bridge_id': '00:14:1B:33:1C:C0',
                                'designated_bridge_priority': 24626,
                                'designated_port_id': '128.1154',
                                'edge': False,
                                'interface': 'Te 1/1',
                                'point_to_point': True,
                                'port_id': '128.1',
                                'priority': 128,
                                'role': 'root',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:19:07:DA:AC:32',
                                'designated_bridge_priority': 32768,
                                'designated_port_id': '128.129',
                                'edge': False,
                                'interface': 'Te 2/1',
                                'point_to_point': True,
                                'port_id': '128.129',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:19:07:DA:AC:32',
                                'designated_bridge_priority': 32768,
                                'designated_port_id': '128.783',
                                'edge': False,
                                'interface': 'Gi 7/15',
                                'point_to_point': True,
                                'port_id': '128.783',
                                'priority': 128,
                                'role': 'designated',
                                'state': 'forwarding'},
                               {'designated_bridge_id': '00:19:07:DA:AC:32',
                                'designated_bridge_priority': 32768,
                                'designated_port_id': '128.785',
                                'edge': True,
                                'interface': 'Gi 7/17',
                                'point_to_point': True,
                                'port_id': '128.785',
                                '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, address 0019.07da.ac01
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 24577, address 0014.1b33.1cc0
  Root port is 1 (TenGigabitEthernet1/1), cost of root path is 2
  Topology change flag not set, detected flag not set
  Number of topology changes 12 last change occurred 6w4d ago
          from GigabitEthernet7/15
  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 1 (TenGigabitEthernet1/1) of VLAN0001 is root forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1.
   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 1, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 12, received 6977771

 Port 783 (GigabitEthernet7/15) of VLAN0001 is designated forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.783.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 32768, address 0019.07da.ac01
   Designated port id is 128.783, 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 4026438, received 3

 Port 785 (GigabitEthernet7/17) of VLAN0001 is designated forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.785.
   Designated root has priority 24577, address 0014.1b33.1cc0
   Designated bridge has priority 32768, address 0019.07da.ac01
   Designated port id is 128.785, designated path cost 2
   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 13955548, received 0


 VLAN0050 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address 0019.07da.ac32
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 24626, address 0014.1b33.1cc0
  Root port is 1 (TenGigabitEthernet1/1), cost of root path is 2
  Topology change flag not set, detected flag not set
  Number of topology changes 51 last change occurred 1w5d ago
          from TenGigabitEthernet2/1
  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 1 (TenGigabitEthernet1/1) of VLAN0050 is root forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.1.
   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 1, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 51, received 6977811

 Port 129 (TenGigabitEthernet2/1) of VLAN0050 is designated forwarding 
   Port path cost 2, Port priority 128, Port Identifier 128.129.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 32768, address 0019.07da.ac32
   Designated port id is 128.129, 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 539582, received 0

 Port 783 (GigabitEthernet7/15) of VLAN0050 is designated forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.783.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 32768, address 0019.07da.ac32
   Designated port id is 128.783, 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 2013221, received 1

 Port 785 (GigabitEthernet7/17) of VLAN0050 is designated forwarding 
   Port path cost 4, Port priority 128, Port Identifier 128.785.
   Designated root has priority 24626, address 0014.1b33.1cc0
   Designated bridge has priority 32768, address 0019.07da.ac32
   Designated port id is 128.785, designated path cost 2
   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 6977817, 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        1 (TenGigabitEthernet1/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     0019.07da.ac01
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Te1/1               Root FWD 2         128.1    P2p 
Gi7/15              Desg FWD 4         128.783  P2p 
Gi7/17              Desg FWD 4         128.785  P2p Edge 


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

  Bridge ID  Priority    32768
             Address     0019.07da.ac32
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Te1/1               Root FWD 2         128.1    P2p 
Te2/1               Desg FWD 2         128.129  P2p 
Gi7/15              Desg FWD 4         128.783  P2p 
Gi7/17              Desg FWD 4         128.785  P2p Edge 
""",
'terminal length 0':  'terminal length 0\n',
}
    snmp_get={}
    snmp_getnext={}
