diff mbox series

[ovs-dev,v7,2/5] tests: Prepare for multiple northd types.

Message ID 20201119051308.27913-3-blp@ovn.org
State New
Headers show
Series Add DDlog implementation of ovn-northd | expand

Commit Message

Ben Pfaff Nov. 19, 2020, 5:13 a.m. UTC
The idea is to run each test twice, once with ovn-northd, once
with ovn-northd-ddlog.  To do that, we add a macro OVN_FOR_EACH_NORTHD
and bracket each test that uses ovn-northd in it.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 tests/ovn-ic.at     |  11 +-
 tests/ovn-macros.at |  96 ++++++++++------
 tests/ovn-northd.at | 161 +++++++++++++++++---------
 tests/ovn.at        | 268 +++++++++++++++++++++++++++++++++++++++++---
 tests/ovs-macros.at |  20 ++--
 tests/system-ovn.at | 122 +++++++++++++++-----
 6 files changed, 537 insertions(+), 141 deletions(-)
diff mbox series

Patch

diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at
index 0638af401295..2a4fba031f36 100644
--- a/tests/ovn-ic.at
+++ b/tests/ovn-ic.at
@@ -1,4 +1,5 @@ 
 AT_BANNER([OVN Interconnection Controller])
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn-ic -- AZ register])
 
 ovn_init_ic_db
@@ -29,7 +30,9 @@  availability-zone az3
 OVN_CLEANUP_IC([az1], [az2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn-ic -- transit switch handling])
 
 ovn_init_ic_db
@@ -59,7 +62,9 @@  check_column ts2 nb:Logical_Switch name
 OVN_CLEANUP_IC([az1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn-ic -- gateway sync])
 
 ovn_init_ic_db
@@ -120,8 +125,9 @@  OVN_CLEANUP_SBOX(gw2)
 OVN_CLEANUP_IC([az1], [az2])
 
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn-ic -- port sync])
 
 ovn_init_ic_db
@@ -185,7 +191,9 @@  OVN_CLEANUP_SBOX(gw1)
 OVN_CLEANUP_IC([az1], [az2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn-ic -- route sync])
 
 ovn_init_ic_db
@@ -310,3 +318,4 @@  OVS_WAIT_WHILE([ovn_as az1 ovn-nbctl lr-route-list lr1 | grep learned | grep 10.
 OVN_CLEANUP_IC([az1], [az2])
 
 AT_CLEANUP
+])
diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at
index 59e500c5705a..44c0e20cfdc5 100644
--- a/tests/ovn-macros.at
+++ b/tests/ovn-macros.at
@@ -47,10 +47,12 @@  m4_define([OVN_CLEANUP],[
     OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
     as northd
-    OVS_APP_EXIT_AND_WAIT([ovn-northd])
+    OVS_APP_EXIT_AND_WAIT([[$NORTHD_TYPE]])
 
-    as northd-backup
-    OVS_APP_EXIT_AND_WAIT([ovn-northd])
+    if test -d northd-backup; then
+        as northd-backup
+        OVS_APP_EXIT_AND_WAIT([[$NORTHD_TYPE]])
+    fi
 
     OVN_CLEANUP_VSWITCH([main])
 ])
@@ -69,10 +71,12 @@  m4_define([OVN_CLEANUP_AZ],[
     OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
     as $1/northd
-    OVS_APP_EXIT_AND_WAIT([ovn-northd])
+    OVS_APP_EXIT_AND_WAIT([[$NORTHD_TYPE]])
 
-    as $1/northd-backup
-    OVS_APP_EXIT_AND_WAIT([ovn-northd])
+    if test -d $1/northd-backup; then
+        as $1/northd-backup
+        OVS_APP_EXIT_AND_WAIT([[$NORTHD_TYPE]])
+    fi
 
     as $1/ic
     OVS_APP_EXIT_AND_WAIT([ovn-ic])
@@ -134,15 +138,48 @@  ovn_init_ic_db () {
     ovn_init_db ovn-ic-sb
 }
 
-# ovn_start [AZ]
+# ovn_start_northd (primary|backup) [AZ]
+ovn_start_northd() {
+    local priority=$1
+    local AZ=$2
+    local msg_prefix=${AZ:+$AZ: }
+    local d_prefix=${AZ:+$AZ/}
+
+    local suffix=
+    case $priority in
+        backup) suffix=-backup ;;
+    esac
+
+    local northd_args=
+    case ${NORTHD_TYPE:=ovn-northd} in
+        ovn-northd) ;;
+        ovn-northd-ddlog) northd_args="--ddlog-record=${AZ:+$AZ/}replay$suffix.dat -v" ;;
+    esac
+
+    local name=${d_prefix}northd${suffix}
+    echo "${prefix}starting $name"
+    test -d "$ovs_base/$name" || mkdir "$ovs_base/$name"
+    as $name start_daemon $NORTHD_TYPE $northd_args -vjsonrpc \
+               --ovnnb-db=$OVN_NB_DB --ovnsb-db=$OVN_SB_DB
+}
+
+# ovn_start [--no-backup-northd] [AZ]
 #
 # Creates and initializes ovn-sb and ovn-nb databases and starts their
 # ovsdb-server instance, sets appropriate environment variables so that
 # ovn-sbctl and ovn-nbctl use them by default, and starts ovn-northd running
 # against them.
 ovn_start () {
-    if test -n "$1"; then
-        mkdir "$ovs_base"/$1
+    local backup_northd=:
+    case $1 in
+        --no-backup-northd) backup_northd=false; shift ;;
+    esac
+    local AZ=$1
+    local msg_prefix=${AZ:+$AZ: }
+    local d_prefix=${AZ:+$AZ/}
+
+    if test -n "$AZ"; then
+        mkdir "$ovs_base"/$AZ
     fi
 
     ovn_init_db ovn-sb $1; ovn-sbctl init
@@ -150,36 +187,19 @@  ovn_start () {
     if test -n "$1"; then
         ovn-nbctl set NB_Global . name=$1
     fi
-    local ovn_sb_db=$OVN_SB_DB
-    local ovn_nb_db=$OVN_NB_DB
 
-    local as_d=northd
-    if test -n "$1"; then
-        as_d=$1/$as_d
+    ovn_start_northd primary $AZ
+    if $backup_northd; then
+        ovn_start_northd backup $AZ
     fi
-    echo "starting ovn-northd"
-    mkdir "$ovs_base"/$as_d
-    as $as_d start_daemon ovn-northd -v \
-               --ovnnb-db=$ovn_nb_db \
-               --ovnsb-db=$ovn_sb_db
 
-    as_d=northd-backup
-    if test -n "$1"; then
-        as_d=$1/$as_d
-    fi
-    echo "starting backup ovn-northd"
-    mkdir "$ovs_base"/$as_d
-    as $as_d start_daemon ovn-northd -v \
-               --ovnnb-db=$ovn_nb_db \
-               --ovnsb-db=$ovn_sb_db
+    if test -n "$AZ"; then
+        ovn-nbctl --wait=sb sync || exit $?
 
-    if test -n "$1"; then
-        as_d=$1/ic
-        echo "starting ovn-ic"
-        mkdir "$ovs_base"/$as_d
-        as $as_d start_daemon ovn-ic -v \
-               --ovnnb-db=$ovn_nb_db \
-               --ovnsb-db=$ovn_sb_db \
+        echo "${msg_prefix}starting ovn-ic"
+        mkdir "$ovs_base"/$d_prefix/ic
+        as $d_prefix/ic start_daemon ovn-ic -v \
+               --ovnnb-db=$OVN_NB_DB --ovnsb-db=$OVN_SB_DB \
                --ic-nb-db=unix:"$ovs_base"/ovn-ic-nb/ovn-ic-nb.sock \
                --ic-sb-db=unix:"$ovs_base"/ovn-ic-sb/ovn-ic-sb.sock
     fi
@@ -420,3 +440,9 @@  wait_column() {
 OVS_END_SHELL_HELPERS
 
 m4_define([OVN_POPULATE_ARP], [AT_CHECK(ovn_populate_arp__, [0], [ignore])])
+
+m4_define([OVN_FOR_EACH_NORTHD], [dnl
+m4_pushdef([NORTHD_TYPE], [ovn-northd])dnl
+$1
+m4_popdef([NORTHD_TYPE])dnl
+])
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index 26376c367178..949a8eee054e 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -1,4 +1,6 @@ 
 AT_BANNER([OVN northd])
+
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check from NBDB to SBDB])
 ovn_start
 
