From patchwork Thu Nov 15 06:05:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998089 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wW7d6sjtz9s8F for ; Thu, 15 Nov 2018 17:05:48 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id DAFD0ACB; Thu, 15 Nov 2018 06:05:44 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 6A5B58D7 for ; Thu, 15 Nov 2018 06:05:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8FDC78B for ; Thu, 15 Nov 2018 06:05:42 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 4C8B3240004; Thu, 15 Nov 2018 06:05:38 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:25 -0800 Message-Id: <20181115060534.7146-1-blp@ovn.org> X-Mailer: git-send-email 2.16.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 01/10] ovsdb-idl: Avoid sending transactions when the DB is not synced up. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Until now the code here would happily try to send transactions to the database server even if the database connection was not in the correct state. In some cases this could lead to strange behavior, such as sending a database transaction for a database that the IDL had just learned did not exist on the server. Signed-off-by: Ben Pfaff Acked-by: Mark Michelson --- lib/ovsdb-idl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 9f44cefd152b..a1f246d6f7b7 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -3867,6 +3867,13 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn) goto coverage_out; } + /* If we're still connecting or re-connecting, don't bother sending a + * transaction. */ + if (txn->db->idl->state != IDL_S_MONITORING) { + txn->status = TXN_TRY_AGAIN; + goto disassemble_out; + } + /* If we need a lock but don't have it, give up quickly. */ if (txn->db->lock_name && !txn->db->has_lock) { txn->status = TXN_NOT_LOCKED; From patchwork Thu Nov 15 06:05:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wW8G6Vptz9s8F for ; Thu, 15 Nov 2018 17:06:22 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 858A9B6A; Thu, 15 Nov 2018 06:05:45 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 01BC3AF8 for ; Thu, 15 Nov 2018 06:05:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 71CD18B for ; Thu, 15 Nov 2018 06:05:43 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 05016240003; Thu, 15 Nov 2018 06:05:40 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:26 -0800 Message-Id: <20181115060534.7146-2-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181115060534.7146-1-blp@ovn.org> References: <20181115060534.7146-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 02/10] ovsdb-idl: Treat "unknown database" error as reason to reconnect. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Ordinarily the IDL finds out in advance whether a particular database is on its server, or it finds out via notifications. But it's also a good idea to adopt a belt-and-suspenders approach so that, if the IDL does receive an "unknown database" error, we treat it as a "soft" error that can be fixed by reconnecting to another server, rather than a "hard" error that should cause an immediate abort. Signed-off-by: Ben Pfaff --- lib/ovsdb-idl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index a1f246d6f7b7..a7274dea2a8b 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -4686,6 +4686,10 @@ ovsdb_idl_db_txn_process_reply(struct ovsdb_idl_db *db, if (error->type == JSON_STRING) { if (!strcmp(error->string, "timed out")) { soft_errors++; + } else if (!strcmp(error->string, + "unknown database")) { + ovsdb_idl_retry(db->idl); + soft_errors++; } else if (!strcmp(error->string, "not owner")) { lock_errors++; } else if (!strcmp(error->string, "not allowed")) { From patchwork Thu Nov 15 06:05:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998092 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wW8s58f8z9s8F for ; Thu, 15 Nov 2018 17:06:53 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2CC35B76; Thu, 15 Nov 2018 06:05:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 51C5FB68 for ; Thu, 15 Nov 2018 06:05:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5A7648B for ; Thu, 15 Nov 2018 06:05:45 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 9669B240006; Thu, 15 Nov 2018 06:05:42 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:27 -0800 Message-Id: <20181115060534.7146-3-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181115060534.7146-1-blp@ovn.org> References: <20181115060534.7146-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 03/10] raft: Improve logging for sent RPCs. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org For debugging, it is useful to know the source code line that sent a given RPC message. Signed-off-by: Ben Pfaff --- ovsdb/raft.c | 55 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/ovsdb/raft.c b/ovsdb/raft.c index 02ba763e5fc4..6c5c6068f1ac 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -303,9 +303,15 @@ static bool raft_rpc_is_heartbeat(const union raft_rpc *); static bool raft_is_rpc_synced(const struct raft *, const union raft_rpc *); static void raft_handle_rpc(struct raft *, const union raft_rpc *); -static bool raft_send(struct raft *, const union raft_rpc *); -static bool raft_send__(struct raft *, const union raft_rpc *, - struct raft_conn *); +static bool raft_send_at(struct raft *, const union raft_rpc *, + int line_number); +#define raft_send(raft, rpc) raft_send_at(raft, rpc, __LINE__) + +static bool raft_send_to_conn_at(struct raft *, const union raft_rpc *, + struct raft_conn *, int line_number); +#define raft_send_to_conn(raft, rpc, conn) \ + raft_send_to_conn_at(raft, rpc, conn, __LINE__) + static void raft_send_append_request(struct raft *, struct raft_server *, unsigned int n, const char *comment); @@ -1055,7 +1061,7 @@ raft_transfer_leadership(struct raft *raft, const char *reason) .term = raft->term, } }; - raft_send__(raft, &rpc, conn); + raft_send_to_conn(raft, &rpc, conn); raft_record_note(raft, "transfer leadership", "transferring leadership to %s because %s", @@ -1295,14 +1301,18 @@ raft_get_nickname(const struct raft *raft, const struct uuid *sid, } static void -log_rpc(const union raft_rpc *rpc, - const char *direction, const struct raft_conn *conn) +log_rpc(const union raft_rpc *rpc, const char *direction, + const struct raft_conn *conn, int line_number) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(600, 600); if (!raft_rpc_is_heartbeat(rpc) && !VLOG_DROP_DBG(&rl)) { struct ds s = DS_EMPTY_INITIALIZER; + if (line_number) { + ds_put_format(&s, "raft.c:%d ", line_number); + } + ds_put_format(&s, "%s%s ", direction, conn->nickname); raft_rpc_format(rpc, &s); - VLOG_DBG("%s%s %s", direction, conn->nickname, ds_cstr(&s)); + VLOG_DBG("%s", ds_cstr(&s)); ds_destroy(&s); } } @@ -1320,7 +1330,7 @@ raft_send_add_server_request(struct raft *raft, struct raft_conn *conn) .address = raft->local_address, }, }; - raft_send__(raft, &rq, conn); + raft_send_to_conn(raft, &rq, conn); } static void @@ -1345,7 +1355,7 @@ raft_conn_run(struct raft *raft, struct raft_conn *conn) .sid = raft->sid, }, }; - raft_send__(raft, &rq, conn); + raft_send_to_conn(raft, &rq, conn); } else { union raft_rpc rq = (union raft_rpc) { .hello_request = { @@ -1356,7 +1366,7 @@ raft_conn_run(struct raft *raft, struct raft_conn *conn) .address = raft->local_address, }, }; - raft_send__(raft, &rq, conn); + raft_send_to_conn(raft, &rq, conn); } } @@ -1366,7 +1376,7 @@ raft_conn_run(struct raft *raft, struct raft_conn *conn) break; } - log_rpc(&rpc, "<--", conn); + log_rpc(&rpc, "<--", conn, 0); raft_handle_rpc(raft, &rpc); raft_rpc_uninit(&rpc); } @@ -1434,13 +1444,14 @@ raft_waiter_complete_rpc(struct raft *raft, const union raft_rpc *rpc) struct raft_conn *dst = raft_find_conn_by_sid(raft, &rpc->common.sid); if (dst) { - raft_send__(raft, rpc, dst); + raft_send_to_conn(raft, rpc, dst); } } static void raft_waiter_complete(struct raft *raft, struct raft_waiter *w) { + VLOG_INFO("%s:%d", __FILE__, __LINE__); switch (w->type) { case RAFT_W_ENTRY: if (raft->role == RAFT_LEADER) { @@ -4001,10 +4012,10 @@ raft_rpc_is_heartbeat(const union raft_rpc *rpc) static bool -raft_send__(struct raft *raft, const union raft_rpc *rpc, - struct raft_conn *conn) +raft_send_to_conn_at(struct raft *raft, const union raft_rpc *rpc, + struct raft_conn *conn, int line_number) { - log_rpc(rpc, "-->", conn); + log_rpc(rpc, "-->", conn, line_number); return !jsonrpc_session_send( conn->js, raft_rpc_to_jsonrpc(&raft->cid, &raft->sid, rpc)); } @@ -4022,12 +4033,13 @@ raft_is_rpc_synced(const struct raft *raft, const union raft_rpc *rpc) } static bool -raft_send(struct raft *raft, const union raft_rpc *rpc) +raft_send_at(struct raft *raft, const union raft_rpc *rpc, int line_number) { const struct uuid *dst = &rpc->common.sid; if (uuid_equals(dst, &raft->sid)) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); - VLOG_WARN_RL(&rl, "attempting to send RPC to self"); + VLOG_WARN_RL(&rl, "attempted to send RPC to self from raft.c:%d", + line_number); return false; } @@ -4035,9 +4047,10 @@ raft_send(struct raft *raft, const union raft_rpc *rpc) if (!conn) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); char buf[SID_LEN + 1]; - VLOG_DBG_RL(&rl, "%s: no connection to %s, cannot send RPC", - raft->local_nickname, - raft_get_nickname(raft, dst, buf, sizeof buf)); + VLOG_DBG_RL(&rl, "%s: no connection to %s, cannot send RPC " + "from raft.c:%d", raft->local_nickname, + raft_get_nickname(raft, dst, buf, sizeof buf), + line_number); return false; } @@ -4046,7 +4059,7 @@ raft_send(struct raft *raft, const union raft_rpc *rpc) return true; } - return raft_send__(raft, rpc, conn); + return raft_send_to_conn_at(raft, rpc, conn, line_number); } static struct raft * From patchwork Thu Nov 15 06:05:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wW9X4W5bz9s9G for ; Thu, 15 Nov 2018 17:07:28 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D3109B7E; Thu, 15 Nov 2018 06:05:48 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 93A55B79 for ; Thu, 15 Nov 2018 06:05:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E776C8B for ; Thu, 15 Nov 2018 06:05:46 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 55CAA240003; Thu, 15 Nov 2018 06:05:44 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:28 -0800 Message-Id: <20181115060534.7146-4-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181115060534.7146-1-blp@ovn.org> References: <20181115060534.7146-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 04/10] raft: Avoid use-after-free error in raft_update_commit_index(). X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org raft_update_commit_index() iterates over a sequence of entries that may have up to two components: a set of servers and a piece of data. When a set of servers is present, it calls raft_run_reconfigure(), which can call through the following chain of functions in some cases: raft_log_reconfiguration() raft_command_execute__() raft_command_initiate() raft_write_entry() raft_add_entry() and raft_add_entry() can reallocate raft->entries, which turns the pointer 'e' that raft_update_commit_index() has to the current entry into a wild pointer. This commit fixes the problem. Signed-off-by: Ben Pfaff --- ovsdb/raft.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ovsdb/raft.c b/ovsdb/raft.c index 6c5c6068f1ac..b682738a92f6 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -2567,9 +2567,6 @@ raft_update_commit_index(struct raft *raft, uint64_t new_commit_index) while (raft->commit_index < new_commit_index) { uint64_t index = ++raft->commit_index; const struct raft_entry *e = raft_get_entry(raft, index); - if (e->servers) { - raft_run_reconfigure(raft); - } if (e->data) { struct raft_command *cmd = raft_find_command_by_index(raft, index); @@ -2577,6 +2574,12 @@ raft_update_commit_index(struct raft *raft, uint64_t new_commit_index) raft_command_complete(raft, cmd, RAFT_CMD_SUCCESS); } } + if (e->servers) { + /* raft_run_reconfigure() can write a new Raft entry, which can + * reallocate raft->entries, which would invalidate 'e', so + * this case must be last, after the one for 'e->data'. */ + raft_run_reconfigure(raft); + } } } else { raft->commit_index = new_commit_index; From patchwork Thu Nov 15 06:05:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998094 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wWB93CK8z9s8F for ; Thu, 15 Nov 2018 17:08:01 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 731D4B8A; Thu, 15 Nov 2018 06:05:50 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 96DD4B7D for ; Thu, 15 Nov 2018 06:05:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 75BCF8B for ; Thu, 15 Nov 2018 06:05:48 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 1AE8D240005; Thu, 15 Nov 2018 06:05:45 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:29 -0800 Message-Id: <20181115060534.7146-5-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181115060534.7146-1-blp@ovn.org> References: <20181115060534.7146-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 05/10] raft: Avoid null dereference in raft_update_our_match_index(). X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org When the server is leaving the cluster but remains leader, the raft_find_server() call can return NULL. Previously this caused a null dereference. This commit fixes the problem. Signed-off-by: Ben Pfaff --- ovsdb/raft.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ovsdb/raft.c b/ovsdb/raft.c index b682738a92f6..07884820ed9b 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -3045,8 +3045,10 @@ raft_update_match_index(struct raft *raft, struct raft_server *s, static void raft_update_our_match_index(struct raft *raft, uint64_t min_index) { - raft_update_match_index(raft, raft_find_server(raft, &raft->sid), - min_index); + struct raft_server *server = raft_find_server(raft, &raft->sid); + if (server) { + raft_update_match_index(raft, server, min_index); + } } static void From patchwork Thu Nov 15 06:05:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wWBd6Nrtz9s8F for ; Thu, 15 Nov 2018 17:08:25 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 17798B8C; Thu, 15 Nov 2018 06:05:53 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 916F5B8B for ; Thu, 15 Nov 2018 06:05:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 971C18B for ; Thu, 15 Nov 2018 06:05:50 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id B1B83240002; Thu, 15 Nov 2018 06:05:47 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:30 -0800 Message-Id: <20181115060534.7146-6-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181115060534.7146-1-blp@ovn.org> References: <20181115060534.7146-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: ramteja tadishetti , Ben Pfaff Subject: [ovs-dev] [PATCH 06/10] raft: Fix notifications when a server leaves the cluster. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org When server A sends the leader a request to remove server B from the cluster, where A != B, the leader sends both A and B a notification when the removal is complete. Until now, however, the notification (which is a raft_remove_server_reply message) did not say which server had been removed, and the receiver did not check. Instead, the receiver assumed that it had been removed. The result was that B was removed and A stopped serving out the database even though it was still part of the cluster, This commit fixes the problem. Reported-by: ramteja tadishetti Signed-off-by: Ben Pfaff --- ovsdb/raft-rpc.c | 5 +++++ ovsdb/raft-rpc.h | 7 +++++++ ovsdb/raft.c | 50 ++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/ovsdb/raft-rpc.c b/ovsdb/raft-rpc.c index 13aee0c4bac5..56c07d4879ba 100644 --- a/ovsdb/raft-rpc.c +++ b/ovsdb/raft-rpc.c @@ -460,6 +460,10 @@ static void raft_remove_server_reply_to_jsonrpc(const struct raft_remove_server_reply *rpy, struct json *args) { + if (!uuid_is_zero(&rpy->target_sid)) { + json_object_put_format(args, "target_server", + UUID_FMT, UUID_ARGS(&rpy->target_sid)); + } json_object_put(args, "success", json_boolean_create(rpy->success)); } @@ -468,6 +472,7 @@ raft_remove_server_reply_from_jsonrpc(struct ovsdb_parser *p, struct raft_remove_server_reply *rpy) { rpy->success = raft_parse_required_boolean(p, "success"); + raft_parse_optional_uuid(p, "target_server", &rpy->target_sid); } static void diff --git a/ovsdb/raft-rpc.h b/ovsdb/raft-rpc.h index 15ddf012838c..bdc3429cc67c 100644 --- a/ovsdb/raft-rpc.h +++ b/ovsdb/raft-rpc.h @@ -205,6 +205,13 @@ struct raft_add_server_reply { struct raft_remove_server_reply { struct raft_rpc_common common; bool success; + + /* SID of the removed server, but all-zeros if it is the same as the + * destination of the RPC. (Older ovsdb-server did not have 'target_sid' + * and assumed that the destination was always the target, so by omitting + * 'target_sid' when this is the case we can preserve a small amount of + * inter-version compatibility.) */ + struct uuid target_sid; }; struct raft_install_snapshot_request { diff --git a/ovsdb/raft.c b/ovsdb/raft.c index 07884820ed9b..753881586334 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -296,6 +296,7 @@ static void raft_send_remove_server_reply__( struct raft *, const struct uuid *target_sid, const struct uuid *requester_sid, struct unixctl_conn *requester_conn, bool success, const char *comment); +static void raft_finished_leaving_cluster(struct raft *); static void raft_server_init_leader(struct raft *, struct raft_server *); @@ -303,6 +304,7 @@ static bool raft_rpc_is_heartbeat(const union raft_rpc *); static bool raft_is_rpc_synced(const struct raft *, const union raft_rpc *); static void raft_handle_rpc(struct raft *, const union raft_rpc *); + static bool raft_send_at(struct raft *, const union raft_rpc *, int line_number); #define raft_send(raft, rpc) raft_send_at(raft, rpc, __LINE__) @@ -2197,16 +2199,28 @@ raft_send_add_server_reply__(struct raft *raft, const struct uuid *sid, } static void -raft_send_remove_server_reply_rpc(struct raft *raft, const struct uuid *sid, +raft_send_remove_server_reply_rpc(struct raft *raft, + const struct uuid *dst_sid, + const struct uuid *target_sid, bool success, const char *comment) { + if (uuid_equals(&raft->sid, dst_sid)) { + if (success && uuid_equals(&raft->sid, target_sid)) { + raft_finished_leaving_cluster(raft); + } + return; + } + const union raft_rpc rpy = { .remove_server_reply = { .common = { .type = RAFT_RPC_REMOVE_SERVER_REPLY, - .sid = *sid, + .sid = *dst_sid, .comment = CONST_CAST(char *, comment), }, + .target_sid = (uuid_equals(dst_sid, target_sid) + ? UUID_ZERO + : *target_sid), .success = success, } }; @@ -2235,6 +2249,9 @@ raft_send_remove_server_reply__(struct raft *raft, } else { char buf[SID_LEN + 1]; ds_put_cstr(&s, raft_get_nickname(raft, target_sid, buf, sizeof buf)); + if (uuid_equals(target_sid, &raft->sid)) { + ds_put_cstr(&s, " (ourselves)"); + } } ds_put_format(&s, " from cluster "CID_FMT" %s", CID_ARGS(&raft->cid), @@ -2251,11 +2268,12 @@ raft_send_remove_server_reply__(struct raft *raft, * allows it to be sure that it's really removed and update its log and * disconnect permanently. */ if (!uuid_is_zero(requester_sid)) { - raft_send_remove_server_reply_rpc(raft, requester_sid, + raft_send_remove_server_reply_rpc(raft, requester_sid, target_sid, success, comment); } if (!uuid_equals(requester_sid, target_sid)) { - raft_send_remove_server_reply_rpc(raft, target_sid, success, comment); + raft_send_remove_server_reply_rpc(raft, target_sid, target_sid, + success, comment); } if (requester_conn) { if (success) { @@ -3559,17 +3577,25 @@ raft_handle_remove_server_request(struct raft *raft, } static void -raft_handle_remove_server_reply(struct raft *raft, - const struct raft_remove_server_reply *rpc) +raft_finished_leaving_cluster(struct raft *raft) { - if (rpc->success) { - VLOG_INFO(SID_FMT": finished leaving cluster "CID_FMT, - SID_ARGS(&raft->sid), CID_ARGS(&raft->cid)); + VLOG_INFO(SID_FMT": finished leaving cluster "CID_FMT, + SID_ARGS(&raft->sid), CID_ARGS(&raft->cid)); - raft_record_note(raft, "left", "this server left the cluster"); + raft_record_note(raft, "left", "this server left the cluster"); + + raft->leaving = false; + raft->left = true; +} - raft->leaving = false; - raft->left = true; +static void +raft_handle_remove_server_reply(struct raft *raft, + const struct raft_remove_server_reply *rpc) +{ + if (rpc->success + && (uuid_is_zero(&rpc->target_sid) + || uuid_equals(&rpc->target_sid, &raft->sid))) { + raft_finished_leaving_cluster(raft); } } From patchwork Thu Nov 15 06:05:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wWC66lLLz9s8F for ; Thu, 15 Nov 2018 17:08:50 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B8D9BB9B; Thu, 15 Nov 2018 06:05:53 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id A2CFFB93 for ; Thu, 15 Nov 2018 06:05:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1B3398B for ; Thu, 15 Nov 2018 06:05:51 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id A6A52240003; Thu, 15 Nov 2018 06:05:49 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:31 -0800 Message-Id: <20181115060534.7146-7-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181115060534.7146-1-blp@ovn.org> References: <20181115060534.7146-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 07/10] packets: Fix use-after-free error in packet_put_ra_prefix_opt(). X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org dp_packet_put_uninit() can reallocate the data buffer, so find the L4 header pointer afterward instead of before. Found by Address Sanitizer. Signed-off-by: Ben Pfaff --- lib/packets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/packets.c b/lib/packets.c index 38bfb6015b9e..2d6f77b919a5 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -1613,7 +1613,6 @@ packet_put_ra_prefix_opt(struct dp_packet *b, struct ip6_hdr *nh = dp_packet_l3(b); nh->ip6_plen = htons(prev_l4_size + ND_PREFIX_OPT_LEN); - struct ovs_ra_msg *ra = dp_packet_l4(b); struct ovs_nd_prefix_opt *prefix_opt = dp_packet_put_uninit(b, sizeof *prefix_opt); prefix_opt->type = ND_OPT_PREFIX_INFORMATION; @@ -1625,6 +1624,7 @@ packet_put_ra_prefix_opt(struct dp_packet *b, put_16aligned_be32(&prefix_opt->reserved, 0); memcpy(prefix_opt->prefix.be32, prefix.be32, sizeof(ovs_be32[4])); + struct ovs_ra_msg *ra = dp_packet_l4(b); ra->icmph.icmp6_cksum = 0; uint32_t icmp_csum = packet_csum_pseudoheader6(dp_packet_l3(b)); ra->icmph.icmp6_cksum = csum_finish(csum_continue( From patchwork Thu Nov 15 06:05:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wWDr0PTZz9sCw for ; Thu, 15 Nov 2018 17:10:20 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1CC51BC4; Thu, 15 Nov 2018 06:06:03 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 74073BA0 for ; Thu, 15 Nov 2018 06:05:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 405DF8B for ; Thu, 15 Nov 2018 06:05:53 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 4A934240005; Thu, 15 Nov 2018 06:05:50 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:32 -0800 Message-Id: <20181115060534.7146-8-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181115060534.7146-1-blp@ovn.org> References: <20181115060534.7146-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 08/10] tests: Always use --no-chdir with --detach. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org With --detach but not --no-chdir, core files and Address Sanitizer logs don't go into the testsuite directory but end up dropped because it tries to write them in the root directory. Signed-off-by: Ben Pfaff --- tests/bridge.at | 4 +- tests/daemon-py.at | 12 ++--- tests/jsonrpc-py.at | 6 +-- tests/ofproto-dpif.at | 110 +++++++++++++++++++++---------------------- tests/ovn-controller-vtep.at | 6 +-- tests/ovn-nbctl.at | 2 +- tests/ovn-sbctl.at | 4 +- tests/ovs-ofctl.at | 4 +- tests/ovsdb-lock.at | 12 ++--- tests/ovsdb-monitor.at | 2 +- tests/ovsdb-server.at | 20 ++++---- tests/unixctl-py.at | 2 +- tests/vlog.at | 24 +++++----- 13 files changed, 104 insertions(+), 104 deletions(-) diff --git a/tests/bridge.at b/tests/bridge.at index ee398bdb1e13..12d6e2eab165 100644 --- a/tests/bridge.at +++ b/tests/bridge.at @@ -48,7 +48,7 @@ OVS_VSWITCHD_START( set bridge br1 datapath-type=dummy other-config:datapath-id=1234 ]) dnl Start ovs-testcontroller -AT_CHECK([ovs-testcontroller --detach punix:controller --pidfile], [0], [ignore]) +AT_CHECK([ovs-testcontroller --detach --no-chdir punix:controller --pidfile], [0], [ignore]) on_exit 'kill `cat ovs-testcontroller.pid`' OVS_WAIT_UNTIL([test -e controller]) @@ -84,7 +84,7 @@ AT_SETUP([bridge - add port after stopping controller]) OVS_VSWITCHD_START dnl Start ovs-testcontroller -ovs-testcontroller --detach punix:controller --pidfile=ovs-testcontroller.pid +ovs-testcontroller --no-chdir --detach punix:controller --pidfile=ovs-testcontroller.pid OVS_WAIT_UNTIL([test -e controller]) AT_CHECK([ovs-vsctl set-controller br0 unix:controller]) diff --git a/tests/daemon-py.at b/tests/daemon-py.at index 82852383b1f5..b7236b1f3622 100644 --- a/tests/daemon-py.at +++ b/tests/daemon-py.at @@ -122,7 +122,7 @@ m4_define([DAEMON_DETACH_PYN], # Start the daemon and make sure that the pidfile exists immediately. # We don't wait for the pidfile to get created because the daemon is # supposed to do so before the parent exits. - AT_CHECK([$3 $srcdir/test-daemon.py --pidfile=pid --detach], [0]) + AT_CHECK([$3 $srcdir/test-daemon.py --pidfile=pid --detach --no-chdir], [0]) AT_CHECK([test -s pid]) AT_CHECK([kill -0 `cat pid`]) # Kill the daemon and make sure that the pidfile gets deleted. @@ -149,7 +149,7 @@ m4_define([DAEMON_DETACH_MONITOR_PYN], # Start the daemon and make sure that the pidfile exists immediately. # We don't wait for the pidfile to get created because the daemon is # supposed to do so before the parent exits. - AT_CHECK([$3 $srcdir/test-daemon.py --pidfile=daemon --detach --monitor], [0]) + AT_CHECK([$3 $srcdir/test-daemon.py --pidfile=daemon --detach --no-chdir --monitor], [0]) on_exit 'kill `cat daemon olddaemon newdaemon monitor`' AT_CHECK([test -s daemon]) # Check that the pidfile names a running process, @@ -190,7 +190,7 @@ m4_define([DAEMON_DETACH_ERRORS_PYN], [AT_SETUP([daemon --detach startup errors - $1]) AT_SKIP_IF([test $2 = no]) AT_CAPTURE_FILE([pid]) - AT_CHECK([$3 $srcdir/test-daemon.py --pidfile=pid --detach --bail], [1], [], [stderr]) + AT_CHECK([$3 $srcdir/test-daemon.py --pidfile=pid --detach --no-chdir --bail], [1], [], [stderr]) AT_CHECK([grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr], [0], [ignore], []) AT_CHECK([test ! -s pid]) @@ -203,7 +203,7 @@ m4_define([DAEMON_DETACH_MONITOR_ERRORS_PYN], [AT_SETUP([daemon --detach --monitor startup errors - $1]) AT_SKIP_IF([test $2 = no]) AT_CAPTURE_FILE([pid]) - AT_CHECK([$3 $srcdir/test-daemon.py --pidfile=pid --detach --monitor --bail], [1], [], [stderr]) + AT_CHECK([$3 $srcdir/test-daemon.py --pidfile=pid --detach --no-chdir --monitor --bail], [1], [], [stderr]) AT_CHECK([grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr], [0], [ignore], []) AT_CHECK([test ! -s pid]) @@ -220,7 +220,7 @@ m4_define([DAEMON_DETACH_CLOSES_FDS_PYN], AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([status]) AT_CAPTURE_FILE([stderr]) - AT_CHECK([(yes 2>stderr; echo $? > status) | $3 $srcdir/test-daemon.py --pidfile=pid --detach]) + AT_CHECK([(yes 2>stderr; echo $? > status) | $3 $srcdir/test-daemon.py --pidfile=pid --detach --no-chdir]) AT_CHECK([kill `cat pid`]) AT_CHECK([test -s status]) if grep '[[bB]]roken pipe' stderr >/dev/null 2>&1; then @@ -247,7 +247,7 @@ m4_define([DAEMON_DETACH_MONITOR_CLOSES_FDS_PYN], AT_CAPTURE_FILE([status]) AT_CAPTURE_FILE([stderr]) OVSDB_INIT([db]) - AT_CHECK([(yes 2>stderr; echo $? > status) | $3 $srcdir/test-daemon.py --pidfile=pid --detach], [0], [], []) + AT_CHECK([(yes 2>stderr; echo $? > status) | $3 $srcdir/test-daemon.py --pidfile=pid --detach --no-chdir], [0], [], []) AT_CHECK([kill `cat pid`]) AT_CHECK([test -s status]) if grep '[[bB]]roken pipe' stderr >/dev/null 2>&1; then diff --git a/tests/jsonrpc-py.at b/tests/jsonrpc-py.at index 977b029c1dc0..e75ac4551006 100644 --- a/tests/jsonrpc-py.at +++ b/tests/jsonrpc-py.at @@ -4,7 +4,7 @@ m4_define([JSONRPC_REQ_REPLY_SUCCESS_PYN], [AT_SETUP([JSON-RPC request and successful reply - $1]) AT_SKIP_IF([test $2 = no]) AT_KEYWORDS([python jsonrpc]) - AT_CHECK([$3 $srcdir/test-jsonrpc.py --pidfile --detach listen punix:socket]) + AT_CHECK([$3 $srcdir/test-jsonrpc.py --pidfile --detach --no-chdir listen punix:socket]) on_exit 'kill `cat test-jsonrpc.py.pid`' AT_CHECK( [[$3 $srcdir/test-jsonrpc.py request unix:socket echo '[{"a": "b", "x": null}]']], [0], @@ -19,7 +19,7 @@ m4_define([JSONRPC_REQ_REPLY_ERROR_PYN], [AT_SETUP([JSON-RPC request and error reply - $1]) AT_SKIP_IF([test $2 = no]) AT_KEYWORDS([python jsonrpc]) - AT_CHECK([$3 $srcdir/test-jsonrpc.py --pidfile --detach listen punix:socket]) + AT_CHECK([$3 $srcdir/test-jsonrpc.py --pidfile --detach --no-chdir listen punix:socket]) on_exit 'kill `cat test-jsonrpc.py.pid`' AT_CHECK( [[$3 $srcdir/test-jsonrpc.py request unix:socket bad-request '[]']], [0], @@ -34,7 +34,7 @@ m4_define([JSONRPC_NOTIFICATION_PYN], [AT_SETUP([JSON-RPC notification - $1]) AT_SKIP_IF([test $2 = no]) AT_KEYWORDS([python jsonrpc]) - AT_CHECK([$3 $srcdir/test-jsonrpc.py --pidfile --detach listen punix:socket]) + AT_CHECK([$3 $srcdir/test-jsonrpc.py --pidfile --detach --no-chdir listen punix:socket]) on_exit 'kill `cat test-jsonrpc.py.pid`' AT_CHECK([test -e test-jsonrpc.py.pid]) AT_CHECK([[$3 $srcdir/test-jsonrpc.py notify unix:socket shutdown '[]']]) diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 4f7e47e192d8..ea51467cc154 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -1648,7 +1648,7 @@ tcp,dl_vlan=15,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=30:33:33:33:33:33,dl_dst=50 ]) dnl Modified VLAN controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:41,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' @@ -1744,7 +1744,7 @@ udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82 ]) dnl Modified ARP controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' @@ -1995,7 +1995,7 @@ cookie=0x5 dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mp AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=17,tos=0,ttl=64,frag=no),udp(src=7777,dst=80)' @@ -2015,7 +2015,7 @@ mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_labe ]) dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=41:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' @@ -2035,7 +2035,7 @@ ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192. ]) dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1) @@ -2057,7 +2057,7 @@ mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_labe ]) dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:44,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no))' @@ -2077,7 +2077,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=40:44:44:44:44:44,dl_dst=5 ]) dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:45,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' @@ -2097,7 +2097,7 @@ mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_labe ]) dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:46,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' @@ -2117,7 +2117,7 @@ mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_labe ]) dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:47,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' @@ -2139,7 +2139,7 @@ mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_labe AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:49,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=64,bos=1)' @@ -2161,7 +2161,7 @@ mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_lab AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:48,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' @@ -2181,7 +2181,7 @@ mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_labe ]) dnl Modified MPLS actions. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:55:55:55:55:55,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)' @@ -2201,7 +2201,7 @@ mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_labe ]) dnl Modified MPLS ipv6 controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=70:77:77:77:77:77,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)' @@ -2226,7 +2226,7 @@ dnl The input is a frame with two MPLS headers which tcpdump -vve shows as: dnl 60:66:66:66:66:66 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32) dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44) -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 66 66 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2255,7 +2255,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2281,7 +2281,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:02 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 02 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2307,7 +2307,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:03 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 03 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2333,7 +2333,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:04 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 04 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2359,7 +2359,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:05 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 05 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2385,7 +2385,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:06 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 06 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2411,7 +2411,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:07 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 07 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2435,7 +2435,7 @@ AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) dnl Modified MPLS pop action. dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as: dnl 60:66:66:66:00:08 > ff:ff:ff:ff:ff:ff, ethertype MPLS unicast (0x8847), length 46: MPLS (label 20, exp 0, [S], ttl 32) -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'ff ff ff ff ff ff 60 66 66 66 00 08 88 47 00 01 41 20 00 01 08 00 06 04 00 02 60 66 66 66 00 08 c0 a8 00 01 ff ff ff ff ff ff ff ff ff ff' @@ -2461,7 +2461,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:09 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 09 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2487,7 +2487,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:0a > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0a 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2513,7 +2513,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:0b > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0b 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2540,7 +2540,7 @@ dnl 60:66:66:66:01:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), le dnl (label 20, exp 0, [S], ttl 31) dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 00 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2567,7 +2567,7 @@ dnl 60:66:66:66:01:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), leng dnl (label 20, exp 0, [S], ttl 31) dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 01 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2594,7 +2594,7 @@ dnl 60:66:66:66:01:02 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), le dnl (label 20, exp 0, [S], ttl 31) dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 02 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2621,7 +2621,7 @@ dnl 60:66:66:66:02:00 > 50:54:00:00:02:00, ethertype MPLS unicast (0x8847), leng dnl (label 20, exp 0, [S], ttl 31) dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 00 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2648,7 +2648,7 @@ dnl 60:66:66:66:02:01 > 50:54:00:00:02:01, ethertype MPLS multicast (0x8848), le dnl (label 20, exp 0, [S], ttl 31) dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 01 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2676,7 +2676,7 @@ dnl 60:66:66:66:02:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), leng dnl (label 20, exp 0, [S], ttl 31) dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 10 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2704,7 +2704,7 @@ dnl (label 20, exp 0, ttl 31) dnl (label 20, exp 0, [S], ttl 30) dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 00 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2732,7 +2732,7 @@ dnl (label 20, exp 0, ttl 31) dnl (label 20, exp 0, [S], ttl 30) dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 01 88 48 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2760,7 +2760,7 @@ dnl (label 20, exp 0, ttl 31) dnl (label 20, exp 0, [S], ttl 30) dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 10 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2786,7 +2786,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:04:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 00 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2812,7 +2812,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:04:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 01 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2838,7 +2838,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:04:10 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 10 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2864,7 +2864,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:05:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 00 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2891,7 +2891,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:05:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -2917,7 +2917,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:05:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 10 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -3004,7 +3004,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -3053,7 +3053,7 @@ dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 -AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' @@ -3742,7 +3742,7 @@ dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt]) dnl In this test, we push an MPLS tag to an ethernet packet. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:00,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' @@ -3785,7 +3785,7 @@ mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_labe dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be dnl copied exactly, except for the BOS bit. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:01,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)' @@ -3814,7 +3814,7 @@ dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be dnl copied exactly, except for the BOS bit. The ethertype should be updated dnl to the MPLS ethertype of the MPLS push action which differs to that dnl of the input packet. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:02,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)' @@ -3866,7 +3866,7 @@ AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt]) dnl Modified MPLS controller action. dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see dnl both of these in the final flow -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:50,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' @@ -3910,7 +3910,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:50,dl_dst=5 dnl Modified MPLS controller action. dnl In this test, the input packet is vlan-tagged, which should be kept as dnl inner vlan. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:51,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' @@ -3957,7 +3957,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:5 dnl Modified MPLS controller action. dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see dnl both of these in the final flow -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:52,dst=52:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' @@ -4001,7 +4001,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:52,dl_dst=5 dnl Modified MPLS controller action. dnl In this test, the input packet is vlan-tagged, which should be kept as dnl inner vlan. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:53,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' @@ -4048,7 +4048,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:5 dnl Modified MPLS controller action. dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these dnl actions are reordered, so we see both of these in the final flow. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:54,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' @@ -4092,7 +4092,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:54,dl_dst=5 dnl Modified MPLS controller action. dnl In this test, the input packet is vlan-tagged, which should be kept as dnl inner vlan. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:55,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' @@ -4139,7 +4139,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:5 dnl Modified MPLS controller action. dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these dnl actions are reordered, so we see both of these in the final flow. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:56,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' @@ -4183,7 +4183,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:56,dl_dst=5 dnl Modified MPLS controller action. dnl In this test, the input packet is vlan-tagged, which should be kept as dnl inner vlan. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:57,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' @@ -4230,7 +4230,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:5 dnl Modified MPLS controller action. dnl In this test, the input packet is vlan-tagged, which should be kept as dnl inner vlan. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:58,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' @@ -4274,7 +4274,7 @@ mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:58,dl_dst=5 dnl Modified MPLS controller action. dnl In this test, the input packet is vlan-tagged, which should be modified dnl before we push MPLS and VLAN tags. -AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:59,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at index 416e9549c82c..676cbe39110c 100644 --- a/tests/ovn-controller-vtep.at +++ b/tests/ovn-controller-vtep.at @@ -52,7 +52,7 @@ m4_define([OVN_CONTROLLER_VTEP_START], dnl Start ovs-vtep. AT_CHECK([vtep-ctl add-ps br-vtep -- set Physical_Switch br-vtep tunnel_ips=1.2.3.4]) - AT_CHECK([ovs-vtep --log-file=ovs-vtep.log --pidfile=ovs-vtep.pid --detach br-vtep \], [0], [], [stderr]) + AT_CHECK([ovs-vtep --log-file=ovs-vtep.log --pidfile=ovs-vtep.pid --detach --no-chdir br-vtep \], [0], [], [stderr]) on_exit "kill `cat ovs-vtep.pid`" AT_CHECK([[sed < stderr ' /vlog|INFO|opened log file/d']]) @@ -61,14 +61,14 @@ m4_define([OVN_CONTROLLER_VTEP_START], dnl Start ovn-northd. AT_CHECK([ovn-nbctl ls-add br-test]) - AT_CHECK([ovn-northd --detach --pidfile --log-file], [0], [], [stderr]) + AT_CHECK([ovn-northd --detach --no-chdir --pidfile --log-file], [0], [], [stderr]) on_exit "kill `cat ovn-northd.pid`" AT_CHECK([[sed < stderr ' /vlog|INFO|opened log file/d']]) AT_CAPTURE_FILE([ovn-northd.log]) dnl Start ovn-controllger-vtep. - AT_CHECK([ovn-controller-vtep --detach --pidfile --log-file --vtep-db=unix:$OVS_RUNDIR/db.sock --ovnsb-db=unix:$OVS_RUNDIR/ovnsb_db.sock], [0], [], [stderr]) + AT_CHECK([ovn-controller-vtep --detach --no-chdir --pidfile --log-file --vtep-db=unix:$OVS_RUNDIR/db.sock --ovnsb-db=unix:$OVS_RUNDIR/ovnsb_db.sock], [0], [], [stderr]) AT_CAPTURE_FILE([ovn-controller-vtep.log]) on_exit "kill `cat ovn-controller-vtep.pid`" AT_CHECK([[sed < stderr ' diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at index 25414b8bdb54..f55277ceec25 100644 --- a/tests/ovn-nbctl.at +++ b/tests/ovn-nbctl.at @@ -15,7 +15,7 @@ ovn_nbctl_test_start() { on_exit "kill `cat ovsdb-server.pid`" AS_CASE([$1], [daemon], - [export OVN_NB_DAEMON=$(ovn-nbctl --pidfile --detach --log-file -vsocket_util:off) + [export OVN_NB_DAEMON=$(ovn-nbctl --pidfile --detach --no-chdir --log-file -vsocket_util:off) on_exit "kill `cat ovn-nbctl.pid`"], [direct], [], [*], [AT_FAIL_IF(:)]) diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at index df9a8a24f578..1266b56d0575 100644 --- a/tests/ovn-sbctl.at +++ b/tests/ovn-sbctl.at @@ -18,7 +18,7 @@ m4_define([OVN_SBCTL_TEST_START], AT_CAPTURE_FILE([ovsdb-server.log]) dnl Start ovn-northd. - AT_CHECK([ovn-northd --detach --pidfile --log-file --ovnnb-db=unix:$OVS_RUNDIR/ovnnb_db.sock --ovnsb-db=unix:$OVS_RUNDIR/ovnsb_db.sock], [0], [], [stderr]) + AT_CHECK([ovn-northd --detach --no-chdir --pidfile --log-file --ovnnb-db=unix:$OVS_RUNDIR/ovnnb_db.sock --ovnsb-db=unix:$OVS_RUNDIR/ovnsb_db.sock], [0], [], [stderr]) on_exit "kill `cat ovn-northd.pid`" AT_CHECK([[sed < stderr ' /vlog|INFO|opened log file/d']]) @@ -147,4 +147,4 @@ inactivity_probe : 30000 ]) OVN_SBCTL_TEST_STOP -AT_CLEANUP \ No newline at end of file +AT_CLEANUP diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 9df8aa33aa40..6ae347042578 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -3206,11 +3206,11 @@ AT_CHECK([ovs-vsctl -vsyslog:off set-controller br0 unix:testcontroller]) dnl then start listening on the '.snoop' connection on_exit 'kill `cat ovs-ofctl-snoop.pid`' -AT_CHECK([ovs-ofctl -vsyslog:off --detach --pidfile=ovs-ofctl-snoop.pid snoop br0 > snoopbr0.txt 2>&1]) +AT_CHECK([ovs-ofctl -vsyslog:off --detach --no-chdir --pidfile=ovs-ofctl-snoop.pid snoop br0 > snoopbr0.txt 2>&1]) dnl finally start the controller on_exit 'kill `cat ovs-testcontroller.pid`' -AT_CHECK([ovs-testcontroller -vsyslog:off --detach --pidfile punix:testcontroller], [0], [ignore]) +AT_CHECK([ovs-testcontroller -vsyslog:off --detach --no-chdir --pidfile punix:testcontroller], [0], [ignore]) OVS_WAIT_UNTIL([test -e testcontroller]) dnl check for some of the initial handshake messages diff --git a/tests/ovsdb-lock.at b/tests/ovsdb-lock.at index 7152c5d34cde..a3acd2f27a03 100644 --- a/tests/ovsdb-lock.at +++ b/tests/ovsdb-lock.at @@ -19,9 +19,9 @@ m4_define([OVSDB_CHECK_LOCK_SETUP], # Two sessions create two locks. Both sessions should be able to get their # own lock immediately. OVSDB_CHECK_LOCK_SETUP([lock], [positive]) -AT_CHECK([ovsdb-client --detach lock unix:socket lock0 >c1-output 2>&1], +AT_CHECK([ovsdb-client --detach --no-chdir lock unix:socket lock0 >c1-output 2>&1], [0], [], []) -AT_CHECK([ovsdb-client --detach lock unix:socket lock1 >c2-output 2>&1], +AT_CHECK([ovsdb-client --detach --no-chdir lock unix:socket lock1 >c2-output 2>&1], [0], [], []) OVS_APP_EXIT_AND_WAIT([ovsdb-server]) AT_CHECK([cat c1-output], 0, [{"locked":true} @@ -35,9 +35,9 @@ AT_CLEANUP # to get the lock immediately, the second session will get a notification # after the first session unlocks. OVSDB_CHECK_LOCK_SETUP([unlock], [positive]) -AT_CHECK([ovsdb-client --detach --pidfile lock unix:socket lock0 >c1-output 2>&1], +AT_CHECK([ovsdb-client --detach --no-chdir --pidfile lock unix:socket lock0 >c1-output 2>&1], [0], [], []) -AT_CHECK([ovsdb-client --detach lock unix:socket lock0 >c2-output 2>&1], +AT_CHECK([ovsdb-client --detach --no-chdir lock unix:socket lock0 >c2-output 2>&1], [0], [], []) AT_CHECK([ovs-appctl -t ovsdb-client unlock lock0], [0], [], []) OVS_APP_EXIT_AND_WAIT([ovsdb-server]) @@ -55,9 +55,9 @@ AT_CLEANUP # to get the lock immediately. The second session tries to steal the lock, then # unlocks the lock. OVSDB_CHECK_LOCK_SETUP([steal], [positive]) -AT_CHECK([ovsdb-client --detach lock unix:socket lock0 >c1-output 2>&1], +AT_CHECK([ovsdb-client --detach --no-chdir lock unix:socket lock0 >c1-output 2>&1], [0], [], []) -AT_CHECK([ovsdb-client --detach --pidfile steal unix:socket lock0 >c2-output 2>&1], +AT_CHECK([ovsdb-client --detach --no-chdir --pidfile steal unix:socket lock0 >c2-output 2>&1], [0], [], []) AT_CHECK([ovs-appctl -t ovsdb-client unlock lock0], [0], [], []) OVS_APP_EXIT_AND_WAIT([ovsdb-server]) diff --git a/tests/ovsdb-monitor.at b/tests/ovsdb-monitor.at index 5458d422e240..dca7cadc1bd1 100644 --- a/tests/ovsdb-monitor.at +++ b/tests/ovsdb-monitor.at @@ -21,7 +21,7 @@ ovsdb_check_monitor () { [0], [ignore], [ignore]) sleep 1 else - AT_CHECK([ovsdb-client -vjsonrpc --detach --pidfile --log-file -d json monitor --format=csv unix:socket $db $table $columns > output 2> ovsdb-client.stderr], + AT_CHECK([ovsdb-client -vjsonrpc --detach --no-chdir --pidfile --log-file -d json monitor --format=csv unix:socket $db $table $columns > output 2> ovsdb-client.stderr], [0], [ignore], [ignore]) fi on_exit 'kill `cat ovsdb-client.pid`' diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index add815c71f1f..4a71efbd5d7f 100644 --- a/tests/ovsdb-server.at +++ b/tests/ovsdb-server.at @@ -185,8 +185,8 @@ AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/remove-db ordinals], [0]) CHECK_DBS([]) # Start monitoring processes. -AT_CHECK([ovsdb-client --detach --pidfile=ovsdb-client-1.pid --no-db-change-aware --no-headings monitor _Server Database name > db-change-unaware.stdout 2> db-change-unaware.stderr]) -AT_CHECK([ovsdb-client --detach --pidfile=ovsdb-client-2.pid --db-change-aware --no-headings monitor _Server Database name > db-change-aware.stdout 2> db-change-aware.stderr]) +AT_CHECK([ovsdb-client --detach --no-chdir --pidfile=ovsdb-client-1.pid --no-db-change-aware --no-headings monitor _Server Database name > db-change-unaware.stdout 2> db-change-unaware.stderr]) +AT_CHECK([ovsdb-client --detach --no-chdir --pidfile=ovsdb-client-2.pid --db-change-aware --no-headings monitor _Server Database name > db-change-aware.stdout 2> db-change-aware.stderr]) AT_CAPTURE_FILE([db-change-unaware.stdout]) AT_CAPTURE_FILE([db-change-unaware.stderr]) AT_CAPTURE_FILE([db-change-aware.stdout]) @@ -888,24 +888,24 @@ ovsdb_check_online_conversion() { dnl Start two monitors on the 'ordinals' db, one that is database dnl change aware and one that is not. - AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --pidfile=monitor-ordinals-aware.pid --log-file=monitor-ordinals-aware.log --db-change-aware --no-headings monitor ordinals ordinals number name > monitor-ordinals-aware.stdout 2> monitor-ordinals-aware.stderr]) + AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --no-chdir --pidfile=monitor-ordinals-aware.pid --log-file=monitor-ordinals-aware.log --db-change-aware --no-headings monitor ordinals ordinals number name > monitor-ordinals-aware.stdout 2> monitor-ordinals-aware.stderr]) AT_CAPTURE_FILE([monitor-ordinals-aware.stdout]) AT_CAPTURE_FILE([monitor-ordinals-aware.log]) AT_CAPTURE_FILE([monitor-ordinals-aware.stderr]) - AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --pidfile=monitor-ordinals-unaware.pid --log-file=monitor-ordinals-unaware.log --no-db-change-aware --no-headings monitor ordinals ordinals number name > monitor-ordinals-unaware.stdout 2> monitor-ordinals-unaware.stderr]) + AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --no-chdir --pidfile=monitor-ordinals-unaware.pid --log-file=monitor-ordinals-unaware.log --no-db-change-aware --no-headings monitor ordinals ordinals number name > monitor-ordinals-unaware.stdout 2> monitor-ordinals-unaware.stderr]) AT_CAPTURE_FILE([monitor-ordinals-unaware.stdout]) AT_CAPTURE_FILE([monitor-ordinals-unaware.log]) AT_CAPTURE_FILE([monitor-ordinals-unaware.stderr]) dnl Start two monitors on the '_Server' db, one that is database dnl change aware and one that is not. - AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --pidfile=monitor-server-aware.pid --log-file=monitor-server-aware.log --db-change-aware --no-headings monitor _Server Database name > monitor-server-aware.stdout 2> monitor-server-aware.stderr]) + AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --no-chdir --pidfile=monitor-server-aware.pid --log-file=monitor-server-aware.log --db-change-aware --no-headings monitor _Server Database name > monitor-server-aware.stdout 2> monitor-server-aware.stderr]) AT_CAPTURE_FILE([monitor-server-aware.stdout]) AT_CAPTURE_FILE([monitor-server-aware.log]) AT_CAPTURE_FILE([monitor-server-aware.stderr]) - AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --pidfile=monitor-server-unaware.pid --log-file=monitor-server-unaware.log --no-db-change-aware --no-headings monitor _Server Database name > monitor-server-unaware.stdout 2> monitor-server-unaware.stderr]) + AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --no-chdir --pidfile=monitor-server-unaware.pid --log-file=monitor-server-unaware.log --no-db-change-aware --no-headings monitor _Server Database name > monitor-server-unaware.stdout 2> monitor-server-unaware.stderr]) AT_CAPTURE_FILE([monitor-server-unaware.stdout]) AT_CAPTURE_FILE([monitor-server-unaware.log]) AT_CAPTURE_FILE([monitor-server-unaware.stderr]) @@ -919,12 +919,12 @@ ovsdb_check_online_conversion() { "columns": ["name", "number"], "rows": [], "until": "!="}]]' - AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --pidfile=trigger-ordinals-aware.pid --log-file=trigger-ordinals-aware.log --db-change-aware transact "$ordinals_txn" > trigger-ordinals-aware.stdout 2> trigger-ordinals-aware.stderr]) + AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --no-chdir --pidfile=trigger-ordinals-aware.pid --log-file=trigger-ordinals-aware.log --db-change-aware transact "$ordinals_txn" > trigger-ordinals-aware.stdout 2> trigger-ordinals-aware.stderr]) AT_CAPTURE_FILE([trigger-ordinals-aware.stdout]) AT_CAPTURE_FILE([trigger-ordinals-aware.log]) AT_CAPTURE_FILE([trigger-ordinals-aware.stderr]) - AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --pidfile=trigger-ordinals-unaware.pid --log-file=trigger-ordinals-unaware.log --no-db-change-aware transact "$ordinals_txn" > trigger-ordinals-unaware.stdout 2> trigger-ordinals-unaware.stderr]) + AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --no-chdir --pidfile=trigger-ordinals-unaware.pid --log-file=trigger-ordinals-unaware.log --no-db-change-aware transact "$ordinals_txn" > trigger-ordinals-unaware.stdout 2> trigger-ordinals-unaware.stderr]) AT_CAPTURE_FILE([trigger-ordinals-unaware.stdout]) AT_CAPTURE_FILE([trigger-ordinals-unaware.log]) AT_CAPTURE_FILE([trigger-ordinals-unaware.stderr]) @@ -938,12 +938,12 @@ ovsdb_check_online_conversion() { "columns": ["name"], "rows": [], "until": "!="}]]' - AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --pidfile=trigger-server-aware.pid --log-file=trigger-server-aware.log --db-change-aware transact "$server_txn" > trigger-server-aware.stdout 2> trigger-server-aware.stderr]) + AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --no-chdir --pidfile=trigger-server-aware.pid --log-file=trigger-server-aware.log --db-change-aware transact "$server_txn" > trigger-server-aware.stdout 2> trigger-server-aware.stderr]) AT_CAPTURE_FILE([trigger-server-aware.stdout]) AT_CAPTURE_FILE([trigger-server-aware.log]) AT_CAPTURE_FILE([trigger-server-aware.stderr]) - AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --pidfile=trigger-server-unaware.pid --log-file=trigger-server-unaware.log --no-db-change-aware transact "$server_txn" > trigger-server-unaware.stdout 2> trigger-server-unaware.stderr]) + AT_CHECK([ovsdb-client -vfile -vvlog:off --detach --no-chdir --pidfile=trigger-server-unaware.pid --log-file=trigger-server-unaware.log --no-db-change-aware transact "$server_txn" > trigger-server-unaware.stdout 2> trigger-server-unaware.stderr]) AT_CAPTURE_FILE([trigger-server-unaware.stdout]) AT_CAPTURE_FILE([trigger-server-unaware.log]) AT_CAPTURE_FILE([trigger-server-unaware.stderr]) diff --git a/tests/unixctl-py.at b/tests/unixctl-py.at index 443aaab6eeab..5c28e2c01df2 100644 --- a/tests/unixctl-py.at +++ b/tests/unixctl-py.at @@ -113,7 +113,7 @@ m4_define([UNIXCTL_SERVER_PYN], AT_SKIP_IF([test $2 = no]) on_exit 'kill `cat test-unixctl.py.pid`' AT_CAPTURE_FILE([`pwd`/test-unixctl.py.log]) - AT_CHECK([$3 $srcdir/test-unixctl.py --log-file --pidfile --detach]) + AT_CHECK([$3 $srcdir/test-unixctl.py --log-file --pidfile --detach --no-chdir]) AT_CHECK([APPCTL -t test-unixctl.py help], [0], [stdout]) AT_CHECK([cat stdout], [0], [dnl diff --git a/tests/vlog.at b/tests/vlog.at index aee6d468e4d0..2f532a725647 100644 --- a/tests/vlog.at +++ b/tests/vlog.at @@ -120,7 +120,7 @@ on_exit 'kill `cat test-unixctl.pid`' AT_CAPTURE_FILE([log]) AT_CAPTURE_FILE([log.old]) -AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile --detach], +AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile --detach --no-chdir], [0], [], [stderr]) AT_CHECK([vlog_filt stderr], [0], [opened log file @@ -156,7 +156,7 @@ m4_define([VLOG_REOPEN_PYN], AT_CAPTURE_FILE([log]) AT_CAPTURE_FILE([log.old]) - AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach]) + AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir]) AT_CHECK([APPCTL -t test-unixctl.py log message]) mv log log.old @@ -181,7 +181,7 @@ VLOG_REOPEN_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3]) AT_SETUP([vlog - vlog/reopen without log file - C]) on_exit 'kill `cat test-unixctl.pid`' -AT_CHECK([ovstest test-unixctl --pidfile --detach]) +AT_CHECK([ovstest test-unixctl --pidfile --detach --no-chdir]) AT_CHECK([APPCTL -t test-unixctl vlog/reopen], [2], [], [Logging to file not configured @@ -195,7 +195,7 @@ m4_define([VLOG_REOPEN_WITHOUT_FILE_PYN], AT_SKIP_IF([test $2 = no]) on_exit 'kill `cat test-unixctl.py.pid`' - AT_CHECK([$3 $srcdir/test-unixctl.py --pidfile --detach]) + AT_CHECK([$3 $srcdir/test-unixctl.py --pidfile --detach --no-chdir]) AT_CHECK([APPCTL -t test-unixctl.py vlog/reopen], [0], [Logging to file not configured @@ -214,7 +214,7 @@ AT_SKIP_IF([echo > /dev/full]) on_exit 'kill `cat test-unixctl.pid`' -AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile --detach], +AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile --detach --no-chdir], [0], [], [stderr]) AT_CHECK([vlog_filt stderr], [0], [opened log file ]) @@ -253,7 +253,7 @@ m4_define([VLOG_CANT_REOPEN_PYN], on_exit 'kill `cat test-unixctl.py.pid`' - AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach]) + AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir]) AT_CHECK([APPCTL -t test-unixctl.py log message]) mv log log.old ln -s /dev/full log @@ -280,7 +280,7 @@ on_exit 'kill `cat test-unixctl.pid`' AT_CAPTURE_FILE([log]) AT_CAPTURE_FILE([log.old]) -AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile --detach], +AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile --detach --no-chdir], [0], [], [ignore]) AT_CHECK([vlog_filt log], [0], [opened log file Entering run loop. @@ -322,7 +322,7 @@ m4_define([VLOG_CLOSE_PYN], AT_CAPTURE_FILE([log]) AT_CAPTURE_FILE([log.old]) - AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach]) + AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir]) AT_CHECK([APPCTL -t test-unixctl.py log message]) AT_CHECK([APPCTL -t test-unixctl.py log message2]) @@ -358,7 +358,7 @@ AT_SETUP([vlog - vlog/set and vlog/list - C]) on_exit 'kill `cat test-unixctl.pid`' AT_CAPTURE_FILE([log]) -AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile --detach], +AT_CHECK([ovstest test-unixctl --log-file=`pwd`/log --pidfile --detach --no-chdir], [0], [], [ignore]) AT_CHECK([vlog_filt log], [0], [opened log file Entering run loop. @@ -406,7 +406,7 @@ m4_define([VLOG_SET_AND_LIST_PYN], on_exit 'kill `cat test-unixctl.py.pid`' AT_CAPTURE_FILE([log]) - AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach]) + AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach --no-chdir]) AT_CHECK([APPCTL -t test-unixctl.py vlog/list], [0], [dnl console syslog file @@ -498,11 +498,11 @@ m4_define([VLOG_RFC5424_PYN], on_exit 'kill `cat test-unixctl.py.pid`' AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \ --vFACILITY:invalid --detach], [1], [], [test-unixctl.py: processing "FACILITY:invalid": Facility invalid is invalid +-vFACILITY:invalid --detach --no-chdir], [1], [], [test-unixctl.py: processing "FACILITY:invalid": Facility invalid is invalid ]) AT_CHECK([$3 $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \ --vFACILITY:daemon --detach]) +-vFACILITY:daemon --detach --no-chdir]) AT_CHECK([ovs-appctl -t test-unixctl.py vlog/set FACILITY:invalid], [0], [Facility invalid is invalid From patchwork Thu Nov 15 06:05:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wWCk0LN3z9s8F for ; Thu, 15 Nov 2018 17:09:22 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 887A3BC8; Thu, 15 Nov 2018 06:05:59 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 70629BA0 for ; Thu, 15 Nov 2018 06:05:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B820076D for ; Thu, 15 Nov 2018 06:05:55 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 3F444240002; Thu, 15 Nov 2018 06:05:52 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:33 -0800 Message-Id: <20181115060534.7146-9-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181115060534.7146-1-blp@ovn.org> References: <20181115060534.7146-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 09/10] ofp-actions: Make all actions a multiple of OFPACT_ALIGNTO bytes. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org The functions to put ofpacts into ofpbufs have always padded them to OFPACT_ALIGNTO boundaries, but the underlying structures weren't necessarily padded out. That led to difficulties in a few places where structures were allocated on the stack instead in an ofpbuf, because functions like ofpact_init_*() would access beyond the end of the actual structure. This is true, for example, in test_multipath_main() in tests/test-multipath.c, which allocates a struct ofpact_multipath on the stack, and in lswitch_handshake() in learning-switch.c, which allocates a struct ofpact_output on the stack. It's possible to fix these individual cases, but it's possible that there are others that haven't been identified. This commit addresses the issue another way, by padding all of the ofpact structures to a full multiple of OFPACT_ALIGNTO and adding assertions to ensure that it can't be screwed up in the future. This commit removes the OFPACT_*_SIZE enums, because they are now equivalent to sizeof(struct ofpact_*) in every case. Signed-off-by: Ben Pfaff --- include/openvswitch/ofp-actions.h | 393 +++++++++++++++++++++++--------------- lib/ofp-actions.c | 2 +- ofproto/connmgr.c | 2 +- ofproto/fail-open.c | 2 +- 4 files changed, 237 insertions(+), 162 deletions(-) diff --git a/include/openvswitch/ofp-actions.h b/include/openvswitch/ofp-actions.h index e0588afad854..bdd3b28de886 100644 --- a/include/openvswitch/ofp-actions.h +++ b/include/openvswitch/ofp-actions.h @@ -275,16 +275,20 @@ ofpact_find_type_flattened(const struct ofpact *a, enum ofpact_type type, * Action structure for actions that do not have any extra data beyond the * action type. */ struct ofpact_null { - struct ofpact ofpact; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ); }; /* OFPACT_OUTPUT. * * Used for OFPAT10_OUTPUT. */ struct ofpact_output { - struct ofpact ofpact; - ofp_port_t port; /* Output port. */ - uint16_t max_len; /* Max send len, for port OFPP_CONTROLLER. */ + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ofp_port_t port; /* Output port. */ + uint16_t max_len; /* Max send len, for port OFPP_CONTROLLER. */ + ); }; #define NX_CTLR_NO_METER 0 @@ -321,27 +325,33 @@ struct ofpact_controller { * * Used for OFPAT10_ENQUEUE. */ struct ofpact_enqueue { - struct ofpact ofpact; - ofp_port_t port; - uint32_t queue; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ofp_port_t port; + uint32_t queue; + ); }; /* OFPACT_OUTPUT_REG. * * Used for NXAST_OUTPUT_REG. */ struct ofpact_output_reg { - struct ofpact ofpact; - uint16_t max_len; - struct mf_subfield src; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint16_t max_len; + struct mf_subfield src; + ); }; /* OFPACT_OUTPUT_TRUNC. * * Used for NXAST_OUTPUT_TRUNC. */ struct ofpact_output_trunc { - struct ofpact ofpact; - ofp_port_t port; /* Output port. */ - uint32_t max_len; /* Max send len. */ + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ofp_port_t port; /* Output port. */ + uint32_t max_len; /* Max send len. */ + ); }; /* Bundle slave choice algorithm to apply. @@ -371,20 +381,22 @@ enum nx_bd_algorithm { * * Used for NXAST_BUNDLE. */ struct ofpact_bundle { - struct ofpact ofpact; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; - /* Slave choice algorithm to apply to hash value. */ - enum nx_bd_algorithm algorithm; + /* Slave choice algorithm to apply to hash value. */ + enum nx_bd_algorithm algorithm; - /* What fields to hash and how. */ - enum nx_hash_fields fields; - uint16_t basis; /* Universal hash parameter. */ + /* What fields to hash and how. */ + enum nx_hash_fields fields; + uint16_t basis; /* Universal hash parameter. */ - struct mf_subfield dst; + struct mf_subfield dst; - /* Slaves for output. */ - unsigned int n_slaves; - ofp_port_t slaves[]; + /* Slaves for output. */ + unsigned int n_slaves; + ofp_port_t slaves[]; + ); }; /* OFPACT_SET_VLAN_VID. @@ -396,10 +408,12 @@ struct ofpact_bundle { * * Used for OFPAT10_SET_VLAN_VID and OFPAT11_SET_VLAN_VID. */ struct ofpact_vlan_vid { - struct ofpact ofpact; - uint16_t vlan_vid; /* VLAN VID in low 12 bits, 0 in other bits. */ - bool push_vlan_if_needed; /* OF 1.0 semantics if true. */ - bool flow_has_vlan; /* VLAN present at action validation time? */ + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint16_t vlan_vid; /* VLAN VID in low 12 bits, other bits 0. */ + bool push_vlan_if_needed; /* OF 1.0 semantics if true. */ + bool flow_has_vlan; /* VLAN present at action validation time? */ + ); }; /* OFPACT_SET_VLAN_PCP. @@ -411,84 +425,104 @@ struct ofpact_vlan_vid { * * Used for OFPAT10_SET_VLAN_PCP and OFPAT11_SET_VLAN_PCP. */ struct ofpact_vlan_pcp { - struct ofpact ofpact; - uint8_t vlan_pcp; /* VLAN PCP in low 3 bits, 0 in other bits. */ - bool push_vlan_if_needed; /* OF 1.0 semantics if true. */ - bool flow_has_vlan; /* VLAN present at action validation time? */ + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint8_t vlan_pcp; /* VLAN PCP in low 3 bits, other bits 0. */ + bool push_vlan_if_needed; /* OF 1.0 semantics if true. */ + bool flow_has_vlan; /* VLAN present at action validation? */ + ); }; /* OFPACT_PUSH_VLAN. * * Used for OFPAT11_PUSH_VLAN. */ struct ofpact_push_vlan { - struct ofpact ofpact; - ovs_be16 ethertype; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ovs_be16 ethertype; + ); }; /* OFPACT_SET_ETH_SRC, OFPACT_SET_ETH_DST. * * Used for OFPAT10_SET_DL_SRC, OFPAT10_SET_DL_DST. */ struct ofpact_mac { - struct ofpact ofpact; - struct eth_addr mac; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + struct eth_addr mac; + ); }; /* OFPACT_SET_IPV4_SRC, OFPACT_SET_IPV4_DST. * * Used for OFPAT10_SET_NW_SRC, OFPAT10_SET_NW_DST. */ struct ofpact_ipv4 { - struct ofpact ofpact; - ovs_be32 ipv4; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ovs_be32 ipv4; + ); }; /* OFPACT_SET_IP_DSCP. * * Used for OFPAT10_SET_NW_TOS. */ struct ofpact_dscp { - struct ofpact ofpact; - uint8_t dscp; /* DSCP in high 6 bits, rest ignored. */ + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint8_t dscp; /* DSCP in high 6 bits, rest ignored. */ + ); }; /* OFPACT_SET_IP_ECN. * * Used for OFPAT11_SET_NW_ECN. */ struct ofpact_ecn { - struct ofpact ofpact; - uint8_t ecn; /* ECN in low 2 bits, rest ignored. */ + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint8_t ecn; /* ECN in low 2 bits, rest ignored. */ + ); }; /* OFPACT_SET_IP_TTL. * * Used for OFPAT11_SET_NW_TTL. */ struct ofpact_ip_ttl { - struct ofpact ofpact; - uint8_t ttl; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint8_t ttl; + ); }; /* OFPACT_SET_L4_SRC_PORT, OFPACT_SET_L4_DST_PORT. * * Used for OFPAT10_SET_TP_SRC, OFPAT10_SET_TP_DST. */ struct ofpact_l4_port { - struct ofpact ofpact; - uint16_t port; /* TCP, UDP or SCTP port number. */ - uint8_t flow_ip_proto; /* IP proto from corresponding match, or 0 */ + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint16_t port; /* TCP, UDP or SCTP port number. */ + uint8_t flow_ip_proto; /* IP proto from corresponding match, or 0 */ + ); }; /* OFPACT_REG_MOVE. * * Used for NXAST_REG_MOVE. */ struct ofpact_reg_move { - struct ofpact ofpact; - struct mf_subfield src; - struct mf_subfield dst; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + struct mf_subfield src; + struct mf_subfield dst; + ); }; /* OFPACT_STACK_PUSH, OFPACT_STACK_POP. * * Used for NXAST_STACK_PUSH and NXAST_STACK_POP. */ struct ofpact_stack { - struct ofpact ofpact; - struct mf_subfield subfield; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + struct mf_subfield subfield; + ); }; /* OFPACT_SET_FIELD. @@ -517,59 +551,73 @@ BUILD_ASSERT_DECL(offsetof(struct ofpact_set_field, value) * * Used for NXAST_PUSH_MPLS, OFPAT11_PUSH_MPLS. */ struct ofpact_push_mpls { - struct ofpact ofpact; - ovs_be16 ethertype; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ovs_be16 ethertype; + ); }; /* OFPACT_POP_MPLS * * Used for NXAST_POP_MPLS, OFPAT11_POP_MPLS.. */ struct ofpact_pop_mpls { - struct ofpact ofpact; - ovs_be16 ethertype; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ovs_be16 ethertype; + ); }; /* OFPACT_SET_TUNNEL. * * Used for NXAST_SET_TUNNEL, NXAST_SET_TUNNEL64. */ struct ofpact_tunnel { - struct ofpact ofpact; - uint64_t tun_id; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint64_t tun_id; + ); }; /* OFPACT_SET_QUEUE. * * Used for NXAST_SET_QUEUE. */ struct ofpact_queue { - struct ofpact ofpact; - uint32_t queue_id; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint32_t queue_id; + ); }; /* OFPACT_FIN_TIMEOUT. * * Used for NXAST_FIN_TIMEOUT. */ struct ofpact_fin_timeout { - struct ofpact ofpact; - uint16_t fin_idle_timeout; - uint16_t fin_hard_timeout; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint16_t fin_idle_timeout; + uint16_t fin_hard_timeout; + ); }; /* OFPACT_WRITE_METADATA. * * Used for NXAST_WRITE_METADATA. */ struct ofpact_metadata { - struct ofpact ofpact; - ovs_be64 metadata; - ovs_be64 mask; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ovs_be64 metadata; + ovs_be64 mask; + ); }; /* OFPACT_METER. * * Used for OFPIT13_METER. */ struct ofpact_meter { - struct ofpact ofpact; - uint32_t meter_id; - uint32_t provider_meter_id; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint32_t meter_id; + uint32_t provider_meter_id; + ); }; /* OFPACT_WRITE_ACTIONS, OFPACT_CLONE. @@ -657,25 +705,27 @@ enum nx_nat_flags { * * Used for NXAST_NAT. */ struct ofpact_nat { - struct ofpact ofpact; - uint8_t range_af; /* AF_UNSPEC, AF_INET, or AF_INET6 */ - uint16_t flags; /* NX_NAT_F_* */ - struct { + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint8_t range_af; /* AF_UNSPEC, AF_INET, or AF_INET6 */ + uint16_t flags; /* NX_NAT_F_* */ struct { - uint16_t min; - uint16_t max; - } proto; - union { - struct { - ovs_be32 min; - ovs_be32 max; - } ipv4; struct { - struct in6_addr min; - struct in6_addr max; - } ipv6; - } addr; - } range; + uint16_t min; + uint16_t max; + } proto; + union { + struct { + ovs_be32 min; + ovs_be32 max; + } ipv4; + struct { + struct in6_addr min; + struct in6_addr max; + } ipv6; + } addr; + } range; + ); }; @@ -683,11 +733,13 @@ struct ofpact_nat { * * Used for NXAST_RESUBMIT, NXAST_RESUBMIT_TABLE, NXAST_RESUBMIT_TABLE_CT. */ struct ofpact_resubmit { - struct ofpact ofpact; - ofp_port_t in_port; - uint8_t table_id; - bool with_ct_orig; /* Resubmit with Conntrack original direction tuple - * fields in place of IP header fields. */ + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ofp_port_t in_port; + uint8_t table_id; + bool with_ct_orig; /* Resubmit with Conntrack original direction tuple + * fields in place of IP header fields. */ + ); }; /* Bits for 'flags' in struct nx_action_learn. @@ -870,37 +922,43 @@ enum nx_mp_algorithm { * * Used for NXAST_CONJUNCTION. */ struct ofpact_conjunction { - struct ofpact ofpact; - uint8_t clause; - uint8_t n_clauses; - uint32_t id; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint8_t clause; + uint8_t n_clauses; + uint32_t id; + ); }; /* OFPACT_MULTIPATH. * * Used for NXAST_MULTIPATH. */ struct ofpact_multipath { - struct ofpact ofpact; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; - /* What fields to hash and how. */ - enum nx_hash_fields fields; - uint16_t basis; /* Universal hash parameter. */ + /* What fields to hash and how. */ + enum nx_hash_fields fields; + uint16_t basis; /* Universal hash parameter. */ - /* Multipath link choice algorithm to apply to hash value. */ - enum nx_mp_algorithm algorithm; - uint16_t max_link; /* Number of output links, minus 1. */ - uint32_t arg; /* Algorithm-specific argument. */ + /* Multipath link choice algorithm to apply to hash value. */ + enum nx_mp_algorithm algorithm; + uint16_t max_link; /* Number of output links, minus 1. */ + uint32_t arg; /* Algorithm-specific argument. */ - /* Where to store the result. */ - struct mf_subfield dst; + /* Where to store the result. */ + struct mf_subfield dst; + ); }; /* OFPACT_NOTE. * * Used for NXAST_NOTE. */ struct ofpact_note { - struct ofpact ofpact; - size_t length; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + size_t length; + ); uint8_t data[]; }; @@ -922,23 +980,25 @@ enum nx_action_sample_direction { * * Used for NXAST_SAMPLE, NXAST_SAMPLE2, and NXAST_SAMPLE3. */ struct ofpact_sample { - struct ofpact ofpact; - uint16_t probability; /* Always positive. */ - uint32_t collector_set_id; - uint32_t obs_domain_id; - uint32_t obs_point_id; - ofp_port_t sampling_port; - enum nx_action_sample_direction direction; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint16_t probability; /* Always positive. */ + uint32_t collector_set_id; + uint32_t obs_domain_id; + uint32_t obs_point_id; + ofp_port_t sampling_port; + enum nx_action_sample_direction direction; + ); }; /* OFPACT_DEC_TTL. * * Used for OFPAT11_DEC_NW_TTL, NXAST_DEC_TTL and NXAST_DEC_TTL_CNT_IDS. */ struct ofpact_cnt_ids { - struct ofpact ofpact; - - /* Controller ids. */ - unsigned int n_controllers; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + unsigned int n_controllers; + ); uint16_t cnt_ids[]; }; @@ -946,54 +1006,63 @@ struct ofpact_cnt_ids { * * Used for OFPAT11_SET_MPLS_LABEL and NXAST_SET_MPLS_LABEL */ struct ofpact_mpls_label { - struct ofpact ofpact; - - ovs_be32 label; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ovs_be32 label; + ); }; /* OFPACT_SET_MPLS_TC. * * Used for OFPAT11_SET_MPLS_TC and NXAST_SET_MPLS_TC */ struct ofpact_mpls_tc { - struct ofpact ofpact; - - uint8_t tc; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint8_t tc; + ); }; /* OFPACT_SET_MPLS_TTL. * * Used for OFPAT11_SET_MPLS_TTL and NXAST_SET_MPLS_TTL */ struct ofpact_mpls_ttl { - struct ofpact ofpact; - - uint8_t ttl; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint8_t ttl; + ); }; /* OFPACT_GOTO_TABLE * * Used for OFPIT11_GOTO_TABLE */ struct ofpact_goto_table { - struct ofpact ofpact; - uint8_t table_id; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint8_t table_id; + ); }; /* OFPACT_GROUP. * * Used for OFPAT11_GROUP. */ struct ofpact_group { - struct ofpact ofpact; - uint32_t group_id; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + uint32_t group_id; + ); }; /* OFPACT_UNROLL_XLATE. * * Used only internally. */ struct ofpact_unroll_xlate { - struct ofpact ofpact; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; - /* Metadata in xlate context, visible to controller via PACKET_INs. */ - uint8_t rule_table_id; /* 0xFF if none. */ - ovs_be64 rule_cookie; /* OVS_BE64_MAX if none. */ + /* Metadata in xlate context, visible to controller via PACKET_INs. */ + uint8_t rule_table_id; /* 0xFF if none. */ + ovs_be64 rule_cookie; /* OVS_BE64_MAX if none. */ + ); }; /* OFPACT_ENCAP. @@ -1001,10 +1070,12 @@ struct ofpact_unroll_xlate { * Used for NXAST_ENCAP. */ struct ofpact_encap { - struct ofpact ofpact; - ovs_be32 new_pkt_type; /* Packet type of the header to add. */ - uint16_t hdr_size; /* New header size in bytes. */ - uint16_t n_props; /* Number of encap properties. */ + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; + ovs_be32 new_pkt_type; /* Packet type of the header to add. */ + uint16_t hdr_size; /* New header size in bytes. */ + uint16_t n_props; /* Number of encap properties. */ + ); struct ofpact_ed_prop props[]; /* Properties in internal format. */ }; @@ -1012,15 +1083,17 @@ struct ofpact_encap { * * Used for NXAST_DECAP. */ struct ofpact_decap { - struct ofpact ofpact; + OFPACT_PADDED_MEMBERS( + struct ofpact ofpact; - /* New packet type. - * - * The special value (0,0xFFFE) "Use next proto" is used to request OVS to - * automatically set the new packet type based on the decap'ed header's - * next protocol. - */ - ovs_be32 new_pkt_type; + /* New packet type. + * + * The special value (0,0xFFFE) "Use next proto" is used to request OVS + * to automatically set the new packet type based on the decap'ed + * header's next protocol. + */ + ovs_be32 new_pkt_type; + ); }; /* Converting OpenFlow to ofpacts. */ @@ -1150,21 +1223,23 @@ void *ofpact_finish(struct ofpbuf *, struct ofpact *); * * Initializes the parts of 'ofpact' that identify it as having type * OFPACT_ and length OFPACT__SIZE and zeros the rest. - * - * _SIZE - * - * The size of the action structure. For a fixed-length action, this is - * sizeof(struct ) rounded up to a multiple of OFPACT_ALIGNTO. For - * a variable-length action, this is the offset to the variable-length - * part. */ #define OFPACT(ENUM, STRUCT, MEMBER, NAME) \ BUILD_ASSERT_DECL(offsetof(struct STRUCT, ofpact) == 0); \ \ - enum { OFPACT_##ENUM##_SIZE \ - = (offsetof(struct STRUCT, MEMBER) != 0 \ - ? offsetof(struct STRUCT, MEMBER) \ - : OFPACT_ALIGN(sizeof(struct STRUCT))) }; \ + /* Action structures must be a multiple of OFPACT_ALIGNTO bytes. */ \ + BUILD_ASSERT_DECL(sizeof(struct STRUCT) % OFPACT_ALIGNTO == 0); \ + \ + /* Variable-length data must start at a multiple of OFPACT_ALIGNTO \ + * bytes. */ \ + BUILD_ASSERT_DECL(offsetof(struct STRUCT, MEMBER) \ + % OFPACT_ALIGNTO == 0); \ + \ + /* If there is variable-length data, it starts at the end of the \ + * structure. */ \ + BUILD_ASSERT_DECL(!offsetof(struct STRUCT, MEMBER) \ + || (offsetof(struct STRUCT, MEMBER) \ + == sizeof(struct STRUCT))); \ \ static inline struct STRUCT * \ ofpact_get_##ENUM(const struct ofpact *ofpact) \ @@ -1184,14 +1259,14 @@ void *ofpact_finish(struct ofpbuf *, struct ofpact *); ofpact_put_##ENUM(struct ofpbuf *ofpacts) \ { \ return (struct STRUCT *) ofpact_put(ofpacts, OFPACT_##ENUM, \ - OFPACT_##ENUM##_SIZE); \ + sizeof(struct STRUCT)); \ } \ \ static inline void \ ofpact_init_##ENUM(struct STRUCT *ofpact) \ { \ ofpact_init(&ofpact->ofpact, OFPACT_##ENUM, \ - OFPACT_##ENUM##_SIZE); \ + sizeof(struct STRUCT)); \ } \ \ static inline void \ diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index f25fdec64cc0..96e39d6c6c9c 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -840,7 +840,7 @@ decode_NXAST_RAW_CONTROLLER2(const struct ext_action_header *eah, } case NXAC2PT_USERDATA: - out->size = start_ofs + OFPACT_CONTROLLER_SIZE; + out->size = start_ofs + sizeof(struct ofpact_controller); ofpbuf_put(out, payload.msg, ofpbuf_msgsize(&payload)); oc = ofpbuf_at_assert(out, start_ofs, sizeof *oc); oc->userdata_len = ofpbuf_msgsize(&payload); diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index f5576d50524d..7a7790c0bdbb 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -1939,7 +1939,7 @@ connmgr_flushed(struct connmgr *mgr) struct ofpbuf ofpacts; struct match match; - ofpbuf_init(&ofpacts, OFPACT_OUTPUT_SIZE); + ofpbuf_init(&ofpacts, sizeof(struct ofpact_output)); ofpact_put_OUTPUT(&ofpacts)->port = OFPP_NORMAL; match_init_catchall(&match); diff --git a/ofproto/fail-open.c b/ofproto/fail-open.c index ded282895a10..5b105ba880a3 100644 --- a/ofproto/fail-open.c +++ b/ofproto/fail-open.c @@ -163,7 +163,7 @@ fail_open_add_normal_flow(struct fail_open *fo) /* Set up a flow that matches every packet and directs them to * OFPP_NORMAL. */ - ofpbuf_init(&ofpacts, OFPACT_OUTPUT_SIZE); + ofpbuf_init(&ofpacts, sizeof(struct ofpact_output)); ofpact_put_OUTPUT(&ofpacts)->port = OFPP_NORMAL; match_init_catchall(&match); From patchwork Thu Nov 15 06:05:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 998098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wWDC3HJnz9s8F for ; Thu, 15 Nov 2018 17:09:47 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 45075BD5; Thu, 15 Nov 2018 06:06:00 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id B0E8FBA0 for ; Thu, 15 Nov 2018 06:05:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5A39775B for ; Thu, 15 Nov 2018 06:05:57 +0000 (UTC) Received: from sigabrt.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id C7D1824000A; Thu, 15 Nov 2018 06:05:54 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 14 Nov 2018 22:05:34 -0800 Message-Id: <20181115060534.7146-10-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20181115060534.7146-1-blp@ovn.org> References: <20181115060534.7146-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 10/10] tests: Add support for Address Sanitizer. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This makes the tests all pass cleanly when Address Sanitizer is enabled. Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- Documentation/intro/install/general.rst | 7 +++++++ tests/atlocal.in | 5 +++++ tests/daemon.at | 8 ++++++++ tests/ovs-macros.at | 14 ++++++++++++++ tests/ovsdb-server.at | 16 ++++++++++++++++ 5 files changed, 50 insertions(+) diff --git a/Documentation/intro/install/general.rst b/Documentation/intro/install/general.rst index 71dfeaefca27..fa99491f6b50 100644 --- a/Documentation/intro/install/general.rst +++ b/Documentation/intro/install/general.rst @@ -295,6 +295,13 @@ target machine. $ make EXTRA_CFLAGS="-Wno-error=date-time" +If you are a developer and want to enable Address Sanitizer for debugging +purposes, at about a 2x runtime cost, you can add +``-fsanitize=address -fno-omit-frame-pointer -fno-common`` to CFLAGS. For +example:: + + $ ./configure CFLAGS="-g -O2 -fsanitize=address -fno-omit-frame-pointer -fno-common" + To build the Linux kernel module, so that you can run the kernel-based switch, pass the location of the kernel build directory on ``--with-linux``. For example, to build for a running instance of Linux:: diff --git a/tests/atlocal.in b/tests/atlocal.in index abfc1acf36d3..6f971cd652d7 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -220,3 +220,8 @@ export OVS_SYSLOG_METHOD # Set default timeout for control utils OVS_CTL_TIMEOUT=30 export OVS_CTL_TIMEOUT + +# Add some default flags to make the tests run better under Address +# Sanitizer, if it was used for the build. +ASAN_OPTIONS=detect_leaks=0:abort_on_error=true:log_path=asan:$ASAN_OPTIONS +export ASAN_OPTIONS diff --git a/tests/daemon.at b/tests/daemon.at index b379fa83f9aa..fa4844ae8eaa 100644 --- a/tests/daemon.at +++ b/tests/daemon.at @@ -29,6 +29,10 @@ AT_CLEANUP AT_SETUP([daemon --monitor]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) + +# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS + OVSDB_INIT([db]) AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([parent]) @@ -101,6 +105,10 @@ AT_CLEANUP AT_SETUP([daemon --detach --monitor]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) + +# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS + OVSDB_INIT([db]) AT_CAPTURE_FILE([daemon]) AT_CAPTURE_FILE([olddaemon]) diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at index 8389eeb2996a..f2e6114ae822 100644 --- a/tests/ovs-macros.at +++ b/tests/ovs-macros.at @@ -10,6 +10,13 @@ m4_define([AT_SETUP], [OVS_AT_SETUP($@) ovs_init ]) +dnl Make AT_CLEANUP check for Address Sanitizer errors as the last step +dnl in every test. +m4_rename([AT_CLEANUP], [OVS_AT_CLEANUP]) +m4_define([AT_CLEANUP], [ovs_cleanup +OVS_AT_CLEANUP($@) +]) + dnl OVS_START_SHELL_HELPERS...OVS_END_SHELL_HELPERS may bracket shell dnl function definitions that invoke AT_CHECK and other Autotest macros dnl that can ordinarily be run only within AT_SETUP...AT_CLEANUP. @@ -180,6 +187,13 @@ fi m4_divert_pop([PREPARE_TESTS]) OVS_START_SHELL_HELPERS +ovs_cleanup() { + if test "$(echo asan.*)" != 'asan.*'; then + echo "Address Sanitizer reported errors in:" asan.* + AT_FAIL_IF([:]) + fi +} + ovs_wait () { echo "$1: waiting $2..." >&AS_MESSAGE_LOG_FD diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index 4a71efbd5d7f..81f03d28b090 100644 --- a/tests/ovsdb-server.at +++ b/tests/ovsdb-server.at @@ -285,6 +285,10 @@ AT_CLEANUP AT_SETUP([ovsdb-server/add-db with --monitor]) AT_KEYWORDS([ovsdb server positive]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) + +# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS + # Start ovsdb-server, initially with one db. ordinal_schema > schema AT_CHECK([ovsdb-tool create db1 schema], [0], [ignore], [ignore]) @@ -316,6 +320,10 @@ AT_CLEANUP AT_SETUP([ovsdb-server/add-db and remove-db with --monitor]) AT_KEYWORDS([ovsdb server positive]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) + +# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS + # Start ovsdb-server, initially with one db. ordinal_schema > schema AT_CHECK([ovsdb-tool create db1 schema], [0], [ignore], [ignore]) @@ -462,6 +470,10 @@ AT_CLEANUP AT_SETUP([ovsdb-server/add-remote with --monitor]) AT_KEYWORDS([ovsdb server positive]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) + +# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS + # Start ovsdb-server, initially with no remotes. ordinal_schema > schema AT_CHECK([ovsdb-tool create db schema], [0], [ignore], [ignore]) @@ -493,6 +505,10 @@ AT_CLEANUP AT_SETUP([ovsdb-server/add-remote and remove-remote with --monitor]) AT_KEYWORDS([ovsdb server positive]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) + +# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS + # Start ovsdb-server, initially with no remotes. ordinal_schema > schema AT_CHECK([ovsdb-tool create db schema], [0], [ignore], [ignore])