From patchwork Mon Jun 11 11:15:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Redaelli X-Patchwork-Id: 927620 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=fail (p=none dis=none) header.from=redhat.com 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 4149Rh6NK4z9rxs for ; Mon, 11 Jun 2018 21:15:44 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id BD0F0175B; Mon, 11 Jun 2018 11:15:41 +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 018EB1741 for ; Mon, 11 Jun 2018 11:15:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9680F768 for ; Mon, 11 Jun 2018 11:15:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9F5E28163C5F; Mon, 11 Jun 2018 11:15:38 +0000 (UTC) Received: from graphite.redhat.com (unknown [10.40.205.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id C24332024CB3; Mon, 11 Jun 2018 11:15:37 +0000 (UTC) From: Timothy Redaelli To: dev@openvswitch.org Date: Mon, 11 Jun 2018 13:15:35 +0200 Message-Id: <843c07cf1c578dc1180b4bf86efd7a59a9df199e.1528715735.git.tredaelli@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 11 Jun 2018 11:15:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 11 Jun 2018 11:15:38 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'tredaelli@redhat.com' RCPT:'' X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] tests: Fix test that tests if the system doesn't support IPv6 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 Currently if IPv6 is globally disabled (net.ipv6.conf.all.disable_ipv6=1) or if IPv6 is disabled on loopback interface (net.ipv6.conf.lo.disable_ipv6=1) the check doesn't work since no interface have ::1 and EADDRNOTAVAIL is returned. This causes a Python exception to be printed, like this: Traceback (most recent call last): File "", line 6, in File "/usr/lib64/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 99] Cannot assign requested address In this case HAVE_IPV6 is not set and all IPv6 tests fails. This commit fixes the problem by check also for EADDRNOTAVAIL. CC: Ben Pfaff Fixes: 5c1d812d7fb3 ("tests: Avoid printing Python exception for hosts without IPv6 support.") Signed-off-by: Timothy Redaelli --- tests/atlocal.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/atlocal.in b/tests/atlocal.in index 4e626266b..6fc30cbf8 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -123,7 +123,7 @@ import sys try: socket.socket(family=socket.AF_INET6).bind(("::1", 0, 0, 0)) except socket.error as e: - if e.errno == errno.EAFNOSUPPORT: + if e.errno == errno.EAFNOSUPPORT or errno.EADDRNOTAVAIL: sys.exit(2) raise '