From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B76E242A52; Wed, 3 May 2023 20:02:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 567C541144; Wed, 3 May 2023 20:02:50 +0200 (CEST) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 679F9410F9 for ; Wed, 3 May 2023 20:02:49 +0200 (CEST) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1ab1ce53ca6so7878205ad.0 for ; Wed, 03 May 2023 11:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1683136968; x=1685728968; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WKNCI3+sa4bcqdFxQyo8OVbvjRNPgdjlYLoLjkZ/Wx0=; b=KPszAPXAY3xGrOiHvKkDS/D7oJ31FMjSPgzIbJafjCbnq3pzV0nhe/q498i3GD3ekO ddjEp6zUrV3IGA9Rgs+vU5rRBg8NTgC2cRRYGBKXudwjK521cmZNuC1uOA30vaPj8aY0 tkqWucXejxP4nOIk5aY/1V8GfQBBp73C904BI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683136968; x=1685728968; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WKNCI3+sa4bcqdFxQyo8OVbvjRNPgdjlYLoLjkZ/Wx0=; b=dR3Yip+o+bjNrzzMeJRw/1ugx+5HaqKEkh04kKFGoR6qRj73P8D07LzXl1+VwmqbA3 i41+Da+zxhC+zimn99LR733k8+3YDoDulvxNVQyMmcW83KA3euGYsHcljIQxdqWvGFaJ ZAyFi49/wYs5S4iyR/Q7580oyKmFpi/1c5n58UaqBAfJ2eXxWjqDqq96DOukBQ6Dnc7T mugFChDKReYqyFix7iWz5/W2b6XtaNniQG4a+ZhkSu7RAkSL2vqgWc2XBeiN3l9F3obG 30AOXuOp4niAyg2Y8u+ZycwEqQHkOX1gYw8J+YX3M2T6tO2om2yuoYNnYm3wuahu3sSn Of8g== X-Gm-Message-State: AC+VfDxywX9E3cyiaRlp3rO5btTHHFeyqG/m3Sppip3IqAwhfmXc2PWl 6L36+6mMb5+tZDuKSgHgtJYjUonejLDswdyPftLrBQ== X-Google-Smtp-Source: ACHHUZ5sMDg5hMJkjA2lbraLu8l2jShQk4iYUQcfX9DyI51ysUhm1XEtVMISV4qolsEtNs0AnJu+tTjn3VgxrPcvhHY= X-Received: by 2002:a17:902:e5cb:b0:1a6:5fa2:aa50 with SMTP id u11-20020a170902e5cb00b001a65fa2aa50mr1133105plf.1.1683136968507; Wed, 03 May 2023 11:02:48 -0700 (PDT) MIME-Version: 1.0 References: <20230420093109.594704-1-juraj.linkes@pantheon.tech> <20230420093109.594704-6-juraj.linkes@pantheon.tech> In-Reply-To: <20230420093109.594704-6-juraj.linkes@pantheon.tech> From: Jeremy Spewock Date: Wed, 3 May 2023 14:02:37 -0400 Message-ID: Subject: Re: [RFC PATCH v1 5/5] dts: add traffic generator node to dts runner To: =?UTF-8?Q?Juraj_Linke=C5=A1?= Cc: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, lijuan.tu@intel.com, wathsala.vithanage@arm.com, probb@iol.unh.edu, dev@dpdk.org Content-Type: multipart/alternative; boundary="0000000000001ddc5605facddd90" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --0000000000001ddc5605facddd90 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Acked-by: Jeremy Spewock On Thu, Apr 20, 2023 at 5:51=E2=80=AFAM Juraj Linke=C5=A1 wrote: > Initialize the TG node and do basic verification. > > Signed-off-by: Juraj Linke=C5=A1 > --- > dts/framework/dts.py | 42 ++++++++++++++++--------- > dts/framework/testbed_model/__init__.py | 1 + > 2 files changed, 28 insertions(+), 15 deletions(-) > > diff --git a/dts/framework/dts.py b/dts/framework/dts.py > index 0502284580..9c82bfe1f4 100644 > --- a/dts/framework/dts.py > +++ b/dts/framework/dts.py > @@ -9,7 +9,7 @@ > from .logger import DTSLOG, getLogger > from .test_result import BuildTargetResult, DTSResult, ExecutionResult, > Result > from .test_suite import get_test_suites > -from .testbed_model import SutNode > +from .testbed_model import SutNode, TGNode, Node > from .utils import check_dts_python_version > > dts_logger: DTSLOG =3D getLogger("DTSRunner") > @@ -27,28 +27,40 @@ def run_all() -> None: > # check the python version of the server that run dts > check_dts_python_version() > > - nodes: dict[str, SutNode] =3D {} > + nodes: dict[str, Node] =3D {} > try: > # for all Execution sections > for execution in CONFIGURATION.executions: > sut_node =3D None > + tg_node =3D None > if execution.system_under_test.name in nodes: > # a Node with the same name already exists > sut_node =3D nodes[execution.system_under_test.name] > - else: > - # the SUT has not been initialized yet > - try: > + > + if execution.traffic_generator_system.name in nodes: > + # a Node with the same name already exists > + tg_node =3D nodes[execution.traffic_generator_system.nam= e] > + > + try: > + if not sut_node: > sut_node =3D SutNode(execution.system_under_test) > - result.update_setup(Result.PASS) > - except Exception as e: > - dts_logger.exception( > - f"Connection to node > {execution.system_under_test} failed." > - ) > - result.update_setup(Result.FAIL, e) > - else: > - nodes[sut_node.name] =3D sut_node > - > - if sut_node: > + if not tg_node: > + tg_node =3D TGNode(execution.traffic_generator_syste= m) > + tg_node.verify() > + result.update_setup(Result.PASS) > + except Exception as e: > + failed_node =3D execution.system_under_test.name > + if sut_node: > + failed_node =3D execution.traffic_generator_system.n= ame > + dts_logger.exception( > + f"Creation of node {failed_node} failed." > + ) > + result.update_setup(Result.FAIL, e) > + else: > + nodes[sut_node.name] =3D sut_node > + nodes[tg_node.name] =3D tg_node > + > + if sut_node and tg_node: > _run_execution(sut_node, execution, result) > > except Exception as e: > diff --git a/dts/framework/testbed_model/__init__.py > b/dts/framework/testbed_model/__init__.py > index f54a947051..5cbb859e47 100644 > --- a/dts/framework/testbed_model/__init__.py > +++ b/dts/framework/testbed_model/__init__.py > @@ -20,3 +20,4 @@ > ) > from .node import Node > from .sut_node import SutNode > +from .tg_node import TGNode > -- > 2.30.2 > > --0000000000001ddc5605facddd90 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Acked-by: Jeremy Spewock <jspewock@iol.unh.edu>