@@ -65,7 +67,9 @@  check_row_count Gateway_Chassis 0
 check_row_count Ha_Chassis_Group 0
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check up state of VIF LSP])
 ovn_start
 
@@ -78,7 +82,9 @@  ovn-sbctl lsp-bind S1-vm1 hv1
 wait_row_count nb:Logical_Switch_Port 1 name=S1-vm1 'up=true'
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check up state of router LSP linked to a distributed LR])
 ovn_start
 
@@ -93,7 +99,9 @@  ovn-nbctl --wait=sb lsp-set-options S1-R1 router-port=R1-S1
 AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check up state of router LSP linked to a gateway LR])
 ovn_start
 
@@ -112,7 +120,9 @@  ovn-sbctl lsp-bind S1-R1 gw1
 AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check up state of router LSP linked to an LRP with set Gateway Chassis])
 ovn_start
 
@@ -130,7 +140,9 @@  ovn-nbctl --wait=sb lsp-set-options S1-R1 router-port=R1-S1
 AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check IPv6 RA config propagation to SBDB])
 ovn_start
 
@@ -240,14 +252,16 @@  AT_CHECK_UNQUOTED([ovn-sbctl get Port_Binding ${uuid} options:ipv6_ra_prefixes],
 ])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- test unixctl])
 ovn_init_db ovn-sb; ovn-sbctl init
 ovn_init_db ovn-nb; ovn-nbctl init
 
 # test unixctl option
 mkdir "$ovs_base"/northd
-as northd start_daemon ovn-northd --unixctl="$ovs_base"/northd/ovn-northd.ctl --ovnnb-db=unix:"$ovs_base"/ovn-nb/ovn-nb.sock --ovnsb-db=unix:"$ovs_base"/ovn-sb/ovn-sb.sock
+as northd start_daemon NORTHD_TYPE --unixctl="$ovs_base"/northd/NORTHD_TYPE[].ctl --ovnnb-db=unix:"$ovs_base"/ovn-nb/ovn-nb.sock --ovnsb-db=unix:"$ovs_base"/ovn-sb/ovn-sb.sock
 ovn-nbctl ls-add sw
 ovn-nbctl --wait=sb lsp-add sw p1
 # northd created with unixctl option successfully created port_binding entry
@@ -255,7 +269,7 @@  check_row_count Port_Binding 1 logical_port=p1
 AT_CHECK([ovn-nbctl --wait=sb lsp-del p1])
 
 # ovs-appctl exit with unixctl option
-OVS_APP_EXIT_AND_WAIT_BY_TARGET(["$ovs_base"/northd/ovn-northd.ctl], ["$ovs_base"/northd/ovn-northd.pid])
+OVS_APP_EXIT_AND_WAIT_BY_TARGET(["$ovs_base"/northd/]NORTHD_TYPE[.ctl], ["$ovs_base"/northd/]NORTHD_TYPE[.pid])
 
 # Check no port_binding entry for new port as ovn-northd is not running
 #
@@ -266,7 +280,7 @@  AT_CHECK([ovn-nbctl --timeout=10 --wait=sb sync], [142], [], [ignore])
 check_row_count Port_Binding 0 logical_port=p2
 
 # test default unixctl path
-as northd start_daemon ovn-northd --ovnnb-db=unix:"$ovs_base"/ovn-nb/ovn-nb.sock --ovnsb-db=unix:"$ovs_base"/ovn-sb/ovn-sb.sock
+as northd start_daemon NORTHD_TYPE --ovnnb-db=unix:"$ovs_base"/ovn-nb/ovn-nb.sock --ovnsb-db=unix:"$ovs_base"/ovn-sb/ovn-sb.sock
 ovn-nbctl --wait=sb lsp-add sw p3
 # northd created with default unixctl path successfully created port_binding entry
 check_row_count Port_Binding 1 logical_port=p3
@@ -276,10 +290,13 @@  OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 AT_CLEANUP
+])
+
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check HA_Chassis_Group propagation from NBDB to SBDB])
 ovn_start
 
@@ -617,71 +634,77 @@  OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ovn-northd pause and resume])
 ovn_start
 
-AT_CHECK([test xfalse = x`as northd ovn-appctl -t ovn-northd is-paused`])
-AT_CHECK([as northd ovn-appctl -t ovn-northd status], [0], [Status: active
-])
-AT_CHECK([test xfalse = x`as northd-backup ovn-appctl -t ovn-northd \
-is-paused`])
-AT_CHECK([as northd-backup ovn-appctl -t ovn-northd status], [0],
-[Status: standby
-])
+get_northd_status() {
+    as northd ovn-appctl -t NORTHD_TYPE is-paused
+    as northd ovn-appctl -t NORTHD_TYPE status
+    as northd-backup ovn-appctl -t NORTHD_TYPE is-paused
+    as northd-backup ovn-appctl -t NORTHD_TYPE status
+}
 
-ovn-nbctl ls-add sw0
+# Pause the backup, to force the main northd to become active (otherwise
+# there's no guarantee, ovn_start is racy).
+check as northd-backup ovs-appctl -t NORTHD_TYPE pause
+OVS_WAIT_FOR_OUTPUT([get_northd_status], [0], [false
+Status: active
+true
+Status: paused
+])
 
-OVS_WAIT_UNTIL([
-    ovn-sbctl lflow-list sw0
-    test 0 = $?])
+# Resume the backup.
+check as northd-backup ovs-appctl -t NORTHD_TYPE resume
+OVS_WAIT_FOR_OUTPUT([get_northd_status], [0], [false
+Status: active
+false
+Status: standby
+])
 
-ovn-nbctl ls-del sw0
-OVS_WAIT_UNTIL([
-    ovn-sbctl lflow-list sw0
-    test 1 = $?])
+# Check that ovn-northd is active, by verifying that it creates and
+# destroys southbound datapaths as one would expect.
+check_row_count Datapath_Binding 0
+check ovn-nbctl --wait=sb ls-add sw0
+check_row_count Datapath_Binding 1
+check ovn-nbctl --wait=sb ls-del sw0
+check_row_count Datapath_Binding 0
 
 # Now pause the ovn-northd
