From patchwork Thu May 20 23:31:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1481948 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FmQxz4Y2Vz9sWl for ; Fri, 21 May 2021 09:32:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A121741845; Thu, 20 May 2021 23:32:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FPn1jV0wziMh; Thu, 20 May 2021 23:32:19 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTP id 700E041836; Thu, 20 May 2021 23:32:18 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A63E5C0023; Thu, 20 May 2021 23:32:16 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 217F9C0001 for ; Thu, 20 May 2021 23:32:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 03C2F84529 for ; Thu, 20 May 2021 23:32:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5dp2n3puHFQz for ; Thu, 20 May 2021 23:32:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp1.osuosl.org (Postfix) with ESMTPS id 33E2D83ADE for ; Thu, 20 May 2021 23:32:12 +0000 (UTC) Received: (Authenticated sender: blp@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id D18C01C000A; Thu, 20 May 2021 23:32:10 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Thu, 20 May 2021 16:31:59 -0700 Message-Id: <20210520233201.1048112-2-blp@ovn.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520233201.1048112-1-blp@ovn.org> References: <20210520233201.1048112-1-blp@ovn.org> MIME-Version: 1.0 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH ovn 1/3] ovn-northd-ddlog: Document --ddlog-record option. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Ben Pfaff Acked-by: Dumitru Ceara --- northd/ovn-northd-ddlog.c | 1 + northd/ovn-northd.8.xml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/northd/ovn-northd-ddlog.c b/northd/ovn-northd-ddlog.c index b7d2c8a5ef8d..c79e15312b64 100644 --- a/northd/ovn-northd-ddlog.c +++ b/northd/ovn-northd-ddlog.c @@ -1049,6 +1049,7 @@ Options:\n\ (default: %s)\n\ --ovnsb-db=DATABASE connect to ovn-sb database at DATABASE\n\ (default: %s)\n\ + --ddlog-record=FILE.TXT record db changes to replay later for debugging\n\ --unixctl=SOCKET override default control socket name\n\ -h, --help display this help message\n\ -o, --options list available options\n\ diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml index bca9cb4f4e79..b7214b05e7ed 100644 --- a/northd/ovn-northd.8.xml +++ b/northd/ovn-northd.8.xml @@ -42,6 +42,16 @@ as the default. Otherwise, the default is unix:@RUNDIR@/ovnsb_db.sock. +
--ddlog-record=file
+
+ This option is for ovn-north-ddlog only. It causes the + daemon to record the initial database state and later changes to + file in the text-based DDlog command format. The + ovn_northd_cli program can later replay these changes for + debugging purposes. This option has a performance impact. See + debugging-ddlog.rst in the OVN documentation for more + details. +

