diff mbox series

[ovs-dev,10/10] tests: Check unit tests logs for errors.

Message ID 20240212175537.1356073-11-xsimonar@redhat.com
State Accepted
Headers show
Series Fixes to Unit tests. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Xavier Simonart Feb. 12, 2024, 5:55 p.m. UTC
System tests are checking for errors in logs at the end of the tests.
This patch implements the same feature for Unit tests.
However, many unit tests display errors in the logs.
Hence this patch also:
- fixes a few tests, when the error cause was identified to be due to the test.
- add exceptions to ignore most common errors (in the macro, common for all tests)
- add exceptions to ignore some errors unique to some tests.
Future patches should investigate those errors, and either fix
ovn, fix the test or add exceptions (some errors are expected, such as purposely passing wrong
parameters).

Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
---
 tests/ovn-controller.at |  66 +++++++++--
 tests/ovn-ic.at         |   4 +-
 tests/ovn-macros.at     |  50 ++++++--
 tests/ovn.at            | 250 +++++++++++++++++++++++++++++++++-------
 4 files changed, 309 insertions(+), 61 deletions(-)
diff mbox series

Patch

diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at
index c10bc155b..ded10f81d 100644
--- a/tests/ovn-controller.at
+++ b/tests/ovn-controller.at
@@ -74,7 +74,7 @@  check_patches
 # won't be created until there's a localnet port on a logical switch with
 # another logical port bound to this chassis.
 ovn-sbctl \
-    -- --id=@dp101 create Datapath_Binding tunnel_key=101 \
+    -- --id=@dp101 create Datapath_Binding tunnel_key=101 external_ids:name=dp101 \
     -- create Port_Binding datapath=@dp101 logical_port=localnet1 tunnel_key=1 \
         type=localnet options:network_name=physnet1
 check_patches
@@ -82,7 +82,7 @@  check_patches
 # Create a localnet port on a logical switch with a port bound to this chassis.
 # Now we should get some patch ports created.
 ovn-sbctl \
-    -- --id=@dp102 create Datapath_Binding tunnel_key=102 \
+    -- --id=@dp102 create Datapath_Binding tunnel_key=102 external_ids:name=dp102 \
     -- create Port_Binding datapath=@dp102 logical_port=localnet2 tunnel_key=1 \
         type=localnet options:network_name=physnet1 \
     -- create Port_Binding datapath=@dp102 logical_port=localvif2 tunnel_key=2
@@ -96,8 +96,8 @@  check_patches \
 # OVN no longer uses OVS patch ports to implement logical patch ports, so
 # the set of OVS patch ports doesn't change.
 AT_CHECK([ovn-sbctl \
-    -- --id=@dp1 create Datapath_Binding tunnel_key=1 \
-    -- --id=@dp2 create Datapath_Binding tunnel_key=2 \
+    -- --id=@dp1 create Datapath_Binding tunnel_key=1 external_ids:name=dp1 \
+    -- --id=@dp2 create Datapath_Binding tunnel_key=2 external_ids:name=dp2 \
     -- create Port_Binding datapath=@dp1 logical_port=foo tunnel_key=1 type=patch options:peer=bar \
     -- create Port_Binding datapath=@dp2 logical_port=bar tunnel_key=2 type=patch options:peer=foo \
     -- create Port_Binding datapath=@dp1 logical_port=dp1vif tunnel_key=3 \
@@ -241,7 +241,20 @@  wait_row_count Chassis_Private 1
 wait_row_count Chassis 1
 
 # Gracefully terminate daemons
-OVN_CLEANUP_SBOX([hv])
+# Ignore  following errors:
+# - Invalid ovn-bridge-mappings configuration: 'foo-mapping'
+# - unknown datapath type foo
+# - could not create datapath br-int of unknown type foo
+# - could not create datapath br-int of unknown type foobar
+# - unknown datapath type bar
+# - could not create datapath br-int of unknown type bar
+# - Transaction causes multiple rows ...
+# - failed to create bridge br-int: Address family not supported by protocol # due to previous errors.
+OVN_CLEANUP_SBOX([hv], ["/foo/d
+/bar/d
+/Transaction causes multiple rows/d
+/failed to create bridge/d"])
+
 OVN_CLEANUP_VSWITCH([main])
 as ovn-sb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
@@ -319,6 +332,8 @@  OVN_CLEANUP_SBOX([hv])
 OVN_CLEANUP_VSWITCH([main])
 as ovn-sb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+as ovn-nb
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 AT_CLEANUP
 ])
@@ -355,6 +370,8 @@  OVN_CLEANUP_SBOX([hv])
 OVN_CLEANUP_VSWITCH([main])
 as ovn-sb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+as ovn-nb
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 AT_CLEANUP
 ])
@@ -386,6 +403,8 @@  OVN_CLEANUP_SBOX([hv])
 OVN_CLEANUP_VSWITCH([main])
 as ovn-sb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+as ovn-nb
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 AT_CLEANUP
 
