[PATCH 5/5] dts: add `show port stats` command to TestPmdShell
Jeremy Spewock
jspewock at iol.unh.edu
Mon Apr 29 17:54:03 CEST 2024
On Fri, Apr 12, 2024 at 7:11 AM Luca Vizzarro <luca.vizzarro at arm.com> wrote:
<snip>
> + def show_port_stats(self, port_id: int) -> TestPmdPortStats:
> + """Returns the given port statistics.
> +
> + Args:
> + port_id: The port ID to gather information for.
> +
> + Raises:
> + InteractiveCommandExecutionError: If `port_id` is invalid.
> + """
> + output = self.send_command(f"show port stats {port_id}")
Does this also need to skip the first line in the output?
> + if output.startswith("Invalid port"):
> + raise InteractiveCommandExecutionError("invalid port given")
> +
> + return TestPmdPortStats.parse(output)
> +
> def close(self) -> None:
> """Overrides :meth:`~.interactive_shell.close`."""
> self.send_command("quit", "")
> --
> 2.34.1
>
More information about the dev
mailing list