From patchwork Wed Dec 4 23:06:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1204395 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47SvcG1R4rz9sPT for ; Thu, 5 Dec 2019 10:06:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A8A2524B96; Wed, 4 Dec 2019 23:06:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z0FwYalDqx5C; Wed, 4 Dec 2019 23:06:33 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id CD22824723; Wed, 4 Dec 2019 23:06:33 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C38F5C1DD6; Wed, 4 Dec 2019 23:06:33 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id CB88DC077D for ; Wed, 4 Dec 2019 23:06:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B8054249CF for ; Wed, 4 Dec 2019 23:06:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id urQrm1D6tcU5 for ; Wed, 4 Dec 2019 23:06:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by silver.osuosl.org (Postfix) with ESMTPS id 11DD923C58 for ; Wed, 4 Dec 2019 23:06:27 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 893351BF207; Wed, 4 Dec 2019 23:06:23 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 4 Dec 2019 15:06:09 -0800 Message-Id: <20191204230611.331596-3-blp@ovn.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191204230611.331596-1-blp@ovn.org> References: <20191204230611.331596-1-blp@ovn.org> MIME-Version: 1.0 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 3/5] tests: Better document OVS_WAIT_UNTIL, OVS_WAIT_WHILE macros. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Ben Pfaff --- tests/ovs-macros.at | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at index d2239e38656f..fee50901543e 100644 --- a/tests/ovs-macros.at +++ b/tests/ovs-macros.at @@ -252,21 +252,19 @@ ovs_wait_failed () { ovs_wait "AS_ESCAPE([$3])" "AS_ESCAPE([$4])" ]) -dnl OVS_WAIT_UNTIL(COMMAND) +dnl OVS_WAIT_UNTIL(COMMAND, [IF-FAILED]) dnl -dnl Executes shell COMMAND in a loop until it returns -dnl zero return code. If COMMAND did not return -dnl zero code within reasonable time limit, then -dnl the test fails. +dnl Executes shell COMMAND in a loop until it returns zero. If COMMAND does +dnl not return zero within a reasonable time limit, executes the commands +dnl in IF-FAILED (if provided) and fails the test. m4_define([OVS_WAIT_UNTIL], [OVS_WAIT([$1], [$2], [AT_LINE], [until $1])]) -dnl OVS_WAIT_WHILE(COMMAND) +dnl OVS_WAIT_WHILE(COMMAND, [IF-FAILED]) dnl -dnl Executes shell COMMAND in a loop until it returns -dnl non-zero return code. If COMMAND did not return -dnl non-zero code within reasonable time limit, then -dnl the test fails. +dnl Executes shell COMMAND in a loop until it returns nonzero. If COMMAND does +dnl not return nonzero within a reasonable time limit, executes the commands +dnl in IF-FAILED (if provided) and fails the test. m4_define([OVS_WAIT_WHILE], [OVS_WAIT([if $1; then return 1; else return 0; fi], [$2], [AT_LINE], [while $1])])