selftests: openvswitch: add a simple test for tunnel metadata
authorIlya Maximets <i.maximets@ovn.org>
Tue, 9 Sep 2025 16:54:16 +0000 (18:54 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sun, 14 Sep 2025 21:28:13 +0000 (14:28 -0700)
commit6cafb93c1f2aec7875f7a024a53e15f0683df699
treebe770849354ab808fff1798612b6b881e35fa285
parenta9888628cb2c768202a4530e2816da1889cc3165
selftests: openvswitch: add a simple test for tunnel metadata

This test ensures that upon receiving decapsulated packets from a
tunnel interface in openvswitch, the tunnel metadata fields are
properly populated.  This partially covers interoperability of the
kernel tunnel ports and openvswitch tunnels (LWT) and parsing and
formatting of the tunnel metadata fields of the openvswitch netlink
uAPI.  Doing so, this test also ensures that fields and flags are
properly extracted during decapsulation by the tunnel core code,
serving as a regression test for the previously fixed issue with the
DF bit not being extracted from the outer IP header.

The ovs-dpctl.py script already supports all that is necessary for
the tunnel ports for this test, so we only need to adjust the
ovs_add_if() function to pass the '-t' port type argument in order
to be able to create tunnel ports in the openvswitch datapath.

Reviewed-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Link: https://patch.msgid.link/20250909165440.229890-3-i.maximets@ovn.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/openvswitch/openvswitch.sh