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 19FA445602; Thu, 11 Jul 2024 21:33:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03CC0402CE; Thu, 11 Jul 2024 21:33:51 +0200 (CEST) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 1727D402CC for ; Thu, 11 Jul 2024 21:33:50 +0200 (CEST) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2c98a97d1ccso1743680a91.0 for ; Thu, 11 Jul 2024 12:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1720726429; x=1721331229; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DqhhcuO6UrRx9ZzldPxmO2/l+KxZUUeZ9vT332hE3do=; b=A/kIMz8wQpPYrv2kV/ha5a4+nXj2BVOPIZuM/QykOIiJQqKeAw/sYnIEDlLasxs5mM 4K9CJddtVltR+iqxH7ZoQSQ92kAw4XYqDdv4CBfG3hUFKhetUtT1KpcR3hq1p4yOCv03 k8FV76gxjwGPpUwgSmylv9dm7MLEV3tFu2vKk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720726429; x=1721331229; h=content-transfer-encoding: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=DqhhcuO6UrRx9ZzldPxmO2/l+KxZUUeZ9vT332hE3do=; b=K+61bzTy/gmvKh/h20J5YDj6hpA8Ug9+Il5CyQTZ8ZXum07Zwe+VEOn8dv4dnR/g4L 20+G1XUv2ZvEXWNF7iAQl1vsY5BydmmiF1852mPWeScJuTkftVMSyJk3+vvWsTbb/9HH zpAxEbUlGuvmgEi3l2lUZmqqPasBGmp8b2L0+ZLGXNZCojkSReetSkW7ZcdeWXzaX3Md daBL6EGhHkmkf8ZF/LdlfiaGKxwjRxHNNuD9EdI5y40m49ec7B40bu8LGRoVDfswft66 UkcTQtaVSyXklXr6OmGNMajE3+3ro6E0cZy43rFS8WJlVepopxQW7x51gejPjvrV7TBJ /QEA== X-Forwarded-Encrypted: i=1; AJvYcCWIOUn1MbMM69slAwpw1mu+J99RhtSRzG2buGu5R5/L+VqSezT3VVdGXxo8jkYWuqxNnG+bOMaFaVON5po= X-Gm-Message-State: AOJu0YxsQ/YG3B9gtODXRaqnUZ+fQog6ciwyVW8KI4V4BPBiJPlWH0u3 RHng+o6pS7FDzLPmeaCozWmmZ8UFsUkYikFTI9anj0w5wHEN2MrsxU1mGwn6E2Scgl0Nse5kkS1 jmIAKunmxi/ysWmfitz9C8uCOKm7yoFbN7idwQg== X-Google-Smtp-Source: AGHT+IHy+f14ppQkAFw4o4TKGSfRecKpbgsWtPP2kfuSVuNvKYE7zvIxCI90ReLgNHNXPbT9g+0gghuFaGZYm3ZqE1w= X-Received: by 2002:a17:90a:9ef:b0:2c8:4250:66a7 with SMTP id 98e67ed59e1d1-2cac6de07f9mr798081a91.1.1720726429045; Thu, 11 Jul 2024 12:33:49 -0700 (PDT) MIME-Version: 1.0 References: <20240702192422.2480-2-npratte@iol.unh.edu> <20240702192422.2480-4-npratte@iol.unh.edu> In-Reply-To: <20240702192422.2480-4-npratte@iol.unh.edu> From: Jeremy Spewock Date: Thu, 11 Jul 2024 15:33:38 -0400 Message-ID: Subject: Re: [PATCH v2 2/3] dts: add testpmd methods for test suite To: Nicholas Pratte Cc: Honnappa.Nagarahalli@arm.com, probb@iol.unh.edu, juraj.linkes@pantheon.tech, paul.szczepanek@arm.com, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, dmarx@iol.unh.edu, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 There were a few emails that came through for this series but this was the most recent one so I went with reviewing this one, but it looks like the more descriptive commit subject got lost in this iteration. It would probably be worth adding that back. Additionally, it looks like the functions you added here (including the ones added from the VLAN suite, but I believe those ones are already fixed in the latest version ) are all missing their return types. Of course they don't return anything, but that is still useful to note by annotating it as "None". On Tue, Jul 2, 2024 at 3:25=E2=80=AFPM Nicholas Pratte wrote: > > Several new methods have been added to TestPMDShell in order to produce > the mac filter's individual test cases: > - set_mac_addr > - set_multicast_mac_addr > - rx_vlan_add > - rx_vlan_rm > - vlan_filter_set_on > - vlan_filter_set_off > - set_promisc > > set_mac_addr and set_multicast_addr were created for the mac filter test > suite, enabling users to both add or remove mac and multicast > addresses based on a booling 'add or remove' parameter. The success or I think this is a typo and "booling" should be "boolean" but I could be wro= ng. > failure of each call can be verified if a user deems it necessary. > > The other methods listed are implemented in other respective test > suites, and their implementations have been copied, but are subject to > change; they are not the focus of this patch. > > Bugzilla ID: 1454 > Signed-off-by: Nicholas Pratte > --- > dts/framework/remote_session/testpmd_shell.py | 177 ++++++++++++++++++ > dts/tests/TestSuite_mac_filter.py | 0 It looks like creating the file somehow snuck into the diff for this commit instead of the other one that populates it. > 2 files changed, 177 insertions(+) > create mode 100644 dts/tests/TestSuite_mac_filter.py > > diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framewor= k/remote_session/testpmd_shell.py > index ec22f72221..0be1fb8754 100644 > --- a/dts/framework/remote_session/testpmd_shell.py > +++ b/dts/framework/remote_session/testpmd_shell.py > + def set_multicast_mac_addr(self, port_id: int, multi_addr: str, add:= bool, verify: bool =3D True): > + """Add or remove multicast mac address to a specified port filte= r. Just to make this more clear that you specify the port and not the port filter, it might be helpful here to show that the port possesses the filter by saying "a specified port's filter." > + > + Args: > + port_id: The port ID the multicast address is set on. > + multi_addr: The multicast address to be added to the filter. > + add: If :data:'True', add the specified multicast address to= the port filter. > + If :data:'False', remove the specified multicast address= from the port filter. > + verify: If :data:'True', assert that the 'mcast_addr' operat= ions was successful. > + If :data:'False', execute the 'mcast_addr' operation and= skip the assertion. > + > + Raises: > + InteractiveCommandExecutionError: If either the 'add' or 're= move' operations fails. > + """ > + mcast_cmd =3D "add" if add else "remove" > + output =3D self.send_command(f"mcast_addr {mcast_cmd} {port_id} = {multi_addr}") > + if "Bad arguments" in output: > + self._logger.debug("Invalid arguments provided to mcast_addr= ") > + raise InteractiveCommandExecutionError("Invalid argument pro= vided") > + > + if verify: > + if ( > + "Invalid multicast_addr" in output > + or f'multicast address {"already" if add else "not"} fil= tered by port' in output > + ): > + self._logger.debug(f"Failed to {mcast_cmd} {multi_addr} = on port {port_id}") > + raise InteractiveCommandExecutionError( > + f"Failed to {mcast_cmd} {multi_addr} on port {port_i= d} \n{output}" > + ) > def show_port_stats_all(self) -> list[TestPmdPortStats]: > """Returns the statistics of all the ports. > > diff --git a/dts/tests/TestSuite_mac_filter.py b/dts/tests/TestSuite_mac_= filter.py > new file mode 100644 > index 0000000000..e69de29bb2 > -- > 2.44.0 >