|
21 | 21 | from networking_generic_switch.tests.unit.netmiko import test_netmiko_base |
22 | 22 |
|
23 | 23 |
|
24 | | -class TestNetmikoDellOS10(test_netmiko_base.NetmikoSwitchTestBase): |
25 | | - |
26 | | - def _make_switch_device(self, extra_cfg={}): |
27 | | - device_cfg = {'device_type': 'netmiko_dell_os10'} |
28 | | - device_cfg.update(extra_cfg) |
29 | | - return dell.DellOS10(device_cfg) |
30 | | - |
31 | | - def test_get_trunk_port_cmds_no_vlan_translation(self): |
32 | | - mock_context = mock.create_autospec(driver_context.PortContext) |
33 | | - self.switch.ngs_config['vlan_translation_supported'] = True |
34 | | - trunk_details = {'trunk_id': 'aaa-bbb-ccc-ddd', |
35 | | - 'sub_ports': [{'segmentation_id': 130, |
36 | | - 'port_id': 'aaa-bbb-ccc-ddd', |
37 | | - 'segmentation_type': 'vlan', |
38 | | - 'mac_address': u'fa:16:3e:1c:c2:7e'}]} |
39 | | - mock_context.current = {'binding:profile': |
40 | | - {'local_link_information': |
41 | | - [ |
42 | | - { |
43 | | - 'switch_info': 'foo', |
44 | | - 'port_id': '2222' |
45 | | - } |
46 | | - ] |
47 | | - }, |
48 | | - 'binding:vnic_type': 'baremetal', |
49 | | - 'id': 'aaaa-bbbb-cccc', |
50 | | - 'trunk_details': trunk_details} |
51 | | - mock_context.network = mock.Mock() |
52 | | - mock_context.network.current = {'provider:segmentation_id': 123} |
53 | | - mock_context.segments_to_bind = [ |
54 | | - { |
55 | | - 'segmentation_id': 777, |
56 | | - 'id': 123 |
57 | | - } |
58 | | - ] |
59 | | - res = self.switch.get_trunk_port_cmds_no_vlan_translation( |
60 | | - '2222', 777, trunk_details) |
61 | | - self.assertEqual(['interface 2222', 'switchport mode access', |
62 | | - 'switchport mode trunk', |
63 | | - 'switchport access vlan 777', |
64 | | - 'interface 2222', |
65 | | - 'switchport trunk allowed vlan 130'], |
66 | | - res) |
67 | | - |
68 | | - |
69 | 24 | class TestNetmikoDellNos(test_netmiko_base.NetmikoSwitchTestBase): |
70 | 25 |
|
71 | 26 | def _make_switch_device(self, extra_cfg={}): |
|
0 commit comments