30d772a0 | 04-Jul-2024 |
Adrian Moreno <amorenoz@redhat.com> |
selftests: openvswitch: add psample test
Add a test to verify sampling packets via psample works.
In order to do that, create a subcommand in ovs-dpctl.py to listen to on the psample multicast grou
selftests: openvswitch: add psample test
Add a test to verify sampling packets via psample works.
In order to do that, create a subcommand in ovs-dpctl.py to listen to on the psample multicast group and print samples.
Reviewed-by: Aaron Conole <aconole@redhat.com> Tested-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Link: https://patch.msgid.link/20240704085710.353845-11-amorenoz@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
b192bf12 | 04-Jul-2024 |
Adrian Moreno <amorenoz@redhat.com> |
selftests: openvswitch: parse trunc action
The trunc action was supported decode-able but not parse-able. Add support for parsing the action string.
Reviewed-by: Aaron Conole <aconole@redhat.com> S
selftests: openvswitch: parse trunc action
The trunc action was supported decode-able but not parse-able. Add support for parsing the action string.
Reviewed-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Link: https://patch.msgid.link/20240704085710.353845-10-amorenoz@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
c7815abb | 04-Jul-2024 |
Adrian Moreno <amorenoz@redhat.com> |
selftests: openvswitch: add userspace parsing
The userspace action lacks parsing support plus it contains a bug in the name of one of its attributes.
This patch makes userspace action work.
Review
selftests: openvswitch: add userspace parsing
The userspace action lacks parsing support plus it contains a bug in the name of one of its attributes.
This patch makes userspace action work.
Reviewed-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Link: https://patch.msgid.link/20240704085710.353845-9-amorenoz@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
7abfd8ec | 02-Jul-2024 |
Aaron Conole <aconole@redhat.com> |
selftests: openvswitch: Be more verbose with selftest debugging.
The openvswitch selftest is difficult to debug for anyone that isn't directly familiar with the openvswitch module and the specifics
selftests: openvswitch: Be more verbose with selftest debugging.
The openvswitch selftest is difficult to debug for anyone that isn't directly familiar with the openvswitch module and the specifics of the test cases. Many times when something fails, the debug log will be sparsely populated and it takes some time to understand where a failure occured.
Increase the amount of details logged to the debug log by trapping all 'info' logs, and all 'ovs_sbx' commands.
Signed-off-by: Aaron Conole <aconole@redhat.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20240702132830.213384-4-aconole@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
818481db | 02-Jul-2024 |
Aaron Conole <aconole@redhat.com> |
selftests: openvswitch: Attempt to autoload module.
Previously, the openvswitch.sh test suites would not attempt to autoload the openvswitch module. The idea was that a user who is manually running
selftests: openvswitch: Attempt to autoload module.
Previously, the openvswitch.sh test suites would not attempt to autoload the openvswitch module. The idea was that a user who is manually running tests might not even have the OVS module loaded or configured for their own development. However, if the kernel module is configured, and the module can be autoloaded then we should just attempt to load it and run the tests. This is especially true in the CI environments, where the CI tests should be able to rely on auto loading to get the test suite running.
Signed-off-by: Aaron Conole <aconole@redhat.com> Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20240702132830.213384-3-aconole@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
b7ce46fc | 25-Jun-2024 |
Aaron Conole <aconole@redhat.com> |
selftests: net: Use the provided dpctl rather than the vswitchd for tests.
The current pmtu test infrastucture requires an installed copy of the ovs-vswitchd userspace. This means that any automate
selftests: net: Use the provided dpctl rather than the vswitchd for tests.
The current pmtu test infrastucture requires an installed copy of the ovs-vswitchd userspace. This means that any automated or constrained environments may not have the requisite tools to run the tests. However, the pmtu tests don't require any special classifier processing. Indeed they are only using the vswitchd in the most basic mode - as a NORMAL switch.
However, the ovs-dpctl kernel utility can now program all the needed basic flows to allow traffic to traverse the tunnels and provide support for at least testing some basic pmtu scenarios. More complicated flow pipelines can be added to the internal ovs test infrastructure, but that is work for the future. For now, enable the most common cases - wide mega flows with no other prerequisites.
Enhance the pmtu testing to try testing using the internal utility, first. As a fallback, if the internal utility isn't running, then try with the ovs-vswitchd userspace tools.
Additionally, make sure that when the pyroute2 package is not available the ovs-dpctl utility will error out to properly signal an error has occurred and skip using the internal utility.
Reviewed-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: Aaron Conole <aconole@redhat.com> Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20240625172245.233874-7-aconole@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
51458e10 | 25-Jun-2024 |
Aaron Conole <aconole@redhat.com> |
selftests: openvswitch: Support implicit ipv6 arguments.
The current iteration of IPv6 support requires explicit fields to be set in addition to not properly support the actual IPv6 addresses proper
selftests: openvswitch: Support implicit ipv6 arguments.
The current iteration of IPv6 support requires explicit fields to be set in addition to not properly support the actual IPv6 addresses properly. With this change, make it so that the ipv6() bare option is usable to create wildcarded flows to match broad swaths of ipv6 traffic.
Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Simon Horman <horms@kernel.org> Signed-off-by: Aaron Conole <aconole@redhat.com> Link: https://patch.msgid.link/20240625172245.233874-6-aconole@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
fefe3b7d | 25-Jun-2024 |
Aaron Conole <aconole@redhat.com> |
selftests: openvswitch: Add support for tunnel() key.
This will be used when setting details about the tunnel to use as transport. There is a difference between the ODP format between tunnel(): the
selftests: openvswitch: Add support for tunnel() key.
This will be used when setting details about the tunnel to use as transport. There is a difference between the ODP format between tunnel(): the 'key' flag is not actually a flag field, so we don't support it in the same way that the vswitchd userspace supports displaying it.
Signed-off-by: Aaron Conole <aconole@redhat.com> Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20240625172245.233874-5-aconole@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
a4126f90 | 25-Jun-2024 |
Aaron Conole <aconole@redhat.com> |
selftests: openvswitch: Add set() and set_masked() support.
These will be used in upcoming commits to set specific attributes for interacting with tunnels. Since set() will use the key parsing rout
selftests: openvswitch: Add set() and set_masked() support.
These will be used in upcoming commits to set specific attributes for interacting with tunnels. Since set() will use the key parsing routine, we also make sure to prepend it with an open paren, for the action parsing to properly understand it.
Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Simon Horman <horms@kernel.org> Signed-off-by: Aaron Conole <aconole@redhat.com> Link: https://patch.msgid.link/20240625172245.233874-4-aconole@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
37de65a7 | 25-Jun-2024 |
Aaron Conole <aconole@redhat.com> |
selftests: openvswitch: Refactor actions parsing.
Until recently, the ovs-dpctl utility was used with a limited actions set and didn't need to have support for multiple similar actions. However, wh
selftests: openvswitch: Refactor actions parsing.
Until recently, the ovs-dpctl utility was used with a limited actions set and didn't need to have support for multiple similar actions. However, when adding support for tunnels, it will be important to support multiple set() actions in a single flow. When printing these actions, the existing code will be unable to print all of the sets - it will only print the first.
Refactor this code to be easier to read and support multiple actions of the same type in an action list.
Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Simon Horman <horms@kernel.org> Signed-off-by: Aaron Conole <aconole@redhat.com> Link: https://patch.msgid.link/20240625172245.233874-3-aconole@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
a8763466 | 18-Jun-2024 |
Adrian Moreno <amorenoz@redhat.com> |
selftests: openvswitch: Set value to nla flags.
Netlink flags, although they don't have payload at the netlink level, are represented as having "True" as value in pyroute2.
Without it, trying to ad
selftests: openvswitch: Set value to nla flags.
Netlink flags, although they don't have payload at the netlink level, are represented as having "True" as value in pyroute2.
Without it, trying to add a flow with a flag-type action (e.g: pop_vlan) fails with the following traceback:
Traceback (most recent call last): File "[...]/ovs-dpctl.py", line 2498, in <module> sys.exit(main(sys.argv)) ^^^^^^^^^^^^^^ File "[...]/ovs-dpctl.py", line 2487, in main ovsflow.add_flow(rep["dpifindex"], flow) File "[...]/ovs-dpctl.py", line 2136, in add_flow reply = self.nlm_request( ^^^^^^^^^^^^^^^^^ File "[...]/pyroute2/netlink/nlsocket.py", line 822, in nlm_request return tuple(self._genlm_request(*argv, **kwarg)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "[...]/pyroute2/netlink/generic/__init__.py", line 126, in nlm_request return tuple(super().nlm_request(*argv, **kwarg)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "[...]/pyroute2/netlink/nlsocket.py", line 1124, in nlm_request self.put(msg, msg_type, msg_flags, msg_seq=msg_seq) File "[...]/pyroute2/netlink/nlsocket.py", line 389, in put self.sendto_gate(msg, addr) File "[...]/pyroute2/netlink/nlsocket.py", line 1056, in sendto_gate msg.encode() File "[...]/pyroute2/netlink/__init__.py", line 1245, in encode offset = self.encode_nlas(offset) ^^^^^^^^^^^^^^^^^^^^^^^^ File "[...]/pyroute2/netlink/__init__.py", line 1560, in encode_nlas nla_instance.setvalue(cell[1]) File "[...]/pyroute2/netlink/__init__.py", line 1265, in setvalue nlv.setvalue(nla_tuple[1]) ~~~~~~~~~^^^ IndexError: list index out of range
Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
8eff0e06 | 11-Oct-2023 |
Aaron Conole <aconole@redhat.com> |
selftests: openvswitch: Fix the ct_tuple for v4
The ct_tuple v4 data structure decode / encode routines were using the v6 IP address decode and relying on default encode. This could cause exceptions
selftests: openvswitch: Fix the ct_tuple for v4
The ct_tuple v4 data structure decode / encode routines were using the v6 IP address decode and relying on default encode. This could cause exceptions during encode / decode depending on how a ct4 tuple would appear in a netlink message.
Caught during code review.
Fixes: e52b07aa1a54 ("selftests: openvswitch: add flow dump support") Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
76035fd1 | 11-Oct-2023 |
Aaron Conole <aconole@redhat.com> |
selftests: openvswitch: Skip drop testing on older kernels
Kernels that don't have support for openvswitch drop reasons also won't have the drop counter reasons, so we should skip the test completel
selftests: openvswitch: Skip drop testing on older kernels
Kernels that don't have support for openvswitch drop reasons also won't have the drop counter reasons, so we should skip the test completely. It previously wasn't possible to build a test case for this without polluting the datapath, so we introduce a mechanism to clear all the flows from a datapath allowing us to test for explicit drop actions, and then clear the flows to build the original test case.
Fixes: 4242029164d6 ("selftests: openvswitch: add explicit drop testcase") Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|