-as northd ovs-appctl -t ovn-northd pause
-as northd-backup ovs-appctl -t ovn-northd pause
-AT_CHECK([test xtrue = x`as northd ovn-appctl -t ovn-northd is-paused`])
-AT_CHECK([as northd ovn-appctl -t ovn-northd status], [0], [Status: paused
+check as northd ovs-appctl -t NORTHD_TYPE pause
+check as northd-backup ovs-appctl -t NORTHD_TYPE pause
+AT_CHECK([get_northd_status], [0], [true
+Status: paused
+true
+Status: paused
 ])
-AT_CHECK([test xtrue = x`as northd-backup ovn-appctl -t ovn-northd is-paused`])
-AT_CHECK([as northd-backup ovn-appctl -t ovn-northd status], [0],
-[Status: paused
-])
-
-ovn-nbctl ls-add sw0
 
-# There should be no logical flows for sw0 datapath.
-OVS_WAIT_UNTIL([
-    ovn-sbctl lflow-list sw0
-    test 1 = $?])
-
-# Now resume ovn-northd
-as northd ovs-appctl -t ovn-northd resume
-AT_CHECK([test xfalse = x`as northd ovn-appctl -t ovn-northd is-paused`])
-OVS_WAIT_UNTIL([as northd ovn-appctl -t ovn-northd status], [0],
-[Status: active
-])
+# Now ovn-northd won't respond by adding a datapath, because it's paused.
+check ovn-nbctl ls-add sw0
+sleep 5
+check_row_count Datapath_Binding 0
 
-as northd-backup ovs-appctl -t ovn-northd resume
-AT_CHECK([test xfalse = x`as northd-backup ovn-appctl -t ovn-northd \
-is-paused`])
-AT_CHECK([as northd-backup ovn-appctl -t ovn-northd status], [0],
-[Status: standby
+# Now resume ovn-northd!
+check as northd ovs-appctl -t NORTHD_TYPE resume
+check as northd-backup ovs-appctl -t NORTHD_TYPE resume
+OVS_WAIT_FOR_OUTPUT([get_northd_status], [0], [false
+Status: active
+false
+Status: standby
 ])
 
-OVS_WAIT_UNTIL([
-    ovn-sbctl lflow-list sw0
-    test 0 = $?])
+check ovn-nbctl --wait=sb sync
+check_row_count Datapath_Binding 1
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check Redirect Chassis propagation from NB to SB])
 ovn_start
 
@@ -704,7 +727,9 @@  wait_row_count Port_Binding 1 logical_port=cr-R1-S1 options:redirect-type=bridge
 ovn-nbctl lrp-set-redirect-type R1-S1 overlay
 wait_row_count Port_Binding 1 logical_port=cr-R1-S1 options:redirect-type=overlay
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check stateless dnat_and_snat rule])
 ovn_start
 
@@ -762,7 +787,9 @@  ovn-nbctl --wait=sb --stateless lr-nat-add R1 dnat_and_snat fd01::1 fd11::2
 check_flow_match_sets 2 0 0 0 0 2 2
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check portrange dnat, snat and dnat_and_snat rules])
 ovn_start
 
@@ -812,7 +839,9 @@  AT_CHECK([grep 'ct_[s]dnat.*172\.16\.1\.2.*3000' sbflows3], [1])
 ovn-nbctl lr-nat-del R1 dnat_and_snat  172.16.1.1
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check allowed/disallowed external dnat, snat and dnat_and_snat rules])
 ovn_start
 
@@ -1030,10 +1059,11 @@  AT_CHECK([ovn-sbctl dump-flows CR | grep lr_in_dnat | grep "ip4.dst == 172.16.1.
 ])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check Load balancer health check and Service Monitor sync])
-ovn_start
-
+ovn_start NORTHD_TYPE
 check ovn-nbctl lb-add lb1 10.0.0.10:80 10.0.0.3:80,20.0.0.3:80
 
 check ovn-nbctl --wait=sb set load_balancer . ip_port_mappings:10.0.0.3=sw0-p1
@@ -1234,7 +1264,9 @@  ovn-nbctl --wait=sb lb-del lb2
 wait_row_count Service_Monitor 0
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Load balancer VIP in NAT entries])
 AT_SKIP_IF([test $HAVE_PYTHON = no])
 ovn_start
@@ -1275,7 +1307,9 @@  AT_CHECK([test 0 = $(grep lr_in_unsnat sbflows | \
 grep "ip4 && ip4.dst == 192.168.2.6 && tcp && tcp.dst == 8080" -c) ])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- DNAT force snat IP])
 ovn_start
 
@@ -1294,7 +1328,9 @@  AT_CHECK([ovn-sbctl lflow-list lr0 | grep lr_in_unsnat], [0], [dnl
 ])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check reconcile stale Datapath_Binding])
 ovn_start
 
@@ -1320,7 +1356,9 @@  echo nb_uuid="$nb_uuid" lr_uuid="$lr_uuid"
 AT_CHECK([test "${nb_uuid}" = "${lr_uuid}"])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check reconcile stale tunnel keys])
 ovn_start
 
@@ -1342,7 +1380,9 @@  check_column 1 Port_Binding tunnel_key logical_port=lsp1
 check_column 2 Port_Binding tunnel_key logical_port=lsp2
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check reconcile stale Ha_Chassis_Group])
 ovn_start
 
@@ -1368,7 +1408,9 @@  AT_CHECK([ovn-nbctl --wait=sb sync], [0])
 check_row_count HA_Chassis_Group 0
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check NB/SB Port_Group translation (lsp add/del)])
 ovn_start
 
@@ -1416,7 +1458,9 @@  ovn-nbctl --wait=sb clear Port_Group pg_test ports
 AT_CHECK([test 0 = $(ovn-sbctl --columns _uuid list Port_Group | grep uuid -c)])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check NB/SB Port_Group translation (ls del)])
 ovn_start
 
@@ -1441,7 +1485,9 @@  wait_row_count Port_Group 1
 check_row_count Port_Group 1 name=${ls2_key}_pg_test
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- check router ARP/NS responder])
 ovn_start
 
@@ -1603,6 +1649,7 @@  action=(eth.dst = eth.src; eth.src = 00:00:00:00:00:02; arp.op = 2; /* ARP reply
 AT_CHECK([ovn-sbctl lflow-list | grep "xreg0\[[0..47\]]" | grep -vE 'lr_in_admission|lr_in_ip_input'], [1], [])
 
 AT_CLEANUP
+])
 
 # This test case tests that when a logical switch has load balancers associated
 # (with VIPs configured), the below logical flow is added by ovn-northd.
@@ -1616,6 +1663,7 @@  AT_CLEANUP
 # So make sure that the above lflow is added even if one load balancer has VIP
 # associated.
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Load balancer - missing ls_out_pre_lb flows])
 ovn_start
 
@@ -1676,7 +1724,9 @@  AT_CHECK([ovn-sbctl lflow-list | grep "ls_out_pre_lb.*priority=100" | grep reg0
 ])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ignore_lsp_down])
 ovn_start
 
@@ -1690,7 +1740,9 @@  ovn-nbctl --wait=sb set NB_Global . options:ignore_lsp_down=true
 AT_CHECK([ovn-sbctl lflow-list | grep arp | grep 10\.0\.0\.1], [0], [ignore])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn-northd -- reject ACL])
 ovn_start
 
@@ -1810,9 +1862,10 @@  action=(ct_commit { ct_label.blocked = 1; };  reg0 = 0; reject { /* eth.dst <->
 match=((reg0[[9]] == 1) && outport == @pg0 && ip6 && udp), dnl
 action=(reg0 = 0; reject { /* eth.dst <-> eth.src; ip.dst <-> ip.src; is implicit. */ outport <-> inport; next(pipeline=ingress,table=20); };)
 ])
-
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([datapath requested-tnl-key])
 AT_KEYWORDS([requested tnl tunnel key keys])
 ovn_start
@@ -1860,6 +1913,7 @@  AT_CHECK([test $ls2 = 3])
 AT_CLEANUP
 ])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([port requested-tnl-key])
 AT_KEYWORDS([requested tnl tunnel key keys])
 ovn_start
@@ -1915,3 +1969,4 @@  AT_CHECK(
 get_tunnel_keys
 AT_CHECK([test $lsp02 = 3 && test $ls1 = 123])
 AT_CLEANUP
+])
diff --git a/tests/ovn.at b/tests/ovn.at
index c0219bbd4791..2f295dd6ee98 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -1744,6 +1744,7 @@  AT_CLEANUP
 AT_BANNER([OVN end-to-end tests])
 
 # 3 hypervisors, one logical switch, 3 logical ports per hypervisor
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 3 HVs, 1 LS, 3 lports/HV])
 AT_KEYWORDS([ovnarp])
 ovn_start
@@ -2023,9 +2024,11 @@  done
 OVN_CLEANUP([hv1],[hv2],[hv3])
 
 AT_CLEANUP