@@ -647,7 +666,9 @@  primary lport : [[lsp1]]
     done
 done
 
-OVN_CLEANUP([hv1])
+check as northd ovn-appctl -t ovn-northd resume
+OVN_CLEANUP([hv1
+/No distributed-port option set for chassisredirect port lsp1/d])
 AT_CLEANUP
 
 AT_SETUP([ovn-controller - ssl files change when using command line options])
@@ -704,7 +725,16 @@  OVS_WAIT_FOR_OUTPUT([ovn-appctl -t ovn-controller connection-status], [0], [conn
 
 cat hv1/ovn-controller.log
 
-OVN_CLEANUP([hv1])
+# Expect different errors as trying to connect with wrong keys/certificates, or with keys/certificates deleted
+OVN_CLEANUP([hv1
+/SSL_use_PrivateKey_file/d
+/SSL_use_certificate_file/d
+/Private key must be configured to use SSL/d
+/Certificate must be configured to use SSL/d
+/SSL_read: error/d
+/receive error: Input/d
+/connection dropped/d
+])
 AT_CLEANUP
 
 OVN_FOR_EACH_NORTHD([
@@ -832,10 +862,13 @@  tos_option=$(ovs-vsctl get interface ovn-fakech-0 options)
 AT_CHECK([test "$tos_option" = "$no_tos_options"], [0], [])
 
 # Gracefully terminate daemons
-OVN_CLEANUP_SBOX([hv])
+# Expect invalid TOS 61
+OVN_CLEANUP_SBOX([hv], ["/invalid TOS 61/d"])
 OVN_CLEANUP_VSWITCH([main])
 as ovn-sb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+as ovn-nb
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 AT_CLEANUP
 ])
@@ -2120,6 +2153,8 @@  for i in $(seq 10); do
     OVS_WAIT_UNTIL([test $(as hv1 ovs-ofctl dump-flows br-int table=46 | grep -c "priority=1100") = "$(($i + 1))"])
 done
 
+# Resume northd to be able to properly cleanup
+check as northd ovn-appctl -t ovn-northd resume
 OVN_CLEANUP([hv1])
 AT_CLEANUP
 
@@ -2294,7 +2329,9 @@  AT_CHECK([grep "Parsing of ovn-chassis-mac-mappings failed" hv1/ovn-controller.l
 AT_CHECK([grep "Parsing of ovn-chassis-mac-mappings failed" hv1/ovn-controller.log | grep -q invalid2])
 AT_CHECK([grep "Parsing of ovn-chassis-mac-mappings failed" hv1/ovn-controller.log | grep -q br1], [1])
 
-OVN_CLEANUP([hv1])
+OVN_CLEANUP([hv1
+/Parsing of ovn-chassis-mac-mappings failed/d
+])
 AT_CLEANUP
 
 AT_SETUP([ovn-controller - localport can be recreated])
@@ -2631,7 +2668,10 @@  OVS_WAIT_UNTIL([grep -q 'Removing unsupported key "unsupported" from chassis rec
 
 AT_CHECK([ovn-sbctl get chassis $chassis_id other_config:unsupported], [1], [ignore], [ignore])
 
-OVN_CLEANUP([hv1])
+OVN_CLEANUP([hv1
+/Removing unsupported key/d
+])
+
 AT_CLEANUP
 ])
 
@@ -2723,7 +2763,11 @@  ovn-nbctl --wait=hv sync
 
 AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_LOCAL_OUTPUT | grep -q controller], [1])
 
-OVN_CLEANUP([hv1])
+# Since we add many ports in one nbctl command, we might get some warnings on slow systems.
+OVN_CLEANUP([hv1
+/Unreasonably long/d
+/faults:/d
+/context switches/d])
 AT_CLEANUP
 ])
 
diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at
index dc32eaa7f..44dbf8ab1 100644
--- a/tests/ovn-ic.at
+++ b/tests/ovn-ic.at
@@ -136,9 +136,9 @@  AT_CHECK([ovn-ic-sbctl show | grep -A2 lsp1], [0], [dnl
 # remove transit switch and check if port_binding is deleted
 check ovn-ic-nbctl ts-del ts1
 wait_row_count ic-sb:Port_Binding 0 logical_port=lsp1
-
 for i in 1 2; do
     az=az$i
+    ovn_as $az
     OVN_CLEANUP_SBOX(gw-$az)
     OVN_CLEANUP_AZ([$az])
 done
@@ -213,6 +213,7 @@  ovn-ic-sbctl list route
 
 for i in 1 2; do
     az=az$i
+    ovn_as $az
     OVN_CLEANUP_SBOX(gw-$az)
     OVN_CLEANUP_AZ([$az])
 done
@@ -273,6 +274,7 @@  wait_row_count ic-sb:route 1 ip_prefix=1.1.1.1/32
 
 for i in 1 2; do
     az=az$i
+    ovn_as $az
     OVN_CLEANUP_SBOX(gw-$az)
     OVN_CLEANUP_AZ([$az])
 done
diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at
index a35c0ff80..269023ca8 100644
--- a/tests/ovn-macros.at
+++ b/tests/ovn-macros.at
@@ -10,23 +10,51 @@  m4_define([OVN_CLEANUP_VSWITCH],[
     OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 ])
 
-# OVN_CLEANUP_SBOX(sbox)
+# OVN_CLEANUP_CONTROLLER(sbox)
 #
-# Gracefully terminate OVN daemons in the specified
+# Gracefully terminate ovn-controller in the specified
 # sandbox instance. The sandbox name "vtep" is treated
 # as a special case, and is assumed to have ovn-controller-vtep
 # and ovs-vtep daemons running instead of ovn-controller.
-m4_define([OVN_CLEANUP_SBOX],[
-    echo
-    echo "$1: clean up sandbox"
-    as $1
-    if test "$1" = "vtep"; then
+m4_define([OVN_CLEANUP_CONTROLLER],[
+    hv=$1
+    sbox=$2
+
+    ovn-nbctl --wait=hv sync
+    as $sbox
+    if test "$hv" = "vtep"; then
         OVS_APP_EXIT_AND_WAIT([ovn-controller-vtep])
         OVS_APP_EXIT_AND_WAIT([ovs-vtep])
     else
         OVS_APP_EXIT_AND_WAIT([ovn-controller])
     fi
-    OVN_CLEANUP_VSWITCH([$1])
+])
+
+# OVN_CLEANUP_SBOX(sbox)
+#
+# Gracefully terminate OVN daemons in the specified
+# sandbox instance. The sandbox name "vtep" is treated
+# as a special case, and is assumed to have ovn-controller-vtep
+# and ovs-vtep daemons running instead of ovn-controller.
+m4_define([OVN_CLEANUP_SBOX],[
+    sbox=$1
+    error=$2
+    echo "$sbox: clean up sandbox"
+    OVN_CLEANUP_CONTROLLER([$sbox], [$sbox])
+    OVN_CLEANUP_VSWITCH([$sbox])
+
+    # Check for errors in logs. Ignore following errors:
+    # "connection failed (No such file or directory)" as happens everytime we restart ovs-vswitchd.
+    # "has no network name*" as localnet network_name is often set "after" creating localnet.
+    # "receive tunnel port not found*" happening when closing other hv.
+    # "Failed to locate tunnel to reach main chassis" happening when controller started e.g. before ovn-bridge-mappings is set
+    AT_CHECK([check_logs "
+        $error
+        /connection failed (No such file or directory)/d
+        /has no network name*/d
+        /receive tunnel port not found*/d
+        /Failed to locate tunnel to reach main chassis/d
+    " $sbox])
 ])
 
 # OVN_CLEANUP(sim [, sim ...])
@@ -34,8 +62,10 @@  m4_define([OVN_CLEANUP_SBOX],[
 # Gracefully terminate all OVN daemons, including those in the
 # specified sandbox instances.
 m4_define([OVN_CLEANUP],[
-    m4_foreach([sbox], [$@], [
-        OVN_CLEANUP_SBOX([sbox])
+    m4_foreach([sbox_and_error], [$@], [
+        sbox=$(echo "sbox_and_error" |sed -n '1p')
+        error=$(echo "sbox_and_error" | sed -n '2,$p')
+        OVN_CLEANUP_SBOX([$sbox], [$error])
     ])
 
     echo
diff --git a/tests/ovn.at b/tests/ovn.at
index 5eaaa76a2..4c10dadda 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -2416,6 +2416,7 @@  for i in 1 2; do
     OVN_CHECK_PACKETS_REMOVE_BROADCAST([vif$i-tx.pcap], [$i.expected])
 done
 
+OVN_CLEANUP([hv-1],[hv-2])
 AT_CLEANUP
 ])
 
@@ -3424,7 +3425,18 @@  for hv in 1 2; do
     OVN_CHECK_PACKETS_REMOVE_BROADCAST([hv-$hv/br-phys${hv}1_n-${hv}1-tx.pcap], [out-$hv.expected])
 done
 
-OVN_CLEANUP([hv-1],[hv-2])
+# ovn-controller started twice (through ovn_attach) for each hv => expect "already running" error.
+OVN_CLEANUP([hv-1
+/ovn-controller.pid: already running as pid/d
+/attempting to add tunnel port with same config as port 'ovn-hv-2-0'/d
+/br-int: could not add port ovn-hv-2-1 (File exists)/d
+/could not add network device ovn-hv-2-1 to ofproto/d
+],[hv-2
+/ovn-controller.pid: already running as pid/d
+/attempting to add tunnel port with same config as port 'ovn-hv-1-0'/d
+/br-int: could not add port ovn-hv-1-1 (File exists)/d
+/could not add network device ovn-hv-1-1 to ofproto/d
+])
 
 AT_CLEANUP
 ])
@@ -3563,7 +3575,19 @@  for hv in 1 2; do
     OVN_CHECK_PACKETS_CONTAIN([hv-$hv/br-phys${hv}1_n-${hv}1-tx.pcap], [out-$hv.expected])
 done
 
-OVN_CLEANUP([hv-1],[hv-2])
+# ovn-controller started twice (through ovn_attach) for each hv => expect "already running" error.
+OVN_CLEANUP([hv-1
+/ovn-controller.pid: already running as pid/d
+/attempting to add tunnel port with same config as port 'ovn-hv-2-0'/d
+/br-int: could not add port ovn-hv-2-1 (File exists)/d
+/could not add network device ovn-hv-2-1 to ofproto/d
+],[hv-2
+/ovn-controller.pid: already running as pid/d
+/attempting to add tunnel port with same config as port 'ovn-hv-1-0'/d
+/br-int: could not add port ovn-hv-1-1 (File exists)/d
+/could not add network device ovn-hv-1-1 to ofproto/d
+])
+
 
 AT_CLEANUP
 ])
@@ -3771,6 +3795,7 @@  for i in 1 2; do
     OVN_CHECK_PACKETS([vif$i-tx.pcap], [$i.expected])
 done
 
+OVN_CLEANUP([hv-1],[hv-2])
 AT_CLEANUP
 ])
 
@@ -3899,6 +3924,7 @@  for i in 1 2; do
     OVN_CHECK_PACKETS_REMOVE_BROADCAST([vif$i-tx.pcap], [$i.expected])
 done
 
+OVN_CLEANUP([hv-1],[hv-2])
 AT_CLEANUP
 ])
 
@@ -3986,6 +4012,7 @@  for i in 1 2; do
     OVN_CHECK_PACKETS_REMOVE_BROADCAST([tap$i-tx.pcap], [tap.expected])
 done
 
+OVN_CLEANUP([hv-1],[hv-2])
 AT_CLEANUP
 ])
 
