From 2fd4a1b6593d7d2e13aa2e6a5326cf119fe74047 Mon Sep 17 00:00:00 2001 From: ANISH-GOTTAPU <48308607+ANISH-GOTTAPU@users.noreply.github.com> Date: Tue, 2 Aug 2022 16:33:43 +0530 Subject: [PATCH 1/3] FlowControlUHD --- snappi_ixnetwork/vport.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/snappi_ixnetwork/vport.py b/snappi_ixnetwork/vport.py index 34c52b9a5..74e27cb81 100644 --- a/snappi_ixnetwork/vport.py +++ b/snappi_ixnetwork/vport.py @@ -128,6 +128,10 @@ def __init__(self, ixnetworkapi): self._interval = 1 self._timeout = 10 + @property + def isUhd(self): + return "UHD" in self._api._ixnetwork.Globals.ProductVersion + def config(self): """Transform config.ports into Ixnetwork.Vport 1) delete any vport that is not part of the config @@ -626,9 +630,16 @@ def _set_fcoe(self, vport, layer1, imports): vport["xpath"], vport["type"].replace("Fcoe", ""), ) - imports.append( - {"xpath": l1_xpath, "flowControlDirectedAddress": directed_address} - ) + if self.isUhd: + imports.append( + {"xpath": l1_xpath, "enabledFlowControl": True} + ) + else: + imports.append( + {"xpath": l1_xpath, + "flowControlDirectedAddress": directed_address, + "enabledFlowControl": True} + ) xpath = "%s/l1Config/%s/fcoe" % ( vport["xpath"], vport["type"].replace("Fcoe", ""), From 377a5d59d80d400b455e57cfc61d2d074e165b62 Mon Sep 17 00:00:00 2001 From: ANISH-GOTTAPU <48308607+ANISH-GOTTAPU@users.noreply.github.com> Date: Thu, 4 Aug 2022 22:21:58 +0530 Subject: [PATCH 2/3] update port location UHD --- snappi_ixnetwork/snappi_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/snappi_ixnetwork/snappi_api.py b/snappi_ixnetwork/snappi_api.py index 237ae59fc..7341b8c1b 100644 --- a/snappi_ixnetwork/snappi_api.py +++ b/snappi_ixnetwork/snappi_api.py @@ -690,9 +690,10 @@ def _validate_instance(self, config): if port.location is None: continue if ";" in port.location: - (_, card, port_info) = port.location.split(";") - port_info = "{}.{}".format(card, port_info) + # Ex: 10.36.70.66;localuhd;1 or 10.36.70.66;localuhd;17.1 + (_, _, port_info) = port.location.split(";") elif "/" in port.location: + # Ex: localuhd/1 (_, port_info) = port.location.split("/") else: raise SnappiIxnException(400, "port location is not valid") From 6503aa8594c1d82425a0ced16a28dcfb203fdad6 Mon Sep 17 00:00:00 2001 From: ANISH-GOTTAPU <48308607+ANISH-GOTTAPU@users.noreply.github.com> Date: Fri, 5 Aug 2022 10:34:54 +0530 Subject: [PATCH 3/3] update test --- tests/uhd/test_uhd_mock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/uhd/test_uhd_mock.py b/tests/uhd/test_uhd_mock.py index b4008e0c9..3e3a204b0 100644 --- a/tests/uhd/test_uhd_mock.py +++ b/tests/uhd/test_uhd_mock.py @@ -13,7 +13,7 @@ def test_uhd_port_locations(): api._traffic.State = "Stopped" config = snappi.Api().config() api._config = config - port = config.ports.port(location="a;b;c", name="p1").port( + port = config.ports.port(location="a;localuhd;b.c", name="p1").port( location="localuhd/a", name="p2" ) api._validate_instance(config)