+])
 
 # 2 hypervisors, one logical switch, 2 logical ports per hypervisor
 # logical ports bound to chassis encap-ip.
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 1 LS, 2 lports/HV])
 AT_KEYWORDS([ovnarp])
 ovn_start
@@ -2178,7 +2181,9 @@  done
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- trace 1 LS, 3 LSPs])
 ovn_start
 
@@ -2405,10 +2410,12 @@  for s in 1 2 3; do
 done
 
 AT_CLEANUP
+])
 
 # 2 hypervisors, 4 logical ports per HV
 # 2 locally attached networks (one flat, one vlan tagged over same device)
 # 2 ports per HV on each network
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 4 lports/HV, localnet ports])
 ovn_start
 
@@ -2601,7 +2608,9 @@  done
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 2 LS, routing works for multiple collocated segments attached to different switches])
 ovn_start
 
@@ -2730,7 +2739,9 @@  done
 OVN_CLEANUP([hv-1],[hv-2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 2 LS, broadcast traffic with multiple localnet ports per switch])
 ovn_start
 
@@ -2867,7 +2878,9 @@  done
 OVN_CLEANUP([hv-1],[hv-2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 2 LS, switching between multiple localnet ports with same tags])
 ovn_start
 
@@ -2991,7 +3004,9 @@  done
 OVN_CLEANUP([hv-1],[hv-2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- VLAN transparency, passthru=true])
 ovn_start
 
@@ -3038,7 +3053,9 @@  for i in 1 2; do
 done
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- VLAN transparency, passthru=false])
 ovn_start
 
@@ -3083,7 +3100,9 @@  for i in 1 2; do
 done
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 1 LS, no switching between multiple localnet ports with different tags])
 ovn_start
 
@@ -3197,7 +3216,9 @@  done
 OVN_CLEANUP([hv-10-1],[hv-10-2],[hv-20-1],[hv-20-2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- vtep: 3 HVs, 1 VIFs/HV, 1 GW, 1 LS])
 AT_KEYWORDS([vtep])
 ovn_start
@@ -3395,8 +3416,10 @@  OVN_CLEANUP([hv1],[hv2],[vtep])
 OVN_CLEANUP_VSWITCH([hv3])
 
 AT_CLEANUP
+])
 
 # Similar test to "hardware GW"
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 3 HVs, 1 VIFs/HV, 1 software GW, 1 LS])
 ovn_start
 
@@ -3543,8 +3566,10 @@  for i in 1 2 3; do
     OVN_CHECK_PACKETS([hv$i/vif$i-tx.pcap], [$i.expected])
 done
 AT_CLEANUP
+])
 
 # 3 hypervisors, 3 logical switches with 3 logical ports each, 1 logical router
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 3 HVs, 3 LS, 3 lports/LS, 1 LR])
 ovn_start
 
@@ -3968,7 +3993,9 @@  OVS_WAIT_UNTIL([check_packets], [$at_diff -F'^---' expected received])
 OVN_CLEANUP([hv1], [hv2], [hv3])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- IP relocation using GARP request])
 ovn_start
 
@@ -4181,8 +4208,10 @@  done
 OVN_CLEANUP([hv1], [hv2])
 
 AT_CLEANUP
+])
 
 # 3 hypervisors, one logical switch, 3 logical ports per hypervisor
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- portsecurity : 3 HVs, 1 LS, 3 lports/HV])
 ovn_start
 
@@ -4577,7 +4606,9 @@  done
 OVN_CLEANUP([hv1],[hv2],[hv3])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 2 LS, 1 lport/LS, 2 peer LRs])
 ovn_start
 
@@ -4721,8 +4752,9 @@  OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected])
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 1 HV, 1 LS, 2 lport/LS, 1 LR])
 AT_KEYWORDS([router-admin-state])
 ovn_start
@@ -4829,8 +4861,9 @@  OVN_CHECK_PACKETS([hv1/vif2-tx.pcap], [expected])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 1 HV, 2 LSs, 1 lport/LS, 1 LR])
 AT_KEYWORDS([router-admin-state])
 ovn_start
@@ -4942,7 +4975,9 @@  OVN_CHECK_PACKETS([hv1/vif2-tx.pcap], [expected])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 3 LS, 1 lport/LS, 2 peer LRs, static routes])
 ovn_start
 
@@ -5090,7 +5125,9 @@  OVN_CHECK_PACKETS([hv1/vif2-tx.pcap], [expected])
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- send gratuitous arp on localnet])
 ovn_start
 ovn-nbctl ls-add lsw0
@@ -5143,7 +5180,9 @@  AT_CHECK([ovn-nbctl lsp-del ln_port])
 OVN_CLEANUP([hv])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 3 LRs connected via LS, static routes])
 ovn_start
 
@@ -5315,7 +5354,9 @@  OVN_CHECK_PACKETS([hv1/vif2-tx.pcap], [expected])
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- dhcpv4 : 1 HV, 2 LS, 2 LSPs/LS])
 ovn_start
 
@@ -5972,7 +6013,9 @@  compare_dhcp_packets 1
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- dhcpv6 : 1 HV, 2 LS, 5 LSPs])
 ovn_start
 
@@ -6243,7 +6286,9 @@  AT_CHECK([cat 5.packets | cut -c 1-120,125- ], [0], [expout])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 2 LRs connected via LS, gateway router])
 ovn_start
 
@@ -6414,7 +6459,9 @@  OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected])
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- icmp_reply: 1 HVs, 2 LSs, 1 lport/LS, 1 LR])
 AT_KEYWORDS([router-icmp-reply])
 ovn_start
@@ -6556,7 +6603,9 @@  done
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- policy-based routing: 1 HVs, 2 LSs, 1 lport/LS, 1 LR])
 AT_KEYWORDS([policy-based-routing])
 ovn_start
@@ -6744,7 +6793,9 @@  OVN_CHECK_PACKETS([pbr-hv/vif3-tx.pcap], [3.expected])
 
 OVN_CLEANUP([pbr-hv])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- policy-based routing IPv6: 1 HVs, 3 LSs, 1 lport/LS, 1 LR])
 AT_KEYWORDS([policy-based-routing])
 ovn_start
@@ -6934,7 +6985,9 @@  OVN_CHECK_PACKETS([pbr-hv/vif3-tx.pcap], [3.expected])
 
 OVN_CLEANUP([pbr-hv])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 # 1 hypervisor, 1 port
 # make sure that the port state is properly set to up and back down
 # when created and deleted.
@@ -6959,7 +7012,9 @@  OVS_WAIT_UNTIL([test x`ovn-nbctl lsp-get-up lp1` = xdown])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 # 1 hypervisor, 1 port
 # make sure that the OF rules created to support a datapath are added/cleared
 # when logical switch is created and removed.
@@ -7026,7 +7081,9 @@  test_datapath_in_of_rules 0 "after lport+ls removal"
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- nd_na ])
 ovn_start
 
@@ -7097,7 +7154,9 @@  done
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- address sets modification/removal smoke test])
 ovn_start
 
@@ -7124,7 +7183,9 @@  AT_CHECK([ovs-appctl -t ovn-controller version], [0], [ignore])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ipam])
 ovn_start
 
@@ -7431,13 +7492,11 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
-
-as northd-backup
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
-
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ipam connectivity])
 ovn_start
 
@@ -7561,7 +7620,9 @@  AT_CHECK([cat received2.packets], [0], [expout])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ovs-vswitchd restart])
 AT_KEYWORDS([vswitchd])
 ovn_start
@@ -7655,7 +7716,9 @@  OVS_WAIT_UNTIL([
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- send arp for nexthop])
 ovn_start
 
@@ -7760,7 +7823,9 @@  cat packets
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- send gratuitous arp for nat ips in localnet])
 ovn_start
 # Create logical switch
@@ -7813,7 +7878,9 @@  fffffffffffff0000000000108060001080006040001f00000000001c0a80002000000000000c0a8
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- send gratuitous arp with nat-addresses router in localnet])
 ovn_start
 # Create logical switch
