Skip to content

Commit

Permalink
Added test cases with ovn-northd parallelization enabled
Browse files Browse the repository at this point in the history
This will more or less double the number of test cases.
It is possible to select a reduce set of test cases using -k "keywords".
Keyword such as
        dp-groups=yes
        dp-groups=no
        parallelization=yes
        parallelization=no
        ovn-northd
        ovn-northd-ddlog
can be used to select a range of tests, as title is searched as well.

For instance, to run ovn-parallelization tests, with dp-groups enabled and ddlog disabled:
        make check TESTSUITEFLAGS="-k dp-groups=yes,parallelization=yes,\!ovn-northd-ddlog"

A few additional notes
- Do not use "ovn-northd" as a keyword, or the result might be different than expected.
  Even tough ovn-northd is added in all titles for the non ddlog tests, ovn-northd is also
  added in title of some other tests, for both ddlog and non ddlog (e.g. "check ovn-northd and ovn-controller version pinning").
- Running tests for both parallelization=yes and parallelization=no will not run all tests as
  some tests are not run through OVN_FOR_EACH_NORTHD. Instead use for instance
  make check  TESTSUITEFLAGS="-k parallelization=yes" and
  make check  TESTSUITEFLAGS="-k \!parallelization=yes" to run all tests

If less than four physical cores are available, then 1 socket/four cores dummy-numa
is used to excercice parallel northd

Signed-off-by: Xavier Simonart <[email protected]>
Acked-by: Numan Siddique <[email protected]>
Signed-off-by: Mark Michelson <[email protected]>
  • Loading branch information
simonartxavier authored and putnopvut committed Mar 22, 2022
1 parent ed9bb4d commit eff23a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 14 additions & 3 deletions tests/ovn-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ovn_start_northd() {
esac

if test X$NORTHD_DUMMY_NUMA = Xyes; then
northd_args="$northd_args --dummy-numa=\"0,0,1,1\""
northd_args="$northd_args --dummy-numa=\"0,0,0,0\""
fi

local name=${d_prefix}northd${suffix}
Expand Down Expand Up @@ -749,12 +749,23 @@ OVS_END_SHELL_HELPERS

m4_define([OVN_POPULATE_ARP], [AT_CHECK(ovn_populate_arp__, [0], [ignore])])

# Use --dummy-numa if system has low cores and we want to force parallelization
m4_define([NORTHD_DUMMY_NUMA],
[$(if test $(nproc) -lt 4 && test NORTHD_USE_PARALLELIZATION = yes
then
echo "yes"
else
echo "no"
fi)
])

# Defines a versions of a test with all combinations of northd and
# datapath groups.
m4_define([OVN_FOR_EACH_NORTHD],
[m4_foreach([NORTHD_TYPE], [ovn-northd, ovn-northd-ddlog],
[m4_foreach([NORTHD_USE_DP_GROUPS], [yes, no], [$1
])])])
[m4_foreach([NORTHD_USE_DP_GROUPS], [yes, no],
[m4_foreach([NORTHD_USE_PARALLELIZATION], [yes, no], [$1
])])])])

# Some tests aren't prepared for dp groups to be enabled.
m4_define([OVN_FOR_EACH_NORTHD_WITHOUT_DP_GROUPS],
Expand Down
6 changes: 5 additions & 1 deletion tests/ovs-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ dnl set it as a shell variable as well.
dnl - Skip the test if it's for ovn-northd-ddlog but it didn't get built.
m4_rename([AT_SETUP], [OVS_AT_SETUP])
m4_define([AT_SETUP],
[OVS_AT_SETUP($@[]m4_ifdef([NORTHD_TYPE], [ -- NORTHD_TYPE])[]m4_ifdef([NORTHD_USE_DP_GROUPS], [ -- dp-groups=NORTHD_USE_DP_GROUPS]))
[OVS_AT_SETUP($@[]m4_ifdef([NORTHD_TYPE], [ -- NORTHD_TYPE])[]m4_ifdef([NORTHD_USE_DP_GROUPS], [ -- dp-groups=NORTHD_USE_DP_GROUPS])[]m4_ifdef([NORTHD_USE_PARALLELIZATION], [ -- parallelization=NORTHD_USE_PARALLELIZATION]))
m4_ifdef([NORTHD_TYPE], [[NORTHD_TYPE]=NORTHD_TYPE
])dnl
m4_ifdef([NORTHD_USE_DP_GROUPS], [[NORTHD_USE_DP_GROUPS]=NORTHD_USE_DP_GROUPS
])dnl
m4_ifdef([NORTHD_USE_PARALLELIZATION], [[NORTHD_USE_PARALLELIZATION]=NORTHD_USE_PARALLELIZATION
])dnl
m4_ifdef([NORTHD_DUMMY_NUMA], [[NORTHD_DUMMY_NUMA]=NORTHD_DUMMY_NUMA
])dnl
m4_if(NORTHD_TYPE, [ovn-northd-ddlog], [dnl
AT_SKIP_IF([test $TEST_DDLOG = no])
])dnl
Expand Down

0 comments on commit eff23a0

Please sign in to comment.