database in the above options must be an OVSDB active or From patchwork Thu May 20 23:32:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1481949 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FmQy32FVcz9sW4 for ; Fri, 21 May 2021 09:32:27 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1B10D60DCC; Thu, 20 May 2021 23:32:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bQWgKjanOtAY; Thu, 20 May 2021 23:32:22 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTP id D98E560DC7; Thu, 20 May 2021 23:32:20 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EA457C000D; Thu, 20 May 2021 23:32:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7D96FC0029 for ; Thu, 20 May 2021 23:32:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 6528441832 for ; Thu, 20 May 2021 23:32:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id USMyoa5Z-Ett for ; Thu, 20 May 2021 23:32:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp4.osuosl.org (Postfix) with ESMTPS id 6CA4840F63 for ; Thu, 20 May 2021 23:32:15 +0000 (UTC) Received: (Authenticated sender: blp@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 340EA1C0005; Thu, 20 May 2021 23:32:11 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Thu, 20 May 2021 16:32:00 -0700 Message-Id: <20210520233201.1048112-3-blp@ovn.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520233201.1048112-1-blp@ovn.org> References: <20210520233201.1048112-1-blp@ovn.org> MIME-Version: 1.0 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH ovn 2/3] ovn-northd, ovn-northd-ddlog: New --dry-run option. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" By being able to start up ovn-northd-ddlog in a paused state, we can produce a recording for use in debugging without having to restart one of the real ovn-northd-ddlog processes or disturbing the system. Signed-off-by: Ben Pfaff CC: Ihar Hrachyshka Acked-by: Dumitru Ceara --- NEWS | 2 +- northd/ovn-northd-ddlog.c | 43 ++++++++++++++++++++++++--------------- northd/ovn-northd.8.xml | 25 ++++++++++++++++++++--- northd/ovn-northd.c | 19 ++++++++++++----- tests/ovn-macros.at | 22 ++++++++++++++------ tests/ovn-northd.at | 16 +++++++-------- 6 files changed, 88 insertions(+), 39 deletions(-) diff --git a/NEWS b/NEWS index f96ed73f0823..96c9397361a2 100644 --- a/NEWS +++ b/NEWS @@ -18,7 +18,7 @@ Post-v21.03.0 datapath flows with this field used. - Introduce a new "allow-stateless" ACL verb to always bypass connection tracking. The existing "allow" verb behavior is left intact. - - Added support in native DNS to respond to PTR request types. + - New --dry-run option for ovn-northd and ovn-northd-ddlog. OVN v21.03.0 - 12 Mar 2021 ------------------------- diff --git a/northd/ovn-northd-ddlog.c b/northd/ovn-northd-ddlog.c index c79e15312b64..73bf5290eb35 100644 --- a/northd/ovn-northd-ddlog.c +++ b/northd/ovn-northd-ddlog.c @@ -159,7 +159,8 @@ northd_ctx_create(const char *server, const char *database, ddlog_prog ddlog, ddlog_delta *delta, const char **input_relations, const char **output_relations, - const char **output_only_relations) + const char **output_only_relations, + bool paused) { struct northd_ctx *ctx = xmalloc(sizeof *ctx); *ctx = (struct northd_ctx) { @@ -175,7 +176,7 @@ northd_ctx_create(const char *server, const char *database, .db_name = database, /* 'output_only_relations' will get filled in later. */ .lock_name = lock_name, - .paused = false, + .paused = paused, }; ovsdb_cs_set_remote(ctx->cs, server, true); @@ -1041,7 +1042,7 @@ static void usage(void) { printf("\ -%s: OVN northbound management daemon\n\ +%s: OVN northbound management daemon (DDlog version)\n\ usage: %s [OPTIONS]\n\ \n\ Options:\n\ @@ -1049,6 +1050,7 @@ Options:\n\ (default: %s)\n\ --ovnsb-db=DATABASE connect to ovn-sb database at DATABASE\n\ (default: %s)\n\ + --dry-run start in paused state (do not commit db changes)\n\ --ddlog-record=FILE.TXT record db changes to replay later for debugging\n\ --unixctl=SOCKET override default control socket name\n\ -h, --help display this help message\n\ @@ -1061,22 +1063,25 @@ Options:\n\ } static void -parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED, + bool *pause) { enum { OVN_DAEMON_OPTION_ENUMS, VLOG_OPTION_ENUMS, SSL_OPTION_ENUMS, + OPT_DRY_RUN, OPT_DDLOG_RECORD }; static const struct option long_options[] = { - {"ddlog-record", required_argument, NULL, OPT_DDLOG_RECORD}, {"ovnsb-db", required_argument, NULL, 'd'}, {"ovnnb-db", required_argument, NULL, 'D'}, {"unixctl", required_argument, NULL, 'u'}, {"help", no_argument, NULL, 'h'}, {"options", no_argument, NULL, 'o'}, {"version", no_argument, NULL, 'V'}, + {"dry-run", no_argument, NULL, OPT_DRY_RUN}, + {"ddlog-record", required_argument, NULL, OPT_DDLOG_RECORD}, OVN_DAEMON_LONG_OPTIONS, VLOG_LONG_OPTIONS, STREAM_SSL_LONG_OPTIONS, @@ -1097,10 +1102,6 @@ parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) VLOG_OPTION_HANDLERS; STREAM_SSL_OPTION_HANDLERS; - case OPT_DDLOG_RECORD: - record_file = optarg; - break; - case 'd': ovnsb_db = optarg; break; @@ -1125,6 +1126,14 @@ parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) ovs_print_version(0, 0); exit(EXIT_SUCCESS); + case OPT_DRY_RUN: + *pause = true; + break; + + case OPT_DDLOG_RECORD: + record_file = optarg; + break; + default: break; } @@ -1148,6 +1157,10 @@ main(int argc, char *argv[]) struct unixctl_server *unixctl; int retval; bool exiting; + struct northd_status status = { + .locked = false, + .pause = false, + }; init_table_ids(); @@ -1155,7 +1168,7 @@ main(int argc, char *argv[]) ovs_cmdl_proctitle_init(argc, argv); set_program_name(argv[0]); service_start(&argc, &argv); - parse_options(argc, argv); + parse_options(argc, argv, &status.pause); daemonize_start(false); @@ -1167,10 +1180,6 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - struct northd_status status = { - .locked = false, - .pause = false, - }; unixctl_command_register("exit", "", 0, 0, ovn_northd_exit, &exiting); unixctl_command_register("status", "", 0, 0, ovn_northd_status, &status); @@ -1202,10 +1211,12 @@ main(int argc, char *argv[]) struct northd_ctx *nb_ctx = northd_ctx_create( ovnnb_db, "OVN_Northbound", "nb", NULL, ddlog, delta, - nb_input_relations, nb_output_relations, nb_output_only_relations); + nb_input_relations, nb_output_relations, nb_output_only_relations, + status.pause); struct northd_ctx *sb_ctx = northd_ctx_create( ovnsb_db, "OVN_Southbound", "sb", "ovn_northd", ddlog, delta, - sb_input_relations, sb_output_relations, sb_output_only_relations); + sb_input_relations, sb_output_relations, sb_output_only_relations, + status.pause); unixctl_command_register("pause", "", 0, 0, ovn_northd_pause, sb_ctx); unixctl_command_register("resume", "", 0, 0, ovn_northd_resume, sb_ctx); diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml index b7214b05e7ed..0c75d0795817 100644 --- a/northd/ovn-northd.8.xml +++ b/northd/ovn-northd.8.xml @@ -52,6 +52,22 @@ debugging-ddlog.rst in the OVN documentation for more details. +