@@ -7879,7 +7946,9 @@  AT_CHECK([sort packets], [0], [expout])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- delete mac bindings])
 ovn_start
 net_add n1
@@ -7910,7 +7979,9 @@  wait_row_count MAC_Binding 0
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- conntrack zone allocation])
 ovn_start
 
@@ -7963,7 +8034,9 @@  OVS_WAIT_UNTIL([test `ovs-ofctl dump-flows br-int table=0 | grep REG13 | wc -l`
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- tag allocation])
 ovn_start
 
@@ -8029,8 +8102,8 @@  check test "$c6_tag" != "$c3_tag"
 
 AS_BOX([restart northd and make sure tag allocation is stable]) 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
-start_daemon ovn-northd \
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
+start_daemon NORTHD_TYPE \
     --ovnnb-db=unix:"$ovs_base"/ovn-nb/ovn-nb.sock \
     --ovnsb-db=unix:"$ovs_base"/ovn-sb/ovn-sb.sock
 
@@ -8079,7 +8152,9 @@  AT_CHECK([ovn-nbctl lsp-get-tag local1], [0], [50
 ])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- lsp deletion and broadcast-flow deletion on localnet])
 ovn_start
 ovn-nbctl ls-add lsw0
@@ -8148,8 +8223,9 @@  OVS_WAIT_UNTIL([test `ovs-vsctl show | grep "Port patch-br-int-to-ln_port" | wc
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ACL logging])
 AT_KEYWORDS([ovn])
 ovn_start
@@ -8254,8 +8330,9 @@  name="reject-flow", verdict=reject, severity=alert: tcp,vlan_tci=0x0000,dl_src=f
 
 OVN_CLEANUP([hv])
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ACL rate-limited logging])
 AT_KEYWORDS([ovn])
 ovn_start
@@ -8344,8 +8421,9 @@  AT_CHECK([ test $n_acl1 -gt $n_acl2 ], [0], [])
 
 OVN_CLEANUP([hv])
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- same meter used by multiple logical flows])
 AT_KEYWORDS([ovn])
 ovn_start
@@ -8399,8 +8477,9 @@  AT_CHECK([ovs-ofctl -O OpenFlow13 dump-meters br-int | grep meter], [1])
 
 OVN_CLEANUP([hv])
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- DSCP marking and meter check])
 AT_KEYWORDS([ovn])
 ovn_start
@@ -8534,6 +8613,7 @@  AT_CHECK([as hv ovs-ofctl dump-meters br-int -O OpenFlow13 | grep meter | wc -l]
 
 OVN_CLEANUP([hv])
 AT_CLEANUP
+])
 
 AT_SETUP([ovn -- read-only sb db:ptcp access])
 
@@ -8728,6 +8808,7 @@  AT_CHECK([ovn-sbctl --db=ssl:127.0.0.1:$TCP_PORT \
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 AT_CLEANUP
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- nested containers])
 ovn_start
 
@@ -8994,7 +9075,9 @@  OVS_WAIT_UNTIL([test xdown = x$(ovn-nbctl lsp-get-up bar1)])
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 3 HVs, 3 LRs connected via LS, source IP based routes])
 ovn_start
 
@@ -9191,7 +9274,9 @@  OVN_CHECK_PACKETS([hv3/vif1-tx.pcap], [expected])
 OVN_CLEANUP([hv1],[hv2],[hv3])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- dns lookup : 1 HV, 2 LS, 2 LSPs/LS])
 ovn_start
 
@@ -9629,7 +9714,9 @@  rm -f 2.expected
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 4 HV, 1 LS, 1 LR, packet test with HA distributed router gateway port])
 ovn_start
 
@@ -9878,7 +9965,9 @@  OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 OVN_CLEANUP([hv1],[gw1],[ext1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 4 HV, 3 LS, 2 LR, packet test with HA distributed router gateway port])
 ovn_start
 
@@ -10091,7 +10180,9 @@  test_ip_packet gw2 gw1
 
 OVN_CLEANUP([hv1],[gw1],[gw2],[ext1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 1 LR with distributed router gateway port])
 ovn_start
 
@@ -10427,7 +10518,9 @@  check_row_count Port_Binding 0 logical_port=cr-alice
 OVN_CLEANUP([hv1],[hv2],[hv3])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- send gratuitous arp for NAT rules on distributed router])
 ovn_start
 # Create logical switches
@@ -10565,10 +10658,12 @@  AT_CHECK([cat exp], [0], [expout])
 OVN_CLEANUP([hv1],[hv2],[hv3])
 
 AT_CLEANUP
+])
 
 # VLAN traffic for external network redirected through distributed router
 # gateway port should use vlans(i.e input network vlan tag) across hypervisors
 # instead of tunneling.
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- vlan traffic for external network with distributed router gateway port])
 ovn_start
 
@@ -10878,7 +10973,9 @@  AT_CHECK([cat empty], [0], [])
 
 OVN_CLEANUP([hv1],[hv2],[hv3], [hv4])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- IPv6 ND Router Solicitation responder])
 AT_KEYWORDS([ovn-nd_ra])
 ovn_start
@@ -11132,7 +11229,9 @@  AT_CHECK([cat 1.packets], [0], [])
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- /32 router IP address])
 ovn_start
 
@@ -11225,7 +11324,9 @@  OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected])
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 1 lport/HV, localport ports])
 ovn_start
 
@@ -11346,7 +11447,9 @@  done
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 1 LR with HA distributed router gateway port])
 ovn_start
 
@@ -11851,7 +11954,9 @@  wait_row_count Port_Binding 1 logical_port=cr-outside chassis=$gw1_chassis
 OVN_CLEANUP([gw1],[gw2],[hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- send gratuitous ARP for NAT rules on HA distributed router])
 ovn_start
 ovn-nbctl ls-add ls0
@@ -12038,7 +12143,9 @@  AT_CHECK([grep $garp hv2_br_phys_tx | sort], [0], [])
 OVN_CLEANUP([hv1],[hv2],[hv3])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ensure one gw controller restart in HA doesn't bounce the master])
 ovn_start
 
@@ -12125,7 +12232,9 @@  wait_row_count Port_Binding 1 logical_port=cr-outside chassis=$gw1_chassis
 OVN_CLEANUP([gw1],[gw2],[hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- IPv6 Neighbor Solicitation for unknown MAC])
 AT_KEYWORDS([ovn-nd_ns for unknown mac])
 ovn_start
@@ -12352,7 +12461,9 @@  AT_CHECK([cat 2.packets], [0], [])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- options:requested-chassis for logical port])
 ovn_start
 
@@ -12431,7 +12542,9 @@  AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=65 | grep output], [1], [])
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- options:requested-chassis with hostname])
 
 ovn_start
@@ -12469,7 +12582,9 @@  AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=65 | grep output], [1], [])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- IPv6 periodic RA])
 ovn_start
 
@@ -12657,7 +12772,9 @@  ra_test 000005dc 48 $dns_addr $dnssl $route_info c0 40 aef0000000000000000000000
 
 OVN_CLEANUP([hv1],[hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ACL reject rule test])
 AT_KEYWORDS([acl-reject])
 ovn_start
@@ -12797,7 +12914,9 @@  done
 
 OVN_CLEANUP([hv1], [hv2], [hv3])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Port Groups])
 AT_KEYWORDS([ovnpg])
 ovn_start
@@ -13019,7 +13138,9 @@  done
 # Gracefully terminate daemons
 OVN_CLEANUP([hv1], [hv2], [hv3])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ACLs on Port Groups])
 AT_KEYWORDS([ovnpg_acl])
 ovn_start
@@ -13268,7 +13389,9 @@  done
 # Gracefully terminate daemons
 OVN_CLEANUP([hv1], [hv2], [hv3])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Address Set generation from Port Groups (static addressing)])
 ovn_start
 
@@ -13306,7 +13429,9 @@  check_column '10.0.0.11 10.0.0.2' Address_Set addresses name=pg1_ip4
 check_column '2001:db8::11 2001:db8::2' Address_Set addresses name=pg1_ip6
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Address Set generation from Port Groups (dynamic addressing)])
 ovn_start
 
@@ -13370,7 +13495,9 @@  AT_CHECK(
 ])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ACL conjunction])
 ovn_start
 
@@ -13581,7 +13708,9 @@  grep conjunction.*conjunction.*conjunction | wc -l`])
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Superseding ACLs with conjunction])
 ovn_start
 