@@ -4057,6 +4084,7 @@  for i in 1 2; do
     OVN_CHECK_PACKETS_REMOVE_BROADCAST([vif$i-tx.pcap], [$i.expected])
 done
 
+OVN_CLEANUP([hv-1],[hv-2])
 AT_CLEANUP
 ])
 
@@ -4809,6 +4837,10 @@  as hv3 ovs-ofctl -O OpenFlow13 dump-flows br-phys
 for i in 1 2 3; do
     OVN_CHECK_PACKETS([hv$i/vif$i-tx.pcap], [$i.expected])
 done
+as hv3
+OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
+OVN_CLEANUP([hv1],[hv2],[hv_gw
+/bridge not found for l2gateway port/d])
 AT_CLEANUP
 ])
 
@@ -6452,7 +6484,12 @@  OVN_CHECK_PACKETS_UNIQ([hv/snoopvif-tx.pcap], [expected])
 AT_CHECK([ovs-vsctl del-port localvif1])
 AT_CHECK([ovn-nbctl lsp-del ln_port])
 
-OVN_CLEANUP([hv])
+# Errors "Trying to release unknown interface localvif1" are unexpected and should be investigated
+# Probably due to the fact all ifaces deleted from ifstatus module when ofctrl_is_connected detects disconnect,
+# as a recompute does not recreate ifaces in ifstatus when port is already claimed and up
+OVN_CLEANUP([hv
+/Trying to release unknown interface localvif1/d
+])
 
 AT_CLEANUP
 ])
@@ -7338,7 +7375,6 @@  OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
-
 AT_CLEANUP
 ])
 
@@ -9067,7 +9103,9 @@  OVS_WAIT_UNTIL([
     test "${total_flows}" = "${total_flows_after_restart}"
 ])
 
-OVN_CLEANUP([hv1])
+OVN_CLEANUP([hv1
+/Connection refused/d
+])
 AT_CLEANUP
 ])
 
@@ -9513,8 +9551,8 @@  ovn-nbctl lr-add lr0
 ovn-nbctl lrp-add lr0 lrp0 f0:00:00:00:00:01 192.168.0.1/24
 ovn-nbctl lrp-add lr0 lrp1 f0:00:00:00:00:02 192.168.1.1/24
 dp_uuid=$(fetch_column Datapath_Binding _uuid)
