Re: [PATCH v1] dts: remove the OS UDP test suite

2024-04-26 Thread Luca Vizzarro

On 26/04/2024 09:55, Juraj Linkeš wrote:

From what I can tell, we don't need any of these for Scapy, but we
should test this in other environments as well (my virtual environment
doesn't play nice with port rebinding and running testpmd - I have to
start Scapy after starting testpmd to get it to work. This may be a
nightmare to debug.). Can you, Luca and Patrick, run the scatter test
suite with this patch to verify this?


Hi Juraj,

Unfortunately I am currently not able to test the scatter patch as we 
are still trying to sort out a non-Mellanox setup.


Hopefully Jeremy can help.

Best,
Luca


Re: [PATCH v1] dts: remove the OS UDP test suite

2024-04-26 Thread Juraj Linkeš
On Tue, Apr 23, 2024 at 2:00 PM Juraj Linkeš  wrote:
>
> On Tue, Apr 23, 2024 at 12:39 PM Luca Vizzarro  wrote:
> >
> > On 19/04/2024 14:52, Juraj Linkeš wrote:
> > > diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
> > > 
> > > -def configure_testbed_ipv4(self, restore: bool = False) -> None:
> > > -"""Configure IPv4 addresses on all testbed ports.
> > > -
> > > -The configured ports are:
> > > -
> > > -* SUT ingress port,
> > > -* SUT egress port,
> > > -* TG ingress port,
> > > -* TG egress port.
> > > -
> > > -Args:
> > > -restore: If :data:`True`, will remove the configuration 
> > > instead.
> > > -"""
> > > -delete = True if restore else False
> > > -enable = False if restore else True
> > > -self._configure_ipv4_forwarding(enable)
> > > -self.sut_node.configure_port_ip_address(
> > > -self._sut_ip_address_egress, self._sut_port_egress, delete
> > > -)
> > > -self.sut_node.configure_port_state(self._sut_port_egress, enable)
> > > -self.sut_node.configure_port_ip_address(
> > > -self._sut_ip_address_ingress, self._sut_port_ingress, delete
> > > -)
> > > -self.sut_node.configure_port_state(self._sut_port_ingress, 
> > > enable)
> > > -self.tg_node.configure_port_ip_address(
> > > -self._tg_ip_address_ingress, self._tg_port_ingress, delete
> > > -)
> > > -self.tg_node.configure_port_state(self._tg_port_ingress, enable)
> > > -self.tg_node.configure_port_ip_address(
> > > -self._tg_ip_address_egress, self._tg_port_egress, delete
> > > -)
> > > -self.tg_node.configure_port_state(self._tg_port_egress, enable)
> > > -
> > > -def _configure_ipv4_forwarding(self, enable: bool) -> None:
> > > -self.sut_node.configure_ipv4_forwarding(enable)
> > > -
> > > 
> > > diff --git a/dts/framework/testbed_model/linux_session.py 
> > > b/dts/framework/testbed_model/linux_session.py
> > > 
> > > -def configure_port_state(self, port: Port, enable: bool) -> None:
> > > -"""Overrides 
> > > :meth:`~.os_session.OSSession.configure_port_state`."""
> > > -state = "up" if enable else "down"
> > > -self.send_command(f"ip link set dev {port.logical_name} 
> > > {state}", privileged=True)
> > > -
> > > -def configure_port_ip_address(
> > > -self,
> > > -address: Union[IPv4Interface, IPv6Interface],
> > > -port: Port,
> > > -delete: bool,
> > > -) -> None:
> > > -"""Overrides 
> > > :meth:`~.os_session.OSSession.configure_port_ip_address`."""
> > > -command = "del" if delete else "add"
> > > -self.send_command(
> > > -f"ip address {command} {address} dev {port.logical_name}",
> > > -privileged=True,
> > > -verify=True,
> > > -)
> > > -
> >  > 
> > > @@ -205,8 +185,3 @@ def configure_port_mtu(self, mtu: int, port: Port) -> 
> > > None:
> >  > 
> > > -
> > > -def configure_ipv4_forwarding(self, enable: bool) -> None:
> > > -"""Overrides 
> > > :meth:`~.os_session.OSSession.configure_ipv4_forwarding`."""
> > > -state = 1 if enable else 0
> > > -self.send_command(f"sysctl -w net.ipv4.ip_forward={state}", 
> > > privileged=True)
> > > diff --git a/dts/framework/testbed_model/node.py 
> > > b/dts/framework/testbed_model/node.py
> > > 
> > > -def configure_port_state(self, port: Port, enable: bool = True) -> 
> > > None:
> > > -"""Enable/disable `port`.
> > > -
> > > -Args:
> > > -port: The port to enable/disable.
> > > -enable: :data:`True` to enable, :data:`False` to disable.
> > > -"""
> > > -self.main_session.configure_port_state(port, enable)
> > > -
> > > -def configure_port_ip_address(
> > > -self,
> > > -address: Union[IPv4Interface, IPv6Interface],
> > > -port: Port,
> > > -delete: bool = False,
> > > -) -> None:
> > > -"""Add an IP address to `port` on this node.
> > > -
> > > -Args:
> > > -address: The IP address with mask in CIDR format. Can be 
> > > either IPv4 or IPv6.
> > > -port: The port to which to add the address.
> > > -delete: If :data:`True`, will delete the address from the 
> > > port instead of adding it.
> > > -"""
> > > -self.main_session.configure_port_ip_address(address, port, 
> > > delete)
> > > -
> > > 
> > > diff --git a/dts/framework/testbed_model/os_session.py 
> > > b/dts/framework/testbed_model/os_session.py
> > > 
> > > -@abstractmethod
> > > -def configure_port_state(self, port: Port, enable: bool) -> None:
> > > -"""Enable/disable `port` in the operating system.
> > > -
> > > -Args:
> > > -port: The port to configure.
> > > -enable: If :data:`True`,

Re: [PATCH v1] dts: remove the OS UDP test suite

2024-04-23 Thread Juraj Linkeš
On Tue, Apr 23, 2024 at 12:39 PM Luca Vizzarro  wrote:
>
> On 19/04/2024 14:52, Juraj Linkeš wrote:
> > diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
> > 
> > -def configure_testbed_ipv4(self, restore: bool = False) -> None:
> > -"""Configure IPv4 addresses on all testbed ports.
> > -
> > -The configured ports are:
> > -
> > -* SUT ingress port,
> > -* SUT egress port,
> > -* TG ingress port,
> > -* TG egress port.
> > -
> > -Args:
> > -restore: If :data:`True`, will remove the configuration 
> > instead.
> > -"""
> > -delete = True if restore else False
> > -enable = False if restore else True
> > -self._configure_ipv4_forwarding(enable)
> > -self.sut_node.configure_port_ip_address(
> > -self._sut_ip_address_egress, self._sut_port_egress, delete
> > -)
> > -self.sut_node.configure_port_state(self._sut_port_egress, enable)
> > -self.sut_node.configure_port_ip_address(
> > -self._sut_ip_address_ingress, self._sut_port_ingress, delete
> > -)
> > -self.sut_node.configure_port_state(self._sut_port_ingress, enable)
> > -self.tg_node.configure_port_ip_address(
> > -self._tg_ip_address_ingress, self._tg_port_ingress, delete
> > -)
> > -self.tg_node.configure_port_state(self._tg_port_ingress, enable)
> > -self.tg_node.configure_port_ip_address(
> > -self._tg_ip_address_egress, self._tg_port_egress, delete
> > -)
> > -self.tg_node.configure_port_state(self._tg_port_egress, enable)
> > -
> > -def _configure_ipv4_forwarding(self, enable: bool) -> None:
> > -self.sut_node.configure_ipv4_forwarding(enable)
> > -
> > 
> > diff --git a/dts/framework/testbed_model/linux_session.py 
> > b/dts/framework/testbed_model/linux_session.py
> > 
> > -def configure_port_state(self, port: Port, enable: bool) -> None:
> > -"""Overrides 
> > :meth:`~.os_session.OSSession.configure_port_state`."""
> > -state = "up" if enable else "down"
> > -self.send_command(f"ip link set dev {port.logical_name} {state}", 
> > privileged=True)
> > -
> > -def configure_port_ip_address(
> > -self,
> > -address: Union[IPv4Interface, IPv6Interface],
> > -port: Port,
> > -delete: bool,
> > -) -> None:
> > -"""Overrides 
> > :meth:`~.os_session.OSSession.configure_port_ip_address`."""
> > -command = "del" if delete else "add"
> > -self.send_command(
> > -f"ip address {command} {address} dev {port.logical_name}",
> > -privileged=True,
> > -verify=True,
> > -)
> > -
>  > 
> > @@ -205,8 +185,3 @@ def configure_port_mtu(self, mtu: int, port: Port) -> 
> > None:
>  > 
> > -
> > -def configure_ipv4_forwarding(self, enable: bool) -> None:
> > -"""Overrides 
> > :meth:`~.os_session.OSSession.configure_ipv4_forwarding`."""
> > -state = 1 if enable else 0
> > -self.send_command(f"sysctl -w net.ipv4.ip_forward={state}", 
> > privileged=True)
> > diff --git a/dts/framework/testbed_model/node.py 
> > b/dts/framework/testbed_model/node.py
> > 
> > -def configure_port_state(self, port: Port, enable: bool = True) -> 
> > None:
> > -"""Enable/disable `port`.
> > -
> > -Args:
> > -port: The port to enable/disable.
> > -enable: :data:`True` to enable, :data:`False` to disable.
> > -"""
> > -self.main_session.configure_port_state(port, enable)
> > -
> > -def configure_port_ip_address(
> > -self,
> > -address: Union[IPv4Interface, IPv6Interface],
> > -port: Port,
> > -delete: bool = False,
> > -) -> None:
> > -"""Add an IP address to `port` on this node.
> > -
> > -Args:
> > -address: The IP address with mask in CIDR format. Can be 
> > either IPv4 or IPv6.
> > -port: The port to which to add the address.
> > -delete: If :data:`True`, will delete the address from the port 
> > instead of adding it.
> > -"""
> > -self.main_session.configure_port_ip_address(address, port, delete)
> > -
> > 
> > diff --git a/dts/framework/testbed_model/os_session.py 
> > b/dts/framework/testbed_model/os_session.py
> > 
> > -@abstractmethod
> > -def configure_port_state(self, port: Port, enable: bool) -> None:
> > -"""Enable/disable `port` in the operating system.
> > -
> > -Args:
> > -port: The port to configure.
> > -enable: If :data:`True`, enable the port, otherwise shut it 
> > down.
> > -"""
> > -
> > -@abstractmethod
> > -def configure_port_ip_address(
> > -self,
> > -address: Union[IPv4Interface, IPv6Interface],
> > -port: Port,
> > -delete: bool,
> > -) -> None:
> > -"""Configur

Re: [PATCH v1] dts: remove the OS UDP test suite

2024-04-23 Thread Luca Vizzarro

On 19/04/2024 14:52, Juraj Linkeš wrote:

diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py

-def configure_testbed_ipv4(self, restore: bool = False) -> None:
-"""Configure IPv4 addresses on all testbed ports.
-
-The configured ports are:
-
-* SUT ingress port,
-* SUT egress port,
-* TG ingress port,
-* TG egress port.
-
-Args:
-restore: If :data:`True`, will remove the configuration instead.
-"""
-delete = True if restore else False
-enable = False if restore else True
-self._configure_ipv4_forwarding(enable)
-self.sut_node.configure_port_ip_address(
-self._sut_ip_address_egress, self._sut_port_egress, delete
-)
-self.sut_node.configure_port_state(self._sut_port_egress, enable)
-self.sut_node.configure_port_ip_address(
-self._sut_ip_address_ingress, self._sut_port_ingress, delete
-)
-self.sut_node.configure_port_state(self._sut_port_ingress, enable)
-self.tg_node.configure_port_ip_address(
-self._tg_ip_address_ingress, self._tg_port_ingress, delete
-)
-self.tg_node.configure_port_state(self._tg_port_ingress, enable)
-self.tg_node.configure_port_ip_address(
-self._tg_ip_address_egress, self._tg_port_egress, delete
-)
-self.tg_node.configure_port_state(self._tg_port_egress, enable)
-
-def _configure_ipv4_forwarding(self, enable: bool) -> None:
-self.sut_node.configure_ipv4_forwarding(enable)
-

diff --git a/dts/framework/testbed_model/linux_session.py 
b/dts/framework/testbed_model/linux_session.py

-def configure_port_state(self, port: Port, enable: bool) -> None:
-"""Overrides :meth:`~.os_session.OSSession.configure_port_state`."""
-state = "up" if enable else "down"
-self.send_command(f"ip link set dev {port.logical_name} {state}", 
privileged=True)
-
-def configure_port_ip_address(
-self,
-address: Union[IPv4Interface, IPv6Interface],
-port: Port,
-delete: bool,
-) -> None:
-"""Overrides 
:meth:`~.os_session.OSSession.configure_port_ip_address`."""
-command = "del" if delete else "add"
-self.send_command(
-f"ip address {command} {address} dev {port.logical_name}",
-privileged=True,
-verify=True,
-)
-

> 

@@ -205,8 +185,3 @@ def configure_port_mtu(self, mtu: int, port: Port) -> None:

> 

-
-def configure_ipv4_forwarding(self, enable: bool) -> None:
-"""Overrides 
:meth:`~.os_session.OSSession.configure_ipv4_forwarding`."""
-state = 1 if enable else 0
-self.send_command(f"sysctl -w net.ipv4.ip_forward={state}", 
privileged=True)
diff --git a/dts/framework/testbed_model/node.py 
b/dts/framework/testbed_model/node.py

-def configure_port_state(self, port: Port, enable: bool = True) -> None:
-"""Enable/disable `port`.
-
-Args:
-port: The port to enable/disable.
-enable: :data:`True` to enable, :data:`False` to disable.
-"""
-self.main_session.configure_port_state(port, enable)
-
-def configure_port_ip_address(
-self,
-address: Union[IPv4Interface, IPv6Interface],
-port: Port,
-delete: bool = False,
-) -> None:
-"""Add an IP address to `port` on this node.
-
-Args:
-address: The IP address with mask in CIDR format. Can be either 
IPv4 or IPv6.
-port: The port to which to add the address.
-delete: If :data:`True`, will delete the address from the port 
instead of adding it.
-"""
-self.main_session.configure_port_ip_address(address, port, delete)
-

diff --git a/dts/framework/testbed_model/os_session.py 
b/dts/framework/testbed_model/os_session.py

-@abstractmethod
-def configure_port_state(self, port: Port, enable: bool) -> None:
-"""Enable/disable `port` in the operating system.
-
-Args:
-port: The port to configure.
-enable: If :data:`True`, enable the port, otherwise shut it down.
-"""
-
-@abstractmethod
-def configure_port_ip_address(
-self,
-address: Union[IPv4Interface, IPv6Interface],
-port: Port,
-delete: bool,
-) -> None:
-"""Configure an IP address on `port` in the operating system.
-
-Args:
-address: The address to configure.
-port: The port to configure.
-delete: If :data:`True`, remove the IP address, otherwise 
configure it.
-"""
-

diff --git a/dts/framework/testbed_model/sut_node.py 
b/dts/framework/testbed_model/sut_node.py

-def configure_ipv4_forwarding(self, enable: bool) -> None:
-"""Enable/disable IPv4 forwarding on the node.
-
-Args:
-enable: If :data:`True`, enable the forwarding, otherwise dis