@@ -13795,8 +13924,10 @@  priority=1003,ip,metadata=0x1,nw_src=10.0.0.42 actions=conjunction()
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
 # 3 hypervisors, one logical switch, 3 logical ports per hypervisor
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- L2 Drop and Allow ACL w/ Stateful ACL])
 ovn_start
 
@@ -14000,7 +14131,9 @@  OVS_WAIT_UNTIL([check_packets], [$at_diff -F'^---' expected received])
 OVN_CLEANUP([hv1],[hv2],[hv3])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- TTL exceeded])
 AT_KEYWORDS([ttl-exceeded])
 ovn_start
@@ -14092,7 +14225,9 @@  OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [vif1.expected])
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- router port unreachable])
 AT_KEYWORDS([router-port-unreachable])
 ovn_start
@@ -14239,7 +14374,9 @@  OVN_CHECK_PACKETS([hv2/vif2-tx.pcap], [vif2.expected])
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ovn-controller exit])
 ovn_start
 # Logical network:
@@ -14329,7 +14466,9 @@  as hv2 start_daemon ovn-controller
 
 OVN_CLEANUP([hv1],[hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- external logical port])
 ovn_start
 
@@ -15078,7 +15217,9 @@  OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 OVN_CLEANUP([hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Address Set Incremental Processing])
 AT_KEYWORDS([ovn_as_inc])
 ovn_start
@@ -15156,7 +15297,9 @@  done
 # Gracefully terminate daemons
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ovn-controller restart])
 ovn_start
 
@@ -15248,10 +15391,10 @@  OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected2])
 as hv2 start_daemon ovn-controller
 
 OVN_CLEANUP([hv1],[hv2])
-
-
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ovn-nbctl duplicate addresses])
 ovn_start
 
@@ -15307,7 +15450,9 @@  AT_CHECK([ovn-nbctl lsp-set-addresses sw2-p1 "00:00:00:00:00:04 192.168.0.3"])
 AT_CHECK([ovn-nbctl lsp-set-addresses sw2-p1 "00:00:00:00:00:04 aef0::1"])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- router - check packet length - icmp defrag])
 AT_KEYWORDS([check packet length])
 ovn_start
@@ -15543,7 +15688,9 @@  done
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- IP packet buffering])
 AT_KEYWORDS([ip-buffering])
 ovn_start
@@ -15721,7 +15868,9 @@  OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected])
 
 OVN_CLEANUP([hv1],[hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- neighbor update on same HV])
 ovn_start
 
@@ -15824,7 +15973,9 @@  fffffffffffff0000000010108060001080006040001f00000000101ac1804dd000000000000ac18
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ipam to non-ipam])
 ovn_start
 
@@ -15844,7 +15995,9 @@  ovn-nbctl get Logical-Switch-Port p0 dynamic_addresses
 AT_CHECK([ovn-nbctl get Logical-Switch-Port p0 dynamic_addresses], [0], [[[]]
 ])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ipam router ports])
 ovn_start
 
@@ -15865,7 +16018,9 @@  ovn-nbctl list logical_switch_port
 ovn-nbctl list logical_router_port
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- test transport zones])
 ovn_start
 
@@ -16025,7 +16180,9 @@  ovn-hv4-0
 
 OVN_CLEANUP([hv1], [hv2], [hv3])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 HVs, 2 lports/HV, localnet ports, DVR chassis mac])
 ovn_start
 
@@ -16226,7 +16383,9 @@  OVN_CHECK_PACKETS([hv2/vif22-tx.pcap], [vif22.expected])
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- virtual ports])
 AT_KEYWORDS([virtual ports])
 ovn_start
@@ -16566,7 +16725,9 @@  AT_CHECK([grep lr_in_arp_resolve lr0-flows8 | grep "reg0 == 10.0.0.10"], [1])
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 # Run ovn-nbctl in daemon mode, change to a backup database and verify that
 # an insert operation is not allowed.
 AT_SETUP([ovn -- can't write to a backup database server instance])
@@ -16587,7 +16748,9 @@  AT_CHECK([ovn-nbctl ls-add sw1], [1], [ignore],
 ])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- controller event])
 AT_KEYWORDS([ovn_controller_event])
 ovn_start
@@ -16724,7 +16887,9 @@  AT_CHECK_UNQUOTED([ovn-sbctl get controller_event $uuid event_info:load_balancer
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- IGMP snoop/querier/relay])
 ovn_start
 
@@ -17388,7 +17553,9 @@  wait_row_count IGMP_Group 1 address=239.0.1.42
 
 OVN_CLEANUP([hv1], [hv2], [hv3])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- MLD snoop/querier/relay])
 ovn_start
 
@@ -18091,7 +18258,9 @@  OVS_WAIT_UNTIL(
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- unixctl socket])
 ovn_start
 
@@ -18110,7 +18279,7 @@  on_exit 'kill $(cat ovn-nbctl.pid)'
 AT_CHECK([ovn-nbctl -u $sockfile show])
 
 AT_CLEANUP
-
+])
 
 m4_define([DVR_N_S_ARP_HANDLING],
   [OVN_FOR_EACH_NORTHD([
@@ -18683,6 +18852,7 @@  m4_define([DVR_N_S_PING],
 DVR_N_S_PING([geneve])
 DVR_N_S_PING([vxlan])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ARP lookup before learning])
 AT_KEYWORDS([virtual ports])
 ovn_start
@@ -18899,7 +19069,9 @@  AT_CHECK([test 4 = `cat hv1/ovn-controller.log | grep NXT_PACKET_IN2 | wc -l`])
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 1 HVs, 1 lport/HV, localnet ports, RARP])
 ovn_start
 
@@ -18961,7 +19133,9 @@  grep 101 | wc -l`])
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Stateless Floating IP])
 ovn_start
 
@@ -19259,7 +19433,9 @@  as hv4 ovs-appctl fdb/show br-phys
 
 OVN_CLEANUP([hv1],[hv2],[hv3],[hv4])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Load balancer health checks])
 AT_KEYWORDS([lb])
 ovn_start
@@ -19452,7 +19628,9 @@  wait_row_count Service_Monitor 0 status=online
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- SCTP Load balancer health checks])
 AT_KEYWORDS([lb sctp])
 
@@ -19564,10 +19742,12 @@  check_row_count Service_Monitor 0
 # Let's also be sure the warning message about SCTP load balancers is
 # is in the ovn-northd log
 
-AT_CHECK([test 1 = `grep -c "SCTP load balancers do not currently support health checks" northd/ovn-northd.log`])
+AT_CHECK([test 1 = `grep -c "SCTP load balancers do not currently support health checks" northd/NORTHD_TYPE.log`])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ARP/ND request broadcast limiting])
 ovn_start
 
@@ -20031,7 +20211,9 @@  OVS_WAIT_UNTIL([
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- trace when flow cookie updated])
 AT_KEYWORDS([cookie])
 ovn_start
@@ -20066,7 +20248,9 @@  AT_CHECK([ovn-trace --ovs lsw0 'inport == "lp1" && eth.type == 0x1234' | grep "d
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- interconnection])
 ovn_init_ic_db
 n_az=5
@@ -20249,8 +20433,9 @@  done
 OVN_CLEANUP_IC
 
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ECMP static routes])
 ovn_start
 
@@ -20353,7 +20538,9 @@  done
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- forwarding group: 3 HVs, 1 LR, 2 LS])
 AT_KEYWORDS([forwarding-group])
 ovn_start
@@ -20473,7 +20660,9 @@  AT_CHECK([as hv1 ovs-ofctl -O OpenFlow13 dump-groups br-int | \
 
 OVN_CLEANUP([hv1], [hv2], [hv3])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Load Balancer LS hairpin])
 ovn_start
 
@@ -20631,7 +20820,9 @@  OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [expected])
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Big Load Balancer])
 ovn_start
 
@@ -20660,7 +20851,9 @@  AT_CHECK([test 2287 = `ovs-ofctl dump-group-stats br-int | grep -o bucket | wc -
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Bind existing VIF])
 net_add n1
 sim_add hv1