--dry-run
+
+

+ Causes ovn-northd to start paused. In the paused state, + ovn-northd does not apply any changes to the databases, + although it continues to monitor them. For more information, see the + pause command, under Runtime Management + Commands below. +

+ +

+ For ovn-northd-ddlog, one could use this option with + --ddlog-record to generate a replay log without + restarting a process or disturbing a running system. +

+

database in the above options must be an OVSDB active or @@ -91,9 +107,12 @@

pause
- Pauses the ovn-northd operation from processing any Northbound and - Southbound database changes. This will also instruct ovn-northd to - drop any lock on SB DB. + Pauses ovn-northd. When it is paused, + ovn-northd receives changes from the Northbound and + Southbound database changes as usual, but it does not send any updates. + A paused ovn-northd also drops database locks, which + allows any other non-paused instance of ovn-northd to take + over.
resume
diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 0e5092a875ff..f97b23dec0b2 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -401,6 +401,7 @@ Options:\n\ (default: %s)\n\ --ovnsb-db=DATABASE connect to ovn-sb database at DATABASE\n\ (default: %s)\n\ + --dry-run start in paused state (do not commit db changes)\n\ --unixctl=SOCKET override default control socket name\n\ -h, --help display this help message\n\ -o, --options list available options\n\ @@ -13977,12 +13978,14 @@ ovn_db_run(struct northd_context *ctx, } static void -parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED, + bool *paused) { enum { OVN_DAEMON_OPTION_ENUMS, VLOG_OPTION_ENUMS, SSL_OPTION_ENUMS, + OPT_DRY_RUN, }; static const struct option long_options[] = { {"ovnsb-db", required_argument, NULL, 'd'}, @@ -13991,6 +13994,7 @@ parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) {"help", no_argument, NULL, 'h'}, {"options", no_argument, NULL, 'o'}, {"version", no_argument, NULL, 'V'}, + {"dry-run", no_argument, NULL, OPT_DRY_RUN}, OVN_DAEMON_LONG_OPTIONS, VLOG_LONG_OPTIONS, STREAM_SSL_LONG_OPTIONS, @@ -14035,6 +14039,10 @@ parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) ovn_print_version(0, 0); exit(EXIT_SUCCESS); + case OPT_DRY_RUN: + *paused = true; + break; + default: break; } @@ -14066,13 +14074,16 @@ main(int argc, char *argv[]) struct unixctl_server *unixctl; int retval; bool exiting; - struct northd_state state; + struct northd_state state = { + .had_lock = false, + .paused = false + }; fatal_ignore_sigpipe(); ovs_cmdl_proctitle_init(argc, argv); ovn_set_program_name(argv[0]); service_start(&argc, &argv); - parse_options(argc, argv); + parse_options(argc, argv, &state.paused); daemonize_start(false); @@ -14371,8 +14382,6 @@ main(int argc, char *argv[]) /* Main loop. */ exiting = false; - state.had_lock = false; - state.paused = false; while (!exiting) { memory_run(); diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at index 94fba405ea33..2217131ab234 100644 --- a/tests/ovn-macros.at +++ b/tests/ovn-macros.at @@ -149,8 +149,12 @@ ovn_init_ic_db () { ovn_init_db ovn-ic-sb } -# ovn_start_northd (primary|backup) [AZ] +# ovn_start_northd [--paused] (primary|backup) [AZ] ovn_start_northd() { + local northd_args= + case $1 in + --paused) northd_args=--dry-run; shift ;; + esac local priority=$1 local AZ=$2 local msg_prefix=${AZ:+$AZ: } @@ -161,10 +165,9 @@ ovn_start_northd() { backup) suffix=-backup ;; esac - local northd_args= case ${NORTHD_TYPE:=ovn-northd} in ovn-northd) ;; - ovn-northd-ddlog) northd_args="--ddlog-record=${AZ:+$AZ/}northd$suffix/replay.dat -v" ;; + ovn-northd-ddlog) northd_args="$northd_args --ddlog-record=${AZ:+$AZ/}northd$suffix/replay.dat -v" ;; esac local name=${d_prefix}northd${suffix} @@ -174,16 +177,23 @@ ovn_start_northd() { --ovnnb-db=$OVN_NB_DB --ovnsb-db=$OVN_SB_DB } -# ovn_start [--no-backup-northd] [AZ] +# ovn_start [--backup-northd=none|paused] [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. +# +# Normally this starts an active northd and a backup norhtd. The following +# options are accepted to adjust that: +# --backup-northd=none Don't start a backup northd. +# --backup-northd=paused Start the backup northd in the paused state. ovn_start () { local backup_northd=: + local backup_northd_options= case $1 in - --no-backup-northd) backup_northd=false; shift ;; + --backup-northd=none) backup_northd=false; shift ;; + --backup-northd=paused) backup_northd_options=--paused; shift ;; esac local AZ=$1 local msg_prefix=${AZ:+$AZ: } @@ -201,7 +211,7 @@ ovn_start () { ovn_start_northd primary $AZ if $backup_northd; then - ovn_start_northd backup $AZ + ovn_start_northd $backup_northd_options backup $AZ fi if test X$HAVE_OPENSSL = Xyes; then diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index bff2ade43b4d..28a46702cf48 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -641,7 +641,10 @@ AT_CLEANUP OVN_FOR_EACH_NORTHD([ AT_SETUP([ovn -- ovn-northd pause and resume]) -ovn_start +# By starting the backup northd paused, we ensure that the primary +# northd is active; otherwise, there's a race. (We also test that +# the ovn-northd --dry-run option works.) +ovn_start --backup-northd=paused get_northd_status() { as northd ovn-appctl -t NORTHD_TYPE is-paused @@ -650,10 +653,7 @@ get_northd_status() { as northd-backup ovn-appctl -t NORTHD_TYPE status } -AS_BOX([Pause the backup]) -# This forces 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 +AS_BOX([Check that the backup is paused]) OVS_WAIT_FOR_OUTPUT([get_northd_status], [0], [false Status: active true @@ -709,7 +709,7 @@ AT_CLEANUP OVN_FOR_EACH_NORTHD([ AT_SETUP([ovn -- ovn-northd restart]) -ovn_start --no-backup-northd +ovn_start --backup-northd=none # Check that ovn-northd is active, by verifying that it creates and # destroys southbound datapaths as one would expect. @@ -741,7 +741,7 @@ dnl This test doesn't take into account flows that are shared between dnl datapaths when datapath groups are enabled. AT_SKIP_IF([test NORTHD_USE_DP_GROUPS = yes]) -ovn_start --no-backup-northd +ovn_start --backup-northd=none # Check that ovn-northd is active, by verifying that it creates and # destroys southbound datapaths as one would expect. @@ -781,7 +781,7 @@ dnl This test doesn't take into account flows that are shared between dnl datapaths when datapath groups are enabled. AT_SKIP_IF([test NORTHD_USE_DP_GROUPS = yes]) -ovn_start --no-backup-northd +ovn_start --backup-northd=none # Check that ovn-northd is active, by verifying that it creates and # destroys southbound datapaths as one would expect. From patchwork Thu May 20 23:32:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1481947 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FmQxz28fRz9sW4 for ; Fri, 21 May 2021 09:32:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 7ED8F405DF; Thu, 20 May 2021 23:32:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ToZ8xC70Z9tE; Thu, 20 May 2021 23:32:20 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTP id AC28840025; Thu, 20 May 2021 23:32:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id CDB81C000F; Thu, 20 May 2021 23:32:18 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6C6E2C000D for ; Thu, 20 May 2021 23:32:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 306CC40025 for ; Thu, 20 May 2021 23:32:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hlrhz_idLv-T for ; Thu, 20 May 2021 23:32:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp2.osuosl.org (Postfix) with ESMTPS id 5E4C3401F2 for ; Thu, 20 May 2021 23:32:16 +0000 (UTC) Received: (Authenticated sender: blp@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 139101C0002; Thu, 20 May 2021 23:32:13 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Thu, 20 May 2021 16:32:01 -0700 Message-Id: <20210520233201.1048112-4-blp@ovn.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520233201.1048112-1-blp@ovn.org> References: <20210520233201.1048112-1-blp@ovn.org> MIME-Version: 1.0 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH ovn 3/3] tests: Don't define tests that will always be skipped. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The "(northbound|southbound) database reconnection" tests had dp-groups=yes variants but they were unconditionally skipped at runtime. There's no point in having them, so this commit drops them. This changes the changes of the tests without datapath groups to have "dp-groups=no" in their names. That seems like an OK change to me, but it can easily be reverted if people don't like it. Signed-off-by: Ben Pfaff Acked-by: Dumitru Ceara --- tests/ovn-macros.at | 26 ++++++++++++-------------- tests/ovn-northd.at | 12 ++---------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at index 2217131ab234..cd02b6986cc2 100644 --- a/tests/ovn-macros.at +++ b/tests/ovn-macros.at @@ -546,17 +546,15 @@ 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 -m4_pushdef([NORTHD_USE_DP_GROUPS], [yes])dnl -$1 -m4_popdef([NORTHD_USE_DP_GROUPS])dnl -$1 -m4_popdef([NORTHD_TYPE])dnl -m4_pushdef([NORTHD_TYPE], [ovn-northd-ddlog])dnl -m4_pushdef([NORTHD_USE_DP_GROUPS], [yes])dnl -$1 -m4_popdef([NORTHD_USE_DP_GROUPS])dnl -$1 -m4_popdef([NORTHD_TYPE])dnl -]) +# 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 +])])]) + +# Some tests aren't prepared for dp groups to be enabled. +m4_define([OVN_FOR_EACH_NORTHD_WITHOUT_DP_GROUPS], + [m4_foreach([NORTHD_TYPE], [ovn-northd, ovn-northd-ddlog], + [m4_foreach([NORTHD_USE_DP_GROUPS], [no], [$1 +])])]) diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index 28a46702cf48..cf7e8a0604ed 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -734,13 +734,9 @@ wait_row_count Datapath_Binding 2 AT_CLEANUP ]) -OVN_FOR_EACH_NORTHD([ +OVN_FOR_EACH_NORTHD_WITHOUT_DP_GROUPS([ AT_SETUP([ovn -- northbound database reconnection]) -dnl This test doesn't take into account flows that are shared between -dnl datapaths when datapath groups are enabled. -AT_SKIP_IF([test NORTHD_USE_DP_GROUPS = yes]) - ovn_start --backup-northd=none # Check that ovn-northd is active, by verifying that it creates and @@ -774,13 +770,9 @@ wait_row_count Logical_Flow $(expr 2 \* $lf) AT_CLEANUP ]) -OVN_FOR_EACH_NORTHD([ +OVN_FOR_EACH_NORTHD_WITHOUT_DP_GROUPS([ AT_SETUP([ovn -- southbound database reconnection]) -dnl This test doesn't take into account flows that are shared between -dnl datapaths when datapath groups are enabled. -AT_SKIP_IF([test NORTHD_USE_DP_GROUPS = yes]) - ovn_start --backup-northd=none # Check that ovn-northd is active, by verifying that it creates and