-ovn-sbctl create MAC_Binding ip=10.0.0.1 datapath=$dp_uuid logical_port=lrp0 mac="mac1"
-ovn-sbctl create MAC_Binding ip=10.0.0.1 datapath=$dp_uuid logical_port=lrp1 mac="mac2"
+ovn-sbctl create MAC_Binding ip=10.0.0.1 datapath=$dp_uuid logical_port=lrp0 mac="00:00:00:01:00:01"
+ovn-sbctl create MAC_Binding ip=10.0.0.1 datapath=$dp_uuid logical_port=lrp1 mac="00:00:00:01:00:02"
 ovn-sbctl find MAC_Binding
 # Delete port lrp0 and check that its MAC_Binding is deleted.
 ovn-nbctl lrp-del lrp0
@@ -9525,7 +9563,10 @@  ovn-nbctl lr-del lr0
 ovn-sbctl find MAC_Binding
 wait_row_count MAC_Binding 0
 
-OVN_CLEANUP([hv1])
+# Ignore warning from mac_cache trying to remove mb while aging mechanism is disabled and lr0 is not local
+OVN_CLEANUP([hv1
+/parse MAC binding: ip=10.0.0.1/d
+])
 
 AT_CLEANUP
 ])
@@ -11738,7 +11779,9 @@  as gw2
 OVS_APP_EXIT_AND_WAIT([ovn-controller])
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
-OVN_CLEANUP([hv1],[gw1],[ext1])
+OVN_CLEANUP([hv1],[gw1
+/transaction error/d
+],[ext1])
 
 AT_CLEANUP
 ])
@@ -12302,7 +12345,12 @@  check ovn-nbctl --wait=sb lrp-del-gateway-chassis alice hv2
 
 check_row_count Port_Binding 0 logical_port=cr-alice
 
-OVN_CLEANUP([hv1],[hv2],[hv3])
+# Expect some potential transaction errors for MAC_Binding
+OVN_CLEANUP([hv1
+/transaction error/d
+],[hv2
+/transaction error/d
+],[hv3])
 
 AT_CLEANUP
 ])
@@ -12729,7 +12777,14 @@  sleep 2
 $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-ex_n2-tx.pcap > empty
 AT_CHECK([cat empty], [0], [])
 
-OVN_CLEANUP([hv1],[hv2],[hv3], [hv4])
+# Expect "Bridge not found" error as creating the bridge after creating the ovn mapping.
+OVN_CLEANUP([hv1
+/Bridge 'br-ex' not found for network 'public'/d
+],[hv2
+/Bridge 'br-ex' not found for network 'public'/d
+],[hv3],[hv4
+/Bridge 'br-ex' not found for network 'public'/d
+])
 AT_CLEANUP
 ])
 
@@ -14101,8 +14156,11 @@  OVN_CHECK_PACKETS_CONTAIN([hv3/br-phys_n1-tx.pcap], [expected_out], "trim_zeros"
 $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv2_br_phys_tx
 AT_CHECK([grep $garp hv2_br_phys_tx | sort], [0], [])
 
-OVN_CLEANUP([hv1],[hv2],[hv3])
-
+OVN_CLEANUP([hv1],[hv2
+/No tunnel endpoint found for HA chassis in HA chassis group/d
+],[hv3
+/No tunnel endpoint found for HA chassis in HA chassis group/d
+])
 AT_CLEANUP
 ])
 
@@ -14191,7 +14249,14 @@  wait_row_count Chassis 1 name=gw2
 gw1_chassis=$(fetch_column Chassis _uuid name=gw1)
 wait_row_count Port_Binding 1 logical_port=cr-outside chassis=$gw1_chassis
 
-OVN_CLEANUP([gw1],[gw2],[hv1])
+OVN_CLEANUP([gw1
+/Incorrect your_disc/d
+/No tunnel endpoint found for HA chassis in HA chassis group/d
+],[gw2
+/Incorrect your_disc/d
+],[hv1
+/Incorrect your_disc/d
+])
 
 AT_CLEANUP
 ])
@@ -14540,7 +14605,7 @@  $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv2/br-phys_n1-tx.pcap | \
 grep -v ffffffffffff | trim_zeros > 2.packets
 AT_CHECK([cat 2.packets], [0], [])
 
-OVN_CLEANUP([hv1])
+OVN_CLEANUP([hv1], [hv2])
 
 AT_CLEANUP
 ])
@@ -17355,7 +17420,10 @@  OVS_WAIT_UNTIL([ovs-vsctl list port ovn-mirror0 | grep ovn-mirror0])
 ovs-vsctl del-port ovn-mirror0 -- del-port vif1
 OVS_WAIT_UNTIL([test 0 = $(as hv1 ovs-vsctl list Mirror | wc -l)])
 
-OVN_CLEANUP([hv1], [hv2])
+# Expect mirror related erroras we delete ovn-mirror0
+OVN_CLEANUP([hv1
+/mirror mirror0 does not specify output/d
+], [hv2])
 AT_CLEANUP
 ])
 
@@ -20399,7 +20467,12 @@  for i in 1 2 3; do
 done
 
 # Gracefully terminate daemons