@@ -20692,7 +20885,9 @@  OVS_WAIT_UNTIL([as hv1 ovs-ofctl dump-flows br-int | grep -E "table=8.*metadata=
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Release stale port binding])
 net_add n1
 sim_add hv1
@@ -20716,7 +20911,9 @@  OVS_WAIT_UNTIL([test 0 = $(ovn-sbctl show | grep Port_Binding -c)], [0])
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Logical router policy packet marking])
 ovn_start
 
@@ -21018,7 +21215,9 @@  match=(ip6), action=(next;)
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- normalized lrp-add])
 ovn_start
 
@@ -21027,7 +21226,9 @@  ovn-nbctl lrp-add r1 rp1 CC:DD:EE:EE:DD:CC AEF0::1/64 BEF0::1/64
 
 AT_CHECK([ovn-nbctl --may-exist lrp-add r1 rp1 cc:dd:ee:ee:dd:cc bef0:0000:0000:0000::1/64 aef0::1/64])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- normalized lr-nat-add])
 ovn_start
 
@@ -21038,7 +21239,9 @@  ovn-nbctl lr-nat-add r1 dnat AEF0::1 BEEF::1
 AT_CHECK([ovn-nbctl --may-exist lr-nat-add r1 snat aef0:0000::1 beef:0000::/ffff:ffff:ffff:ffff::0])
 AT_CHECK([ovn-nbctl --may-exist lr-nat-add r1 dnat aef0:0000:00::1 beef::0001])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- normalized lr-nat-del])
 ovn_start
 
@@ -21049,7 +21252,9 @@  ovn-nbctl lr-nat-add r1 dnat AEF0::1 BEEF::1
 AT_CHECK([ovn-nbctl --if-exists lr-nat-del r1 snat beef:0000::0/ffff:ffff:ffff:ffff::0])
 AT_CHECK([ovn-nbctl --if-exists lr-nat-del r1 dnat aef0:0000:00::1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Load balancer selection fields])
 AT_KEYWORDS([lb])
 ovn_start
@@ -21200,7 +21405,9 @@  OVS_WAIT_UNTIL([
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- controller I-P handling with monitoring disabled])
 ovn_start
 
@@ -21308,7 +21515,9 @@  AT_CHECK([test "$hv2_offlows" = "$hv2_offlows_mon"])
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- controller I-P handling when lrp added last])
 
 ovn_start
@@ -21384,7 +21593,9 @@  OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [hv1-vif1.expected])
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 # When a lport is released on a chassis, ovn-controller was
 # not clearing some of the flowss in the table 33.
 # Make sure that those flows are cleared properly.
@@ -21487,7 +21698,9 @@  AT_CHECK([test ! -z $p1_zoneid])
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Symmetric ECMP reply flows])
 ovn_start
 
@@ -21610,7 +21823,9 @@  AT_CHECK([
 
 OVN_CLEANUP([hv1], [hv2])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 # Test option:dynamic_neigh_routers. No static neighbor flows when enabled, and
 # traffic should still work, with the help of dynamic mac_bindings.
 AT_SETUP([ovn -- Dynamic neighbor between LRs])
@@ -21718,7 +21933,9 @@  AT_CHECK([ovn-sbctl find mac ip=10.0.0.2 mac='"00:00:00:00:03:02"' logical_port=
 OVN_CLEANUP([hv1],[hv2])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- lflow cache for conjunctions])
 ovn_start
 net_add n1
@@ -21853,7 +22070,9 @@  AT_CHECK([test 1 = $(as hv1 ovs-ofctl dump-flows br-int table=45 | grep -c "conj
 OVN_CLEANUP([hv1])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Delete Port_Binding and OVS port Incremental Processing])
 ovn_start
 
@@ -21891,8 +22110,10 @@  OVS_WAIT_UNTIL([test x$(as hv1 ovn-appctl -t ovn-controller debug/status) = "xru
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
 # Test dropping traffic destined to router owned IPs.
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- gateway router drop traffic for own IPs])
 ovn_start
 
@@ -21975,7 +22196,9 @@  AT_CHECK([as hv1 ovs-ofctl dump-flows br-int | grep -E "table=21, n_packets=1,.*
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- nb_cfg timestamp])
 ovn_start
 
@@ -22071,7 +22294,9 @@  for i in $(seq 2 $n); do
 done
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ARP replies for SNAT external ips])
 ovn_start
 
@@ -22327,7 +22552,9 @@  test_arp_response 000030303233 $(ip_to_hex 172 16 0 201) hv1 hv2 hv3
 
 OVN_CLEANUP([hv1],[hv2],[hv3])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 # Duplicate ACLs (same match with same action) should work as expected.
 # Conflict ACLs (same match with different actions) behavior is unpredictable
 # (only one of them would work).
@@ -22446,6 +22673,7 @@  OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [1.expected])
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
 # This test cases tests a scenario of ACL confliction with address set update.
 # It is to cover a corner case when flows are re-processed in the I-P
@@ -22551,6 +22779,7 @@  OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [1.expected])
 OVN_CLEANUP([hv1])
 AT_CLEANUP
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- port bind/unbind change handling with conj flows - IPv6])
 ovn_start
 
