Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp451969rdb; Fri, 6 Oct 2023 08:14:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/D+j2NeWqUWOZEZmLfrniOVV0UExXSOR/aaaDN0IQcvZbAdusyGvV5DMdgxlUJN6+jcbb X-Received: by 2002:a05:6e02:1210:b0:34f:2b29:762b with SMTP id a16-20020a056e02121000b0034f2b29762bmr6984880ilq.14.1696605276746; Fri, 06 Oct 2023 08:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696605276; cv=none; d=google.com; s=arc-20160816; b=J5vc1AXH4CahkZs0C0LHiqkEw1FTN7mEhUYkgRSFVYFHaUhoClhIxAB4V+ggBWW58s NRbu8I4npDnybm309AfE2shG3fbd8DrFPJycKAvN1j8Xvp/6pZkcsuPxoCOBJbiDTrNU NZfEm47R/3l1bVwazCwZYvhy0wtJngv5hz7AUiFkRcvKMrdibQzs2ockpwuhboK+ivOv DTqa82avKvH1ztNAMLDU1rbZOGSSnHzuhk1msJpBISQ/0LGp/oqPXHxHX6oQ415dVh9z hbp/7uCVioDsh0VQ830j6pPfKc6+4pnphs/v1WIvOxm/3bhWCPdzdyQ6zTetLlwEd9Ba 4ujQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a3BtezrsO4g/f4wdN64oWX3Tfa1nQARVL1ef9IRoW74=; fh=MdzQONQ/gulM6swFM9amSgUVTs752ZpsSWOQLplcSFQ=; b=L6ryErATF5eatf53gjQkcCjo6NRWL5jdRQlIlJSUl058wuDP2lI96Xmls4molZCA3A zoa6YlGxL7Y2yA/pp/pnfkYmVMF/3kSN0UIrFGxv8oBeIZGbTgC3igXa+pDPuUuf7NUW OMkLBgebDIQxtNyZARNe5OLdlKfNxA5He/ZEH1WIS5MfStIcwllkX3I9WM/V6aXBunWL DO/X4FCpaYCqCnwWHHou67S6NY+UlEa34YKVUhRjSGhkFYgKCBRbl6f4DQVbkNPiw3qi ED9NK0QZpaJFRspc3pgxxNq6mLLEobcGtLahOp3qrpftM4Gg7bRSC29g+nCJ0GODJ5ig P/ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ExoUkFwr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id o2-20020a634102000000b0058555ea0a23si3777164pga.512.2023.10.06.08.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 08:14:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ExoUkFwr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 92C5983DB32B; Fri, 6 Oct 2023 08:14:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232732AbjJFPOS (ORCPT + 99 others); Fri, 6 Oct 2023 11:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232750AbjJFPOP (ORCPT ); Fri, 6 Oct 2023 11:14:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F349CE for ; Fri, 6 Oct 2023 08:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696605190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a3BtezrsO4g/f4wdN64oWX3Tfa1nQARVL1ef9IRoW74=; b=ExoUkFwryC7F4BlhJRXS7o3i5YfZlrSY3u+V/YHS5SxmaUEcq9oWyuxnhLKe2dciukzzjf BpJRD+zGS/DCYg+t9aWFjgb0spjL99ab+SgoVG7zQowyOFP6Q49MdD5tu2VbRhG8H+R4P+ QWSHrO4J0Le4SDQE1EwpIuGFayUTAVA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-446-ocmP3CosMayolbt9PTMNog-1; Fri, 06 Oct 2023 11:13:02 -0400 X-MC-Unique: ocmP3CosMayolbt9PTMNog-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3A290811E88; Fri, 6 Oct 2023 15:13:00 +0000 (UTC) Received: from RHTPC1VM0NT.lan (unknown [10.22.33.74]) by smtp.corp.redhat.com (Postfix) with ESMTP id C017940D1EA; Fri, 6 Oct 2023 15:12:59 +0000 (UTC) From: Aaron Conole To: netdev@vger.kernel.org Cc: dev@openvswitch.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Pravin B Shelar , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Adrian Moreno , Eelco Chaudron Subject: [PATCH net 1/4] selftests: openvswitch: Add version check for pyroute2 Date: Fri, 6 Oct 2023 11:12:55 -0400 Message-Id: <20231006151258.983906-2-aconole@redhat.com> In-Reply-To: <20231006151258.983906-1-aconole@redhat.com> References: <20231006151258.983906-1-aconole@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 06 Oct 2023 08:14:33 -0700 (PDT) X-Spam-Level: ** Paolo Abeni reports that on some systems the pyroute2 version isn't new enough to run the test suite. Ensure that we support a minimum version of 0.6 for all cases (which does include the existing ones). The 0.6.1 version was released in May of 2021, so should be propagated to most installations at this point. The alternative that Paolo proposed was to only skip when the add-flow is being run. This would be okay for most cases, except if a future test case is added that needs to do flow dump without an associated add (just guessing). In that case, it could also be broken and we would need additional skip logic anyway. Just draw a line in the sand now. Fixes: 25f16c873fb1 ("selftests: add openvswitch selftest suite") Reported-by: Paolo Abeni Closes: https://lore.kernel.org/lkml/8470c431e0930d2ea204a9363a60937289b7fdbe.camel@redhat.com/ Signed-off-by: Aaron Conole --- tools/testing/selftests/net/openvswitch/openvswitch.sh | 2 +- tools/testing/selftests/net/openvswitch/ovs-dpctl.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh index 9c2012d70b08e..220c3356901ef 100755 --- a/tools/testing/selftests/net/openvswitch/openvswitch.sh +++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh @@ -525,7 +525,7 @@ run_test() { fi if python3 ovs-dpctl.py -h 2>&1 | \ - grep "Need to install the python" >/dev/null 2>&1; then + grep -E "Need to (install|upgrade) the python" >/dev/null 2>&1; then stdbuf -o0 printf "TEST: %-60s [PYLIB]\n" "${tdesc}" return $ksft_skip fi diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py index 912dc8c490858..9686ca30d516d 100644 --- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py +++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py @@ -28,6 +28,8 @@ try: from pyroute2.netlink import nlmsg_atoms from pyroute2.netlink.exceptions import NetlinkError from pyroute2.netlink.generic import GenericNetlinkSocket + import pyroute2 + except ModuleNotFoundError: print("Need to install the python pyroute2 package.") sys.exit(0) @@ -1998,6 +2000,12 @@ def main(argv): nlmsg_atoms.ovskey = ovskey nlmsg_atoms.ovsactions = ovsactions + # version check for pyroute2 + prverscheck = pyroute2.__version__.split(".") + if int(prverscheck[0]) == 0 and int(prverscheck[1]) < 6: + print("Need to upgrade the python pyroute2 package.") + sys.exit(0) + parser = argparse.ArgumentParser() parser.add_argument( "-v", -- 2.40.1