diff --git a/tests/test_create_meshed_flow.py b/tests/test_create_meshed_flow.py index e57fe260..bf1ac3d5 100644 --- a/tests/test_create_meshed_flow.py +++ b/tests/test_create_meshed_flow.py @@ -5,7 +5,7 @@ def test_create_meshed_flow(api): """Demonstrates a fully meshed configuration """ config = api.config() - + end_points = [] for i in range(1, 33): config.ports.port(name='Port %s' % i, location='localhost/%s' % i) device = config.devices.device(name='Device %s' % i)[-1] @@ -15,12 +15,13 @@ def test_create_meshed_flow(api): device.ethernets[-1].mac = '00:00:00:00:00:{:02x}'.format(i) device.ethernets[-1].ipv4_addresses.ipv4() device.ethernets[-1].ipv4_addresses[-1].name = 'Ipv4 %s' % i + end_points.append('Ipv4 %s' % i) device.ethernets[-1].ipv4_addresses[-1].gateway = '10.1.1.%s' % i device.ethernets[-1].ipv4_addresses[-1].address = '10.1.2.%s' % i flow = config.flows.flow(name='Fully Meshed Flow')[0] - flow.tx_rx.device.tx_names = [tx.name for tx in config.devices] - flow.tx_rx.device.rx_names = [rx.name for rx in config.devices] + flow.tx_rx.device.tx_names = [tx for tx in end_points] + flow.tx_rx.device.rx_names = [rx for rx in end_points] flow.tx_rx.device.mode = flow.tx_rx.device.MESH flow.size.fixed = 128 diff --git a/tests/test_defaults.py b/tests/test_defaults.py index 4413deb3..b47c2769 100644 --- a/tests/test_defaults.py +++ b/tests/test_defaults.py @@ -14,7 +14,7 @@ def test_defaults(api): 'fixed': 64 }, 'rate': { - 'choice': 'pps', # default choice is pps + 'choice': 'pps', # default choice is pps 'pps': "1000" }, 'packet': [ @@ -56,7 +56,7 @@ def test_defaults(api): { 'name': "abc", 'protocol': { - 'choice': 'lacp', # default choice is lacp + 'choice': 'lacp', # default choice is lacp 'lacp': { 'actor_key': 0, 'actor_system_id': '00:00:00:00:00:00', @@ -70,7 +70,7 @@ def test_defaults(api): 'actor_activity': 'active', 'actor_port_number': 0, 'actor_port_priority': 1, - 'lacpdu_periodic_time_interval': 0, + 'lacpdu_periodic_time_interval': 0, 'lacpdu_timeout': 0 }, 'ethernet': { @@ -86,8 +86,8 @@ def test_defaults(api): 'auto_negotiate': True, 'ieee_media_defaults': True, 'mtu': 1500, - 'name': "abc", - 'port_names': ["test"], + 'name': "def", + 'port_names': ["testport"], 'promiscuous': True, 'speed': 'speed_10_gbps', 'flow_control': { @@ -106,6 +106,17 @@ def test_defaults(api): } } } + ], + 'ports': [ + { + 'name': 'ptest' + }, + { + 'name': 'lagport' + }, + { + 'name': 'testport' + } ] } config = api.config() @@ -192,14 +203,25 @@ def test_defaults_by_deserialize(api): 'auto_negotiate': True, 'ieee_media_defaults': True, 'mtu': 1500, - 'name': "abc", - 'port_names': ["test"], + 'name': "def", + 'port_names': ["testport"], 'promiscuous': True, 'speed': 'speed_10_gbps', 'flow_control': { 'directed_address': '01:80:C2:00:00:01' } } + ], + 'ports': [ + { + 'name': 'ptest' + }, + { + 'name': 'lagport' + }, + { + 'name': 'testport' + } ] } config = api.config()