From 16ebaa207984fc9ec0dcc3fb12420a6e9a0f28ed Mon Sep 17 00:00:00 2001 From: Ashutosh Kumar Date: Fri, 26 Mar 2021 12:46:46 +0530 Subject: [PATCH] device mapping changes --- VERSION | 2 +- snappi/snappigenerator.py | 2 +- snappi/tests/test_choice.py | 5 +++-- snappi/tests/test_create_meshed_flow.py | 6 ++++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 0f826853..66784322 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.7 +0.3.8 diff --git a/snappi/snappigenerator.py b/snappi/snappigenerator.py index 6ffcdd9b..50693cbe 100644 --- a/snappi/snappigenerator.py +++ b/snappi/snappigenerator.py @@ -22,7 +22,7 @@ import requests from jsonpath_ng import parse -MODELS_RELEASE = 'v0.3.1' +MODELS_RELEASE = 'v0.3.2' class SnappiGenerator(object): diff --git a/snappi/tests/test_choice.py b/snappi/tests/test_choice.py index 26c67ab7..f5a59a5b 100644 --- a/snappi/tests/test_choice.py +++ b/snappi/tests/test_choice.py @@ -13,8 +13,9 @@ def test_choice(api): config = api.config() config.devices.device(name='d1').device(name='d2') flow = config.flows.flow(name='f')[-1] - flow.tx_rx.device.tx_names = [config.devices[0].name] - flow.tx_rx.device.rx_names = [config.devices[1].name] + flow.tx_rx.device.maps.map( + tx_name=config.devices[0].name, rx_name=config.devices[1].name + ) flow.packet.ethernet().vlan().vlan().ipv4() assert (flow.packet[0].parent.choice == 'ethernet') assert (flow.packet[1].parent.choice == 'vlan') diff --git a/snappi/tests/test_create_meshed_flow.py b/snappi/tests/test_create_meshed_flow.py index 0f3ca739..dfa6b6a8 100644 --- a/snappi/tests/test_create_meshed_flow.py +++ b/snappi/tests/test_create_meshed_flow.py @@ -13,8 +13,10 @@ def test_create_meshed_flow(api): device.ethernet.ipv4.name = 'Ipv4 %s' % i flow = config.flows.flow(name='Fully Meshed Flow')[0] - flow.tx_rx.device.tx_names = [device.name for device in config.devices] - flow.tx_rx.device.rx_names = [device.name for device in config.devices] + for tx in config.devices: + for rx in config.devices: + if tx.name != rx.name: + flow.tx_rx.device.maps.map(tx_name=tx.name, rx_name=rx.name) flow.size.fixed = 128 flow.rate.pps = 1000 flow.duration.fixed_packets.packets = 10000