-OVN_CLEANUP([hv1])
+# Ignore errors "Syntax error at \`$as1\' expecting address set name".
+# Need  to investigate whteher those errors are expected
+OVN_CLEANUP([hv1
+/Syntax error at/d
+])
+
 AT_CLEANUP
 ])
 
@@ -21516,7 +21589,7 @@  ovn-hv3-0
 ovn-hv4-0
 ]])
 
-OVN_CLEANUP([hv1], [hv2], [hv3])
+OVN_CLEANUP([hv1], [hv2], [hv3], [hv4], [hv5])
 AT_CLEANUP
 ])
 
@@ -21723,7 +21796,11 @@  as hv2 ovs-appctl fdb/show br-phys
 
 OVN_CHECK_PACKETS([hv2/vif22-tx.pcap], [vif22.expected])
 
-OVN_CLEANUP([hv1],[hv2])
+OVN_CLEANUP([hv1
+/transaction error/d
+],[hv2
+/transaction error/d
+])
 
 AT_CLEANUP
 ])
@@ -23937,7 +24014,11 @@  OVS_WAIT_UNTIL(
                  'hv2/br-phys-1_n1-tx.pcap expected_empty' ],
   [$at_diff -F'^---' exp rcv])
 
-OVN_CLEANUP([hv1], [hv2])
+OVN_CLEANUP([hv1
+/left allocated/d
+], [hv2
+/left allocated/d
+])
 AT_CLEANUP
 ])
 
@@ -24227,7 +24308,14 @@  m4_define([DVR_N_S_ARP_HANDLING],
    as hv4 ovs-ofctl -O OpenFlow13 dump-flows br-int
    as hv4 ovs-appctl fdb/show br-phys
 
-   OVN_CLEANUP([hv1],[hv2],[hv3],[hv4])
+   # Expect some potential transaction errors for MAC_Binding
+   OVN_CLEANUP([hv1
+   /transaction error/d
+   ],[hv2
+   /transaction error/d
+   ],[hv3
+   /transaction error/d
+   ],[hv4])
 
    AT_CLEANUP])])
 
@@ -24531,7 +24619,13 @@  m4_define([DVR_N_S_PING],
    as hv4 ovs-ofctl show br-phys
    as hv4 ovs-appctl fdb/show br-phys
 
-   OVN_CLEANUP([hv1],[hv2],[hv3],[hv4])
+   OVN_CLEANUP([hv1
+   /transaction error/d
+   ],[hv2
+   /transaction error/d
+   ],[hv3
+   /transaction error/d
+   ],[hv4])
 
    AT_CLEANUP])])
 
@@ -25132,7 +25226,14 @@  as hv4 ovs-ofctl dump-flows br-int
 as hv4 ovs-ofctl show br-phys
 as hv4 ovs-appctl fdb/show br-phys
 
-OVN_CLEANUP([hv1],[hv2],[hv3],[hv4])
+# Expect some potential transaction errors for MAC_Binding
+OVN_CLEANUP([hv1
+/transaction error/d
+],[hv2
+/transaction error/d
+],[hv3
+/transaction error/d
+],[hv4])
 AT_CLEANUP
 ])
 
@@ -25648,6 +25749,7 @@  check_row_count Service_Monitor 0
 
 AT_CHECK([test 1 = `grep -c "SCTP load balancers do not currently support health checks" northd/ovn-northd.log`])
 
+OVN_CLEANUP([hv1],[hv2])
 AT_CLEANUP
 ])
 
@@ -26590,6 +26692,13 @@  OVS_WAIT_UNTIL(
                  'hv2/vif3-tx.pcap expected_az2_switched'],
   [$at_diff -F'^---' exp rcv])
 
+OVN_CLEANUP_SBOX([hv1],["/IGMP Querier enabled without a valid IPv4 or IPv6 address/d
+/IGMP Querier enabled with invalid ETH src address/d"])
+
+OVN_CLEANUP_SBOX([hv2],["/IGMP Querier enabled without a valid IPv4 or IPv6 address/d
+/IGMP Querier enabled with invalid ETH src address/d"])
+
+OVN_CLEANUP_IC([az1],[az2])
 AT_CLEANUP
 ])
 
@@ -26839,6 +26948,13 @@  OVS_WAIT_UNTIL(
                  'hv2/vif2-tx.pcap expected_az2'],
   [$at_diff -F'^---' exp rcv])
 
+OVN_CLEANUP_SBOX([hv1], ["/IGMP Querier enabled without a valid IPv4/d
+/IGMP Querier enabled with invalid ETH src/d"])
+
+OVN_CLEANUP_SBOX([hv2], ["/IGMP Querier enabled without a valid IPv4/d
+/IGMP Querier enabled with invalid ETH src/d"])
+
+OVN_CLEANUP_IC([az1],[az2])
 AT_CLEANUP
 ])
 
@@ -28122,7 +28238,11 @@  ovn_attach n1 br-phys 192.168.0.1
 # Port_Binding should be released.
 OVS_WAIT_UNTIL([test 0 = $(ovn-sbctl show | grep Port_Binding -c)])
 
-OVN_CLEANUP([hv1])
+# Port was not really bound/claimed, so it is expected to have some warnings trying to release it
+OVN_CLEANUP([hv1
+/Trying to release unknown interface lsp1/d
+])
+
 AT_CLEANUP
 ])
 
@@ -29389,7 +29509,12 @@  check ovn-nbctl --wait=hv sync
 AT_CHECK([test "$expr_cnt" = "$(get_cache_count cache-expr)"], [0], [])
 AT_CHECK([test "$matches_cnt" = "$(get_cache_count cache-matches)"], [0], [])
 
-OVN_CLEANUP([hv1])
+# Ignore errors "Syntax error at \`\@pg2\' expecting port group name"
+# Need  to investigate whteher those errors are expected
+OVN_CLEANUP([hv1
+/Syntax error at/d
+])
+
 AT_CLEANUP
 ])
 