@@ -22599,6 +22828,7 @@  grep conjunction | wc -l`])
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
 
 AT_SETUP([ovn -- I-P of OVS interface changes which belong to non integration bridge])
 ovn_start
@@ -22652,6 +22882,7 @@  AT_CLEANUP
 # unchanged.
 #
 #
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- multi-vtep SB Chassis encap updates])
 ovn_start
 
@@ -22687,3 +22918,4 @@  AT_CHECK([test "$encap_rec_mvtep" = "$encap_rec_mvtep1"], [0], [])
 
 OVN_CLEANUP([hv1])
 AT_CLEANUP
+])
diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index a6ba4554c3fd..7e9e8c034041 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -3,10 +3,16 @@  AT_TESTED([ovs-vsctl])
 
 m4_include([m4/compat.m4])
 
-dnl Make AT_SETUP automatically run the ovs_init() shell function
-dnl as the first step in every test.
+dnl Make AT_SETUP automatically do some things for us:
+dnl - Run the ovs_init() shell function as the first step in every test.
+dnl - If NORTHD_TYPE is defined, then append it to the test name and
+dnl   set it as a shell variable as well.
 m4_rename([AT_SETUP], [OVS_AT_SETUP])
-m4_define([AT_SETUP], [OVS_AT_SETUP($@)
+m4_define([AT_SETUP],
+  [OVS_AT_SETUP($@[]m4_ifdef([NORTHD_TYPE], [ -- NORTHD_TYPE]))
+m4_ifdef([NORTHD_TYPE], [[NORTHD_TYPE]=NORTHD_TYPE
+AT_SKIP_IF([test $NORTHD_TYPE = ovn-northd-ddlog && test $TEST_DDLOG = no])
+])dnl
 ovs_init
 ])
 
@@ -290,9 +296,9 @@  dnl to exit.
 m4_define([OVS_APP_EXIT_AND_WAIT],
   [AT_CHECK([test -e $OVS_RUNDIR/$1.pid])
    TMPPID=$(cat $OVS_RUNDIR/$1.pid)
-   AT_CHECK(m4_if([$1],[ovs-vswitchd],
-                  [ovs-appctl --timeout=10 -t $1 exit --cleanup],
-                  [ovs-appctl --timeout=10 -t $1 exit]))
+   AT_CHECK([m4_if([$1],[ovs-vswitchd],
+                   [ovs-appctl --timeout=10 -t $1 exit --cleanup],
+                   [ovs-appctl --timeout=10 -t $1 exit])])
    OVS_WAIT_WHILE([kill -0 $TMPPID 2>/dev/null])])
 
 dnl OVS_APP_EXIT_AND_WAIT_BY_TARGET(TARGET, PIDFILE)
@@ -302,7 +308,7 @@  dnl argument), and then wait for it to exit.
 m4_define([OVS_APP_EXIT_AND_WAIT_BY_TARGET],
   [AT_CHECK([test -e $2])
    TMPPID=$(cat $2)
-   AT_CHECK([ovs-appctl --timeout=10 --target=$1 exit])
+   AT_CHECK([ovs-appctl --timeout=10 --target=[$1] exit])
    OVS_WAIT_WHILE([kill -0 $TMPPID 2>/dev/null])])
 
 dnl on_exit "COMMAND"
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index d59f7c97ef9a..ee9ce332c4a7 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -1,5 +1,6 @@ 
 AT_BANNER([system-ovn])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 LRs connected via LS, gateway router, SNAT and DNAT])
 AT_KEYWORDS([ovnnat])
 
@@ -169,13 +170,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 LRs connected via LS, gateway router, SNAT and DNAT - IPv6])
 AT_KEYWORDS([ovnnat])
 
@@ -349,13 +352,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 LRs connected via LS, gateway router, easy SNAT])
 AT_KEYWORDS([ovnnat])
 
@@ -459,13 +464,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 LRs connected via LS, gateway router, easy SNAT - IPv6])
 AT_KEYWORDS([ovnnat])
 
@@ -571,13 +578,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- multiple gateway routers, SNAT and DNAT])
 AT_KEYWORDS([ovnnat])
 
@@ -791,13 +800,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- multiple gateway routers, SNAT and DNAT - IPv6])
 AT_KEYWORDS([ovnnat])
 
@@ -1019,13 +1030,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- multiple gateway routers, SNAT and DNAT - Dual Stack])
 AT_KEYWORDS([ovnnat])
 
@@ -1341,8 +1354,9 @@  as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- load-balancing])
 AT_KEYWORDS([ovnlb])
 
@@ -1583,12 +1597,14 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- load-balancing - IPv6])
 AT_KEYWORDS([ovnlb])
 
@@ -1806,12 +1822,14 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- load-balancing - same subnet.])
 AT_KEYWORDS([ovnlb])
 
@@ -1913,12 +1931,14 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- load-balancing - same subnet. - IPv6])
 AT_KEYWORDS([ovnlb])
 
@@ -2022,12 +2042,14 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- load balancing in gateway router])
 AT_KEYWORDS([ovnlb])
 
@@ -2221,13 +2243,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- load balancing in gateway router - IPv6])
 AT_KEYWORDS([ovnlb])
 
@@ -2375,13 +2399,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- multiple gateway routers, load-balancing])
 AT_KEYWORDS([ovnlb])
 
@@ -2544,13 +2570,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- multiple gateway routers, load-balancing - IPv6])
 AT_KEYWORDS([ovnlb])
 
@@ -2715,13 +2743,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- multiple gateway routers, load-balancing - Dual Stack])
 AT_KEYWORDS([ovnlb])
 
@@ -2945,7 +2975,9 @@  as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- load balancing in router with gateway router port])
 AT_KEYWORDS([ovnlb])
 
@@ -3080,13 +3112,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- load balancing in router with gateway router port - IPv6])
 AT_KEYWORDS([ovnlb])
 
@@ -3221,13 +3255,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- DNAT and SNAT on distributed router - N/S])
 AT_KEYWORDS([ovnnat])
 
@@ -3400,13 +3436,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- DNAT and SNAT on distributed router - N/S - IPv6])
 AT_KEYWORDS([ovnnat])
 
@@ -3556,13 +3594,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- DNAT and SNAT on distributed router - E/W])
 AT_KEYWORDS([ovnnat])
 
@@ -3733,13 +3773,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- DNAT and SNAT on distributed router - E/W - IPv6])
 AT_KEYWORDS([ovnnat])
 
@@ -3915,13 +3957,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- 2 LSs IGMP and MLD])
 AT_SKIP_IF([test $HAVE_TCPDUMP = no])
 AT_KEYWORDS([ovnigmp])
@@ -4074,13 +4118,15 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Load balancer health checks])
 AT_KEYWORDS([lb])
 ovn_start
@@ -4275,7 +4321,7 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
@@ -4283,7 +4329,9 @@  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /Service monitor not found.*/d"])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Load Balancer LS hairpin IPv4])
 AT_SKIP_IF([test $HAVE_NC = no])
 AT_SKIP_IF([test $HAVE_TCPDUMP = no])
@@ -4363,7 +4411,9 @@  as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Load Balancer LS hairpin IPv6])
 AT_SKIP_IF([test $HAVE_NC = no])
 AT_KEYWORDS([lb])
@@ -4441,8 +4491,9 @@  as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 AT_CLEANUP
+])
 
-
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ACL reject])
 AT_SKIP_IF([test $HAVE_NC = no])
 AT_KEYWORDS([lb])
@@ -4694,7 +4745,9 @@  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- IPv6 prefix delegation])
 AT_SKIP_IF([test $HAVE_DIBBLER_SERVER = no])
 AT_SKIP_IF([test $HAVE_TCPDUMP = no])
@@ -4846,15 +4899,17 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d
 /.*terminating with signal 15.*/d"])
 AT_CLEANUP
+])
 
 # Tests that when an established connection sends TCP reset,
 # the conntrack entry is not in established state.
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- conntrack TCP reset])
 AT_KEYWORDS([conntrack])
 ovn_start
@@ -4946,7 +5001,7 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
@@ -4954,7 +5009,9 @@  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /Service monitor not found.*/d"])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- Load balancer for container ports])
 AT_SKIP_IF([test $HAVE_NC = no])
 AT_KEYWORDS([lb])
@@ -5072,11 +5129,13 @@  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 
 AT_CLEANUP
+])
 
 # When a lport is released on a chassis, ovn-controller was
 # not clearing some of the flowss in the table 33 leading
 # to packet drops if ct() is hit.
 # Make sure that those flows are cleared properly.
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn --Test packet drops due to incorrect flows in physical table 33])
 AT_KEYWORDS([lb])
 
@@ -5157,14 +5216,16 @@  as ovn-nb
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
 as northd
-OVS_APP_EXIT_AND_WAIT([ovn-northd])
+OVS_APP_EXIT_AND_WAIT([NORTHD_TYPE])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ECMP symmetric reply])
 AT_KEYWORDS([ecmp])
 
@@ -5308,7 +5369,9 @@  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /connection dropped.*/d"])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- controller I-P handling when ovs iface ofport is -1])
 
 ovn_start
@@ -5356,7 +5419,9 @@  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
 /could not open network device p1*/d"])
 
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- ARP resolution for SNAT IP])
 ovn_start
 OVS_TRAFFIC_VSWITCHD_START()
@@ -5445,7 +5510,9 @@  as
 OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d
 /.*terminating with signal 15.*/d"])
 AT_CLEANUP
+])
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- egress qos])
 AT_KEYWORDS([ovn-egress-qos])
 
@@ -5505,3 +5572,4 @@  as
 OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d
 /.*terminating with signal 15.*/d"])
 AT_CLEANUP
+])
\ No newline at end of file