Skip to content

Commit 356947d

Browse files
committed
fixup! Dell OS10 trunk port unit tests
Change-Id: I45d2ae063cd0033531ac64cff806cfdb3e489b8b
1 parent de0b7b3 commit 356947d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

networking_generic_switch/tests/unit/netmiko/test_dell.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,43 @@ def test__format_commands(self):
238238
'no switchport trunk allowed vlan 33',
239239
'exit'])
240240

241+
def test_get_trunk_port_cmds_no_vlan_translation(self):
242+
mock_context = mock.create_autospec(driver_context.PortContext)
243+
self.switch.ngs_config['vlan_translation_supported'] = True
244+
trunk_details = {'trunk_id': 'aaa-bbb-ccc-ddd',
245+
'sub_ports': [{'segmentation_id': 130,
246+
'port_id': 'aaa-bbb-ccc-ddd',
247+
'segmentation_type': 'vlan',
248+
'mac_address': u'fa:16:3e:1c:c2:7e'}]}
249+
mock_context.current = {'binding:profile':
250+
{'local_link_information':
251+
[
252+
{
253+
'switch_info': 'foo',
254+
'port_id': '2222'
255+
}
256+
]
257+
},
258+
'binding:vnic_type': 'baremetal',
259+
'id': 'aaaa-bbbb-cccc',
260+
'trunk_details': trunk_details}
261+
mock_context.network = mock.Mock()
262+
mock_context.network.current = {'provider:segmentation_id': 123}
263+
mock_context.segments_to_bind = [
264+
{
265+
'segmentation_id': 777,
266+
'id': 123
267+
}
268+
]
269+
res = self.switch.get_trunk_port_cmds_no_vlan_translation(
270+
'2222', 777, trunk_details)
271+
self.assertEqual(['interface 2222', 'switchport mode access',
272+
'switchport mode trunk',
273+
'switchport access vlan 777',
274+
'interface 2222',
275+
'switchport trunk allowed vlan 130'],
276+
res)
277+
241278

242279
class TestNetmikoDellPowerConnect(test_netmiko_base.NetmikoSwitchTestBase):
243280

0 commit comments

Comments
 (0)