@@ -30075,7 +30200,17 @@  OVS_WAIT_UNTIL([
 test_arp_response 000030303233 $(ip_to_hex 172 16 0 200) hv1 hv2 hv3
 test_arp_response 000030303233 $(ip_to_hex 172 16 0 201) hv1 hv2 hv3
 
-OVN_CLEANUP([hv1],[hv2],[hv3])
+OVN_CLEANUP([hv1
+/parse MAC binding/d
+/unknown logical port/d
+],[hv2
+/parse MAC binding/d
+/unknown logical port/d
+],[hv3
+/parse MAC binding/d
+/unknown logical port/d
+])
+
 AT_CLEANUP
 ])
 
@@ -33528,6 +33663,7 @@  test_ip vif11 f00000000010 06ac10010001 $sip $dip vif-north3
 # Confirm that South to North traffic works fine.
 OVN_CHECK_PACKETS_REMOVE_BROADCAST([hv5/vif-north3-tx.pcap], [vif-north3.expected])
 
+OVN_CLEANUP([hv1],[hv2],[hv3],[hv4],[hv5])
 AT_CLEANUP
 ])
 
@@ -33964,14 +34100,14 @@  check ovn-nbctl lsp-set-addresses lsp1 "f0:00:00:00:00:01 172.16.0.101"
 check ovn-nbctl lsp-set-options lsp1 \
     requested-chassis=hv1 \
     vif-plug-type=dummy \
-    vif-plug-mtu-request=42
+    vif-plug-mtu-request=420
 
 check ovn-nbctl lsp-add lsw0 lsp2
 check ovn-nbctl lsp-set-addresses lsp2 "f0:00:00:00:00:02 172.16.0.102"
 check ovn-nbctl lsp-set-options lsp2 \
     requested-chassis=hv2 \
     vif-plug-type=dummy \
-    vif-plug-mtu-request=42
+    vif-plug-mtu-request=420
 
 wait_for_ports_up lsp1 lsp2
 
@@ -33983,22 +34119,22 @@  iface2_uuid=$(as hv2 ovs-vsctl --bare --columns _uuid find Interface name=lsp2)
 
 # Check that the lport was plugged
 AT_CHECK([test xvalue = x$(as hv1 ovs-vsctl get Interface ${iface1_uuid} options:vif-plug-dummy-option)], [0], [])
-AT_CHECK([test x42 = x$(as hv1 ovs-vsctl get Interface ${iface1_uuid} mtu_request)], [0], [])
+AT_CHECK([test x420 = x$(as hv1 ovs-vsctl get Interface ${iface1_uuid} mtu_request)], [0], [])
 
 # Check that updating the lport updates the local iface
 check ovn-nbctl --wait=hv lsp-set-options lsp1 \
     requested-chassis=hv1 \
     vif-plug-type=dummy \
-    vif-plug-mtu-request=43
+    vif-plug-mtu-request=430
 OVS_WAIT_UNTIL([
-    test x43 = x$(as hv1 ovs-vsctl get Interface ${iface1_uuid} mtu_request)
+    test x430 = x$(as hv1 ovs-vsctl get Interface ${iface1_uuid} mtu_request)
 ])
 
 # Check that local modification of iface will trigger ovn-controller to update
 # the iface record
-check as hv1 ovs-vsctl set interface ${iface1_uuid} mtu_request=44
+check as hv1 ovs-vsctl set interface ${iface1_uuid} mtu_request=440
 OVS_WAIT_UNTIL([
-    test x43 = x$(as hv1 ovs-vsctl get Interface ${iface1_uuid} mtu_request)
+    test x430 = x$(as hv1 ovs-vsctl get Interface ${iface1_uuid} mtu_request)
 ])
 
 as hv1 check ovn-appctl -t ovn-controller debug/ignore-startup-delay
