From patchwork Thu Apr 16 03:49:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1084 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id SG7MJ61imF6qUAAAIUCqbw for ; Thu, 16 Apr 2020 09:50:37 -0400 Received: from proxy14.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id OHFUJa1imF5qQAAApN4f7A ; Thu, 16 Apr 2020 09:50:37 -0400 Received: from smtp19.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy14.mail.iad3b.rsapps.net with LMTP id 6HATIK1imF7RewAA+7ETDg ; Thu, 16 Apr 2020 09:50:37 -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: smtp19.gate.iad3b.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: 3f8db014-7fe9-11ea-b64c-525400cbaf6c-1-1 Received: from [216.105.38.7] ([216.105.38.7:48990] helo=lists.sourceforge.net) by smtp19.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id EF/9F-30104-CA2689E5; Thu, 16 Apr 2020 09:50:36 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jP4tq-0007ly-Na; Thu, 16 Apr 2020 13:49:50 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jP4tp-0007lr-MC for openvpn-devel@lists.sourceforge.net; Thu, 16 Apr 2020 13:49:49 +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=UL8bKlSh//gf58tfRb2XppBCU+OtS6Dnso/NInGU+Pk=; b=S0i7R+ZvMNWHoNmZ/txaZwYmkI Z4T3LMX18uL5f9nVOn8fFchklBhKjPlEOtZk/PKo0Ef5JHdgRZsjkyGcP1xi3vh1/zzbA//oXEK2H r66Ln0u3GFW/MRrX0va4M33GlBYUehd50+muy5MjbkAlbtF00CLM5dv6cNtvfcE1MDNg=; 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=UL8bKlSh//gf58tfRb2XppBCU+OtS6Dnso/NInGU+Pk=; b=N LQrh6N6UeThG+Tfjly6QD3YFm0xl23J+PY3qbrcV192jNE8jeDNP+TsELCEEgKJx7Cw7T+dY1ywfk Q45Z5d2QYNmnf8Dd3pbR7qLJ74uJqVKML/wXzc+6vzyFY/2b+6a5wm7mIaojC3wEzz4TFl0rFrNjx cQsrkhTTs8DC4h5o=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jP4tn-001x8u-Tn for openvpn-devel@lists.sourceforge.net; Thu, 16 Apr 2020 13:49:49 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Thu, 16 Apr 2020 15:49:25 +0200 Message-Id: <20200416134925.8848-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 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 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: unstable.cc] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1jP4tn-001x8u-Tn Subject: [Openvpn-devel] [PATCH] t_net.sh: use dummy interface instead of tun 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 The tun interface has proved to be a bit fragile for basic netlink tests as it may introduce delays in switching state, depending on the system the test is ran on. For this reason, switch to dummy interface type and at the same type set its oper-state to up right after creation to avoid hitting the no-carrier state later. No-carrier has been problematic in pasts tests as it sometimes persists long enough to create a discrepancy between the various tests snapshots thus causing a test failure. Setting a static MAC addressis also re-enabled to avoid it being different and thus causing a test failure when comparing snapshots. Signed-off-by: Antonio Quartulli Acked-by: Gert Doering --- tests/t_net.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/t_net.sh b/tests/t_net.sh index 49790f0f..8f1bc361 100755 --- a/tests/t_net.sh +++ b/tests/t_net.sh @@ -32,21 +32,16 @@ LAST_STATE=$((${#GET_STATE[@]} - 1)) reload_dummy() { - $RUN_SUDO $openvpn --dev $IFACE --dev-type tun --rmtun >/dev/null - $RUN_SUDO $openvpn --dev $IFACE --dev-type tun --mktun >/dev/null + $RUN_SUDO ip link del $IFACE + $RUN_SUDO ip link add $IFACE type dummy + $RUN_SUDO ip link set dev $IFACE state up if [ $? -ne 0 ]; then echo "can't create interface $IFACE" exit 1 fi - # 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 - - #ip link set dev $IFACE address 00:11:22:33:44:55 + $RUN_SUDO ip link set dev $IFACE address 00:11:22:33:44:55 } run_test()