Пример #1
0
 def test_ssh_juniper_not_stacked(self):
     ssh = MockSSH([
         (
             "show virtual-chassis",
             JUNIPER_NOT_STACKED_SAMPLE,
         ),
         (
             "show version",
             JUNIPER_SHOW_VERSION_SAMPLE,
         ),
         (
             "show version",
             JUNIPER_SHOW_VERSION_SAMPLE,
         ),
         (
             "show chassis mac-addresses",
             JUNIPER_GET_MAC_ADDRESSES_SAMPLE,
         ),
     ])
     self.assertEqual(
         _ssh_juniper(ssh, '10.10.10.10'), {
             'hostname': 'rack01-sw1.dc',
             'mac_addresses': ['AABBCCDD0001'],
             'management_ip_addresses': ['10.10.10.10'],
             'model_name': 'ex4500-40f',
             'serial_number': 'GX1122334403',
             'type': 'switch',
         })
Пример #2
0
 def test_ssh_juniper_not_stacked(self):
     ssh = MockSSH([
         (
             "show virtual-chassis",
             JUNIPER_NOT_STACKED_SAMPLE,
         ),
         (
             "show version",
             JUNIPER_SHOW_VERSION_SAMPLE,
         ),
         (
             "show chassis mac-addresses",
             JUNIPER_GET_MAC_ADDRESSES_SAMPLE,
         ),
     ])
     self.assertEqual(
         _ssh_juniper(ssh, '10.10.10.10'),
         {
             'hostname': 'rack01-sw1.dc',
             'mac_addresses': ['aa:bb:cc:dd:00:01'],
             'management_ip_addresses': ['10.10.10.10'],
             'model_name': 'ex4500-40f',
             'serial_number': 'GX1122334403',
             'type': 'switch',
         }
     )
Пример #3
0
 def test_ssh_juniper_stacked(self):
     ssh = MockSSH([
         (
             "show virtual-chassis",
             JUNIPER_STACKED_SAMPLE,
         ),
         (
             "show version",
             JUNIPER_SHOW_VERSION_SAMPLE,
         ),
         (
             "show version",
             JUNIPER_SHOW_VERSION_SAMPLE,
         ),
         (
             "show chassis mac-addresses",
             JUNIPER_GET_MAC_ADDRESSES_SAMPLE,
         ),
     ])
     self.assertEqual(
         _ssh_juniper(ssh, '10.10.10.10'),
         {
             'hostname':
             'rack01-sw1.dc',
             'management_ip_addresses': ['10.10.10.10'],
             'model_name':
             'Juniper EX Virtual Chassis Ethernet Switch',
             'serial_number':
             'aaaa.bbbb.cccc',
             'subdevices': [
                 {
                     'hostname': 'rack01-sw1-0.dc',
                     'mac_addresses': ['AABBCCDD0001'],
                     'model_name': 'ex4500-40f',
                     'serial_number': 'GX1122334401',
                     'type': 'switch',
                 },
                 {
                     'hostname': 'rack01-sw1-1.dc',
                     'mac_addresses': ['AABBCCDD0002'],
                     'model_name': 'ex4500-40f',
                     'serial_number': 'GX1122334402',
                     'type': 'switch',
                 },
             ],
             'type':
             'switch stack',
         },
     )
Пример #4
0
 def test_ssh_juniper_stacked(self):
     ssh = MockSSH([
         (
             "show virtual-chassis",
             JUNIPER_STACKED_SAMPLE,
         ),
         (
             "show version",
             JUNIPER_SHOW_VERSION_SAMPLE,
         ),
         (
             "show version",
             JUNIPER_SHOW_VERSION_SAMPLE,
         ),
         (
             "show chassis mac-addresses",
             JUNIPER_GET_MAC_ADDRESSES_SAMPLE,
         ),
     ])
     self.assertEqual(
         _ssh_juniper(ssh, '10.10.10.10'),
         {
             'hostname': 'rack01-sw1.dc',
             'management_ip_addresses': ['10.10.10.10'],
             'model_name': 'Juniper EX Virtual Chassis Ethernet Switch',
             'serial_number': 'aaaa.bbbb.cccc',
             'subdevices': [
                 {
                     'hostname': 'rack01-sw1-0.dc',
                     'mac_addresses': ['AABBCCDD0001'],
                     'model_name': 'ex4500-40f',
                     'serial_number': 'GX1122334401',
                     'type': 'switch',
                 },
                 {
                     'hostname': 'rack01-sw1-1.dc',
                     'mac_addresses': ['AABBCCDD0002'],
                     'model_name': 'ex4500-40f',
                     'serial_number': 'GX1122334402',
                     'type': 'switch',
                 },
             ],
             'type': 'switch stack',
         },
     )