@@ -34061,7 +34197,9 @@  OVS_WAIT_UNTIL([
     grep -q "CMS requested plugging of lport lsp3" hv2/ovn-controller.log
 ])
 
-OVN_CLEANUP([hv1],[hv2])
+OVN_CLEANUP([hv1],[hv2
+/CMS requested plugging of lport lsp3/d
+])
 AT_CLEANUP
 ])
 
@@ -34136,7 +34274,10 @@  check ovn-nbctl meter-del meter2
 check ovn-nbctl --wait=hv sync
 AT_CHECK([as hv1 ovs-ofctl -OOpenFlow15 dump-meters br-int | grep -q rate=100], [1])
 
-OVN_CLEANUP([hv1])
+# Expect error on meter2 not found as meter added after using it.
+OVN_CLEANUP([hv1
+/could not find meter named \"meter2\"/d
+])
 AT_CLEANUP
 ])
 
@@ -35450,7 +35591,9 @@  m4_define([MULTIPLE_OVS_INT],
    flows_after_deletion=$(get_flows $COOKIE)
    check test "$flows_lpnew" = "$flows_after_deletion"
 
-   OVN_CLEANUP([hv1])
+   OVN_CLEANUP([hv1
+   /Invalid configuration: iface-id is configured on interface/d
+   ])
    AT_CLEANUP
    ])])
 
@@ -35719,7 +35862,12 @@  dnl Remove the mapping and expect OpenFlows to be removed.
 check ovn-nbctl --wait=hv clear Chassis_Template_Var hv1 variables
 AT_CHECK([ovs-ofctl dump-flows br-int | grep '42\.42\.42\.42'], [1], [])
 
-OVN_CLEANUP([hv1])
+# Ignore errors "Syntax error at `CONDITION' expecting field name" for now
+# Need  to investigate whteher those errors are expected
+OVN_CLEANUP([hv1
+/Syntax error at /d
+])
+
 AT_CLEANUP
 ])
 
@@ -35890,7 +36038,13 @@  AT_CHECK([ovs-ofctl dump-groups br-int | grep 'nat'], [1], [])
 as hv1
 AT_CHECK([ovs-ofctl dump-flows br-int | grep table=OFTABLE_CHK_LB_HAIRPIN | ofctl_strip_all], [0], [])
 
-OVN_CLEANUP([hv1])
+# Ignore errors such as "Syntax error at `BACKENDS31' expecting IP address"
+# Need  to investigate whteher those errors are expected
+OVN_CLEANUP([hv1
+/bad port number/d
+/Syntax error at/d
+])
+
 AT_CLEANUP
 ])
 
@@ -36422,7 +36576,20 @@  current_id=$(ovs-vsctl --bare --columns _uuid find port external_ids:ovn-chassis
 # The tunnel should be the same after restart
 check test "$current_id" = "$prev_id"
 
-OVN_CLEANUP([hv1],[hv2])
+# Expect "fail-mode changed" error as br-int1 not set to secure.
+OVN_CLEANUP([hv1
+/attempting to add tunnel port with same config/d
+/could not add port ovn-hv2-0/d
+/could not add network device ovn-hv2-0/d
+/Integration bridge fail-mode changed/d
+],
+[hv2
+/attempting to add tunnel port with same config/d
+/could not add port ovn-hv1-0/d
+/could not add network device ovn-hv1-0/d
+/Integration bridge fail-mode changed/d
+])
+
 AT_CLEANUP
 ])
 
@@ -36703,6 +36870,9 @@  OVS_WAIT_UNTIL([test $(as hv-1 ovs-vsctl list queue | grep -c 'min-rate="6000000
 OVS_WAIT_UNTIL([test $(as hv-1 ovs-vsctl list queue | grep -c 'max-rate="7000000000"') -eq 0])
 OVS_WAIT_UNTIL([test $(as hv-1 ovs-vsctl list queue | grep -c 'burst="8000000000"') -eq 0])
 
+# Ignore error due to public one added w/o network_name=phys
+OVN_CLEANUP([hv-1
+/Physical network not configured for datapath/d],[hv-2])
 AT_CLEANUP
 ])
 
@@ -36900,6 +37070,7 @@  packet=$(fmt_pkt "Ether(dst='50:54:00:00:00:88', src='00:00:20:20:12:13')/
 echo $packet > expected
 OVN_CHECK_PACKETS_REMOVE_BROADCAST([hv2/vif1-tx.pcap], [expected])
 
+OVN_CLEANUP([hv1],[hv2])
 AT_CLEANUP
 ])
 
@@ -36969,6 +37140,7 @@  wake_up_controller hv-1
 # Make sure ovn-controller is still OK
 ovn-nbctl --wait=hv sync
 OVS_WAIT_UNTIL([test $(as hv-1 ovs-vsctl list qos | grep -c linux-htb) -eq 1])
+OVN_CLEANUP([hv-1],[hv-2])
 AT_CLEANUP
 ])