| Message ID | 20190919072820.9913-1-a@unstable.cc |
|---|---|
| State | Accepted |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> 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 <patchwork@openvpn.net>; 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 <openvpn-devel-bounces@lists.sourceforge.net>) (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 <openvpn-devel-bounces@lists.sourceforge.net>) 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 <a@unstable.cc>) 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 <a@unstable.cc> 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: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Cc: Antonio Quartulli <a@unstable.cc> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel] t_net.sh: wait for NO-CARRIER bit to settle before starting test
|
|
Commit Message
Antonio Quartulli
Sept. 18, 2019, 9:28 p.m. UTC
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 <a@unstable.cc>
---
tests/t_net.sh | 7 +++++++
1 file changed, 7 insertions(+)
Comments
Acked-by: Gert Doering <gert@greenie.muc.de> Your patch has been applied to the master branch. "Your script, you know what is happening behind the scenes, so it's good enough for me" :-) commit 8aa037161f37c42585ac4a8d99f37af624211da6 Author: Antonio Quartulli Date: Thu Sep 19 09:28:20 2019 +0200 t_net.sh: wait for NO-CARRIER bit to settle before starting test Signed-off-by: Antonio Quartulli <a@unstable.cc> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20190919072820.9913-1-a@unstable.cc> URL: https://www.mail-archive.com/search?l=mid&q=20190919072820.9913-1-a@unstable.cc Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
Hi, On 19-09-19 09:28, Antonio Quartulli wrote: > 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 <a@unstable.cc> > --- > 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 > This return value check now checks that sleep succeeded instead of the openvpn --mktun command. I don't think that is what you intended. -Steffan
Hi, On 19/09/2019 11:17, Steffan Karger wrote: >> 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 >> > > This return value check now checks that sleep succeeded instead of the > openvpn --mktun command. I don't think that is what you intended. > You're absolutely right. The sleep should be moved right after the if-check. Will send a new patch to fix that. Regards,
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