From patchwork Wed Sep 18 21:28:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 831 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id kEXxMyIvg11RAwAAIUCqbw for ; Thu, 19 Sep 2019 03:32:50 -0400 Received: from proxy1.mail.ord1c.rsapps.net ([172.28.255.1]) by director11.mail.ord1d.rsapps.net with LMTP id 8Km0MyIvg132QAAAvGGmqA ; Thu, 19 Sep 2019 03:32:50 -0400 Received: from smtp38.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.ord1c.rsapps.net with LMTP id oK9UMyIvg105IgAA2VeTtA ; Thu, 19 Sep 2019 03:32:50 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp38.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: aebaafee-daaf-11e9-adda-5452007bdf16-1-1 Received: from [216.105.38.7] ([216.105.38.7:33124] helo=lists.sourceforge.net) by smtp38.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id D4/61-14545-22F238D5; Thu, 19 Sep 2019 03:32:50 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iAquA-000674-Gf; Thu, 19 Sep 2019 07:31:06 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iAqu7-00066T-9r for openvpn-devel@lists.sourceforge.net; Thu, 19 Sep 2019 07:31:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AkvwCkiJbJSMjCjHoYT6YiPGRIJL/LlAsC2/+bLf+ao=; b=eBAVY72gfMzsE3BHEpf8yLaphu LPAuQebvit4yI4Gp0eSorRStWRA8jJsOh81DuVeJfg6ytVvqipy7kRaLA6I/NBqXNdSK9L6PRbhUY /x7Kj/5DqZdY3ZKuc/BAkXvMY5gLfgIA/pvNbovduir2A2N/h8CMzop22lHFgWtleL+M=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=AkvwCkiJbJSMjCjHoYT6YiPGRIJL/LlAsC2/+bLf+ao=; b=B S2wkN5BLFTCjh3ieA1F8wQAScVa013e7aGepVLYfs1uo7jLhrOS6Lx6G6J09PvRPx3ivN+qZvayMQ QNNT88PnUYE12h9iltk+ojcOyNK68ZhmJ34EzNED8kK7fKyT9CwBl8HnO0W7mUVTWHw4lgnFY7d99 oGvOufUxu1Cf/hyg=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1iAqu3-009xVp-CW for openvpn-devel@lists.sourceforge.net; Thu, 19 Sep 2019 07:31:03 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Thu, 19 Sep 2019 09:28:20 +0200 Message-Id: <20190919072820.9913-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: t_net.sh] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [5.148.176.60 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1iAqu3-009xVp-CW Subject: [Openvpn-devel] [PATCH] t_net.sh: wait for NO-CARRIER bit to settle before starting test X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Interfaces of type tun are marked as NO-CARRIER when no process is attached to them. However, this bit gets set with some delay after creation. For this reason, it is better to wait for the bit to settle before starting any test, otherwise any timing influence on the test may lead to inconsistencies due to the NO-CARRIER bit randomly being or not in the snapshot output taken by t_net.sh. This patch add a 'sleep 1' command right after creation of the interface, to give the NO-CARRIER bit a chance to settle. This issue has been witnessed on a buildbot that is apparently slowler than average to run the unit tests. Signed-off-by: Antonio Quartulli Acked-by: Gert Doering --- tests/t_net.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/t_net.sh b/tests/t_net.sh index 18799d12..97e947ab 100755 --- a/tests/t_net.sh +++ b/tests/t_net.sh @@ -34,6 +34,13 @@ reload_dummy() { $RUN_SUDO $openvpn --dev $IFACE --dev-type tun --rmtun >/dev/null $RUN_SUDO $openvpn --dev $IFACE --dev-type tun --mktun >/dev/null + + # it seems that tun devices will settle on NO-CARRIER while not connected to + # any process, but this won't happen immediately. To avoid having the + # NO-CARRIER bit appear in the middle of the tests - which would compromise + # the results - let's wait 1 sec here for it to settle. + sleep 1 + if [ $? -ne 0 ]; then echo "can't create interface $IFACE" exit 1