DPDK patches and discussions
 help / color / mirror / Atom feed
From: Patrick Robb <probb@iol.unh.edu>
To: Dean Marx <dmarx@iol.unh.edu>
Cc: luca.vizzarro@arm.com, yoan.picchi@foss.arm.com,
	 Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com,
	dev@dpdk.org
Subject: Re: [PATCH v2 3/3] dts: add flow validation
Date: Wed, 25 Jun 2025 13:38:58 -0400	[thread overview]
Message-ID: <CAJvnSUAxk9D_NL9O7CQv8heESHyMW=Z+ceeRYgMO7BTLD3khHg@mail.gmail.com> (raw)
In-Reply-To: <20250521192629.294265-3-dmarx@iol.unh.edu>

[-- Attachment #1: Type: text/plain, Size: 3541 bytes --]

On Wed, May 21, 2025 at 3:26 PM Dean Marx <dmarx@iol.unh.edu> wrote:

> Add a method for validating flow rules to the testpmd shell class.
> Implement test case skipping for flow rules that do not pass
> validation.
>
> Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
> ---
>  dts/framework/remote_session/testpmd_shell.py | 15 ++++
>  dts/framework/test_run.py                     |  3 +
>  dts/framework/test_suite.py                   | 21 ++++-
>  dts/tests/TestSuite_flow.py                   | 90 +++++++++++++------
>  4 files changed, 102 insertions(+), 27 deletions(-)
>
> diff --git a/dts/framework/remote_session/testpmd_shell.py
> b/dts/framework/remote_session/testpmd_shell.py
> index bd5f2659bd..c2c7ade60a 100644
> --- a/dts/framework/remote_session/testpmd_shell.py
> +++ b/dts/framework/remote_session/testpmd_shell.py
> @@ -1961,6 +1961,21 @@ def flow_create(self, flow_rule: FlowRule, port_id:
> int) -> int:
>              self._logger.debug(f"Failed to create flow
> rule:\n{flow_output}")
>              raise InteractiveCommandExecutionError(f"Failed to create
> flow rule:\n{flow_output}")
>
> +    def flow_validate(self, flow_rule: FlowRule, port_id: int) -> bool:
> +        """Validates a flow rule in the testpmd session.
> +
> +        Args:
> +            flow_rule: :class:`FlowRule` object used for validating
> testpmd flow rule.
> +            port_id: Integer representing the port to use.
> +
> +        Returns:
> +            Boolean representing whether rule is valid or not.
> +        """
> +        flow_output = self.send_command(f"flow validate {port_id}
> {flow_rule}")
> +        if "Flow rule validated" in flow_output:
> +            return True
> +        return False
> +
>      def flow_delete(self, flow_id: int, port_id: int, verify: bool =
> True) -> None:
>          """Deletes the specified flow rule from the testpmd session.
>
> diff --git a/dts/framework/test_run.py b/dts/framework/test_run.py
> index 0fdc57ea9c..cf4af19e8f 100644
> --- a/dts/framework/test_run.py
> +++ b/dts/framework/test_run.py
> @@ -644,6 +644,9 @@ def next(self) -> State | None:
>                  return self
>
>              self.result.update(Result.FAIL, e)
> +        except SkippedTestException as e:
> +            self.logger.info(f"Test case execution SKIPPED: {e}")
> +            self.result.update(Result.SKIP, e)
>          else:
>              self.result.update(Result.PASS)
>              self.logger.info(f"{self.description.capitalize()} PASSED.")
> diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
> index e07c327b77..34e9eb54ea 100644
> --- a/dts/framework/test_suite.py
> +++ b/dts/framework/test_suite.py
> @@ -39,7 +39,7 @@
>      PacketFilteringConfig,
>  )
>
> -from .exception import ConfigurationError, InternalError,
> TestCaseVerifyError
> +from .exception import ConfigurationError, InternalError,
> SkippedTestException, TestCaseVerifyError
>  from .logger import DTSLogger, get_dts_logger
>  from .utils import get_packet_summaries, to_pascal_case
>
> @@ -411,6 +411,25 @@ def _fail_test_case_verify(self, failure_description:
> str) -> None:
>              self._logger.debug(command_res.command)
>          raise TestCaseVerifyError(failure_description)
>
> +    def verify_skip(self, condition: bool, skip_reason: str) -> None:
>

Maybe rename to "verify_else_skip" so it is more descriptive? Up to you.


>
>

Reviewed-by: Patrick Robb <probb@iol.unh.edu>

[-- Attachment #2: Type: text/html, Size: 4745 bytes --]

  reply	other threads:[~2025-06-25 17:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15 16:38 [RFC PATCH 0/1] rte flow test suite Dean Marx
2025-05-15 16:38 ` [RFC PATCH] dts: add " Dean Marx
2025-05-19 18:19   ` [PATCH v1 1/2] " Dean Marx
2025-05-19 18:19     ` [PATCH v1 2/2] dts: add jump and priority tests to flow suite Dean Marx
2025-05-21 19:26     ` [PATCH v2 1/3] dts: add rte flow test suite Dean Marx
2025-05-21 19:26       ` [PATCH v2 2/3] dts: add jump and priority tests to flow suite Dean Marx
2025-06-25 17:25         ` Patrick Robb
2025-05-21 19:26       ` [PATCH v2 3/3] dts: add flow validation Dean Marx
2025-06-25 17:38         ` Patrick Robb [this message]
2025-06-25 17:15       ` [PATCH v2 1/3] dts: add rte flow test suite Patrick Robb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJvnSUAxk9D_NL9O7CQv8heESHyMW=Z+ceeRYgMO7BTLD3khHg@mail.gmail.com' \
    --to=probb@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=dmarx@iol.unh.edu \
    --cc=luca.vizzarro@arm.com \
    --cc=paul.szczepanek@arm.com \
    --cc=yoan.picchi@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).