[v1] dts: add verify argument to set forward mode

Message ID 20240812142355.12532-1-dmarx@iol.unh.edu (mailing list archive)
State New
Delegated to: Juraj Linkeš
Headers
Series [v1] dts: add verify argument to set forward mode |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Dean Marx Aug. 12, 2024, 2:23 p.m. UTC
Add optional verify argument to the set_forward_mode
method in testpmd shell.

Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
 dts/framework/remote_session/testpmd_shell.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
  

Comments

Jeremy Spewock Aug. 12, 2024, 3:29 p.m. UTC | #1
On Mon, Aug 12, 2024 at 10:23 AM Dean Marx <dmarx@iol.unh.edu> wrote:
>
> Add optional verify argument to the set_forward_mode
> method in testpmd shell.
>
> Signed-off-by: Dean Marx <dmarx@iol.unh.edu>

The patch all looks good to me, but it might be beneficial to add a
"fixes" tag as well as a "bugzilla ID" tag to the commit body. The
DPDK contribution guidelines explains how to format the tags [1] and
also which order they should appear in [2].

[1] https://doc.dpdk.org/guides/contributing/patches.html#patch-fix-related-issues
[2] https://doc.dpdk.org/guides/contributing/patches.html#tag-order

> 2.44.0
>
  
Juraj Linkeš Sept. 16, 2024, 10:42 a.m. UTC | #2
On 12. 8. 2024 16:23, Dean Marx wrote:
> Add optional verify argument to the set_forward_mode
> method in testpmd shell.
> 

This doesn't add the method, just fixes it's use. Don't forget to fix 
the subject as well. And also add the tags that Jeremy mentioned.

> Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
> ---
>   dts/framework/remote_session/testpmd_shell.py | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
> index 43e9f56517..b8cdfc01b9 100644
> --- a/dts/framework/remote_session/testpmd_shell.py
> +++ b/dts/framework/remote_session/testpmd_shell.py
> @@ -717,11 +717,12 @@ def set_forward_mode(self, mode: SimpleForwardingModes, verify: bool = True):
>                   fails to update.
>           """
>           set_fwd_output = self.send_command(f"set fwd {mode.value}")
> -        if f"Set {mode.value} packet forwarding mode" not in set_fwd_output:
> -            self._logger.debug(f"Failed to set fwd mode to {mode.value}:\n{set_fwd_output}")
> -            raise InteractiveCommandExecutionError(
> -                f"Test pmd failed to set fwd mode to {mode.value}"
> -            )
> +        if verify:
> +            if f"Set {mode.value} packet forwarding mode" not in set_fwd_output:
> +                self._logger.debug(f"Failed to set fwd mode to {mode.value}:\n{set_fwd_output}")
> +                raise InteractiveCommandExecutionError(
> +                    f"Test pmd failed to set fwd mode to {mode.value}"
> +                )
>   
>       def show_port_info_all(self) -> list[TestPmdPort]:
>           """Returns the information of all the ports.
  

Patch

diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index 43e9f56517..b8cdfc01b9 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -717,11 +717,12 @@  def set_forward_mode(self, mode: SimpleForwardingModes, verify: bool = True):
                 fails to update.
         """
         set_fwd_output = self.send_command(f"set fwd {mode.value}")
-        if f"Set {mode.value} packet forwarding mode" not in set_fwd_output:
-            self._logger.debug(f"Failed to set fwd mode to {mode.value}:\n{set_fwd_output}")
-            raise InteractiveCommandExecutionError(
-                f"Test pmd failed to set fwd mode to {mode.value}"
-            )
+        if verify:
+            if f"Set {mode.value} packet forwarding mode" not in set_fwd_output:
+                self._logger.debug(f"Failed to set fwd mode to {mode.value}:\n{set_fwd_output}")
+                raise InteractiveCommandExecutionError(
+                    f"Test pmd failed to set fwd mode to {mode.value}"
+                )
 
     def show_port_info_all(self) -> list[TestPmdPort]:
         """Returns the information of all the ports.