On Thu, Apr 20, 2023 at 5:51=E2=80= =AFAM Juraj Linke=C5=A1 <juraj.linkes@pantheon.tech> wrote:
=
Initialize the TG node an= d do basic verification.

Signed-off-by: Juraj Linke=C5=A1 <juraj.linkes@pantheon.tech>
---
=C2=A0dts/framework/dts.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 | 42 ++++++++++++++++---------
=C2=A0dts/framework/testbed_model/__init__.py |=C2=A0 1 +
=C2=A02 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/dts/framework/dts.py b/dts/framework/dts.py
index 0502284580..9c82bfe1f4 100644
--- a/dts/framework/dts.py
+++ b/dts/framework/dts.py
@@ -9,7 +9,7 @@
=C2=A0from .logger import DTSLOG, getLogger
=C2=A0from .test_result import BuildTargetResult, DTSResult, ExecutionResul= t, Result
=C2=A0from .test_suite import get_test_suites
-from .testbed_model import SutNode
+from .testbed_model import SutNode, TGNode, Node
=C2=A0from .utils import check_dts_python_version

=C2=A0dts_logger: DTSLOG =3D getLogger("DTSRunner")
@@ -27,28 +27,40 @@ def run_all() -> None:
=C2=A0 =C2=A0 =C2=A0# check the python version of the server that run dts =C2=A0 =C2=A0 =C2=A0check_dts_python_version()

-=C2=A0 =C2=A0 nodes: dict[str, SutNode] =3D {}
+=C2=A0 =C2=A0 nodes: dict[str, Node] =3D {}
=C2=A0 =C2=A0 =C2=A0try:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# for all Execution sections
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for execution in CONFIGURATION.executions= :
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sut_node =3D None
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tg_node =3D None
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if execution.= system_under_test.name in nodes:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# a Node with= the same name already exists
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sut_node =3D = nodes[execution.system_under_test.name]
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # the SUT has not = been initialized yet
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 try:
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if executio= n.traffic_generator_system.name in nodes:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # a Node with the = same name already exists
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tg_node =3D nodes[= execution.traffic_generator_system.name]
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 try:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not sut_node: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0sut_node =3D SutNode(execution.system_under_test)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 resu= lt.update_setup(Result.PASS)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 except Exception a= s e:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dts_= logger.exception(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 f"Connection to node {execution.system_under_test} failed.&= quot;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ) -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 resu= lt.update_setup(Result.FAIL, e)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 node= s[sut= _node.name] =3D sut_node
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if sut_node:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not tg_node: +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tg_n= ode =3D TGNode(execution.traffic_generator_system)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tg_n= ode.verify()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result.update_setu= p(Result.PASS)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 except Exception as e:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 failed_node =3D execution.system_under_test.name
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if sut_node:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fail= ed_node =3D execution.traffic_generator_system.name
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dts_logger.excepti= on(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f&qu= ot;Creation of node {failed_node} failed."
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result.update_setu= p(Result.FAIL, e)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nodes[
sut_node.name= ] =3D sut_node
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nodes[tg_node.name] = =3D tg_node
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if sut_node and tg_node:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_run_executio= n(sut_node, execution, result)

=C2=A0 =C2=A0 =C2=A0except Exception as e:
diff --git a/dts/framework/testbed_model/__init__.py b/dts/framework/testbe= d_model/__init__.py
index f54a947051..5cbb859e47 100644
--- a/dts/framework/testbed_model/__init__.py
+++ b/dts/framework/testbed_model/__init__.py
@@ -20,3 +20,4 @@
=C2=A0)
=C2=A0from .node import Node
=C2=A0from .sut_node import SutNode
+from .tg_node import TGNode
--
2.30.2

--0000000000001ddc5605facddd90--