2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00
ovs/tests/system-offloads-testsuite-macros.at

73 lines
2.7 KiB
Plaintext
Raw Normal View History

AT_COPYRIGHT([Copyright (c) 2022 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.])
# The goal is to run as many as possible of the system-traffic tests with
# OVS tc offload enabled. We do this by overriding the
# OVS_TRAFFIC_VSWITCHD_START() with offloading enabled.
m4_define([OVS_TRAFFIC_VSWITCHD_START],
[AT_CHECK([modprobe openvswitch])
on_exit 'modprobe -r openvswitch'
m4_foreach([mod], [[vport_geneve], [vport_gre], [vport_vxlan]],
[modprobe -q mod || echo "Module mod not loaded."
on_exit 'modprobe -q -r mod'
])
on_exit 'ovs-dpctl del-dp ovs-system'
on_exit 'ovs-appctl dpctl/flush-conntrack'
_OVS_VSWITCHD_START([], [-- set Open_vSwitch . other_config:hw-offload=true $3])
dnl Add bridges, ports, etc.
AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2])
tests: Add support for running system tests under retis. Retis is very useful for debugging our system tests or debugging kernel issues through our system tests. This change adds a convenient way to run any kernel system test with the retis capture on the background. E.g.: make check-kernel OVS_TEST_WITH_RETIS=yes TESTSUITEFLAGS='167 -d' Retis 1.5 is required, since we're using ifdump profile, and it also will mount debugfs for us in case of running in a different namespace. It should be available in $PATH. In addition to just capturing the retis.data, we're also running the capture with --print to print all the events as they appear, and producing the sorted output in the end. This makes it easier to work across systems with different versions of retis and saves time for running the sort manually. The raw data is still available for advanced processing, if needed. Not specifying any particular collector, capturing everything that's enabled by default. OVS tracking is turned on by default. Since OVS tracking is used, it's required to start retis after the kernel datapath is created, otherwise it will fail to obtain the map of upcall PIDs. That's why we need to start it after the bridge is created. Only adding support for kernel-related test suites for now. For userspace test suites it may also be useful at some point, but currently that requires running without --ovs-track and isn't too important. Startup of the retis capture adds significant amount of time to each test, so not running it by default. Link: https://github.com/retis-org/retis Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2025-06-30 19:09:57 +02:00
dnl Start retis capture if requested.
RETIS_CHECK_AND_RUN()
])
# Macro to exclude tests that will fail with TC offload enabled.
# We currently have the below tests disabled in system-traffic.at
# for the following reasons:
#
# TC does not support moving ports to a different namespace than vswitchd's
# namespace, so we need to disable this test.
# - 'conntrack - multiple namespaces, internal ports'
#
# The kernel's tcf_ct_act() function does not seem to take care of any (QinQ)
# VLAN headers causing commits to fail. However, if this is solved, we have to
# make sure conntrack does not break the VLAN boundary, i.e., putting together
# two packets with different CVLAN+SVLAN values.
# - 'conntrack - IPv4 fragmentation + cvlan'
#
# Fragmentation handling in ct zone 9 does not seem to work correctly.
# When moving this test over to the default zone all works fine.
# - 'conntrack - Fragmentation over vxlan'
#
# Occasionally we fail with invalid byte counts.
# - 'datapath - truncate and output to gre tunnel by simulated packets'
# - 'datapath - truncate and output to gre tunnel'
#
m4_define([CHECK_NO_TC_OFFLOAD],
[
AT_SKIP_IF([:])
])
# Conntrack ALGs are not supported for tc.
m4_define([CHECK_CONNTRACK_ALG],
[
AT_SKIP_IF([:])
])
# Conntrack timeout not supported for tc.
m4_define([CHECK_CONNTRACK_TIMEOUT],
[
AT_SKIP_IF([:])
])