Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1050278rdg; Wed, 11 Oct 2023 12:51:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbkTeIvjS246tmfChjOGwAtdAinEPcyFNvys8aq0aeHzjlX75q5VygZ7CGrxOWQ/14p0b6 X-Received: by 2002:a17:903:234e:b0:1c6:1fc3:6857 with SMTP id c14-20020a170903234e00b001c61fc36857mr24967396plh.27.1697053900096; Wed, 11 Oct 2023 12:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697053900; cv=none; d=google.com; s=arc-20160816; b=k4ZPlyjJWwyPVtq0Vuok12pcRmmR81L/xplqSQ7WQ/mt7QDoGllT9Sdz5CPBtmtdzN cT/VX2AiA6nDo8PtvuWsqnXDbmOS0G23bIp0Y6O7/vLiSkco/wltj3L7MytjhApCjp6P gDwbnXkYCafbhzzJaf8iY4obT1hcroJk4eWYZ9NqsWKKtwiJE/r2iVyngBY5b/tQR4ti /bCreJNhU2fF9euXEBSKKGMP3Yb36SDxLLMEm7HZWQ9Bc9CmOYVcmJx9pYh9YRz8uKY2 kqRdnu2EcezGYzEEJui15MNjWGR42cqjdCy+a/+Ma8KSHyxp0cTikm5ByIvg+uIQfcmC uMEQ== 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=rbzsF8kc6hKEZwL8kF947pxRM0gGlgmaq8q3Uc1AlKE=; fh=88nBSjTOrhHvyQS3Sgn//fCA45rCHSUCvyWdnfpu45A=; b=AlkTDqwoHD3Q9PCRe4TfoR4Vu0Fub9Pt1I/9VG+Aqmws2PyfbcTE+j5SH1GTWmlplV AZ5oIOPsG+d+c51mEvmmS/9W6RnFY/iKfJXvCGPKkmLHUS+hmJRp4huphqQHjqEltaMy aHQKIN/XDNbhedu0PLbnyunspKK6gbe5Zn6QgV3wVs20Nx3oISBEYv+FcmwMaD6ohCO+ aFt3OBGWc/CRcWmjorW/6l4HQ4JqVHGvONBxCCPPW5+cTja34toAAmfydOXh6i+zv5Mk yPGbq5tojSJz+KZTl68E5BlRaOGBK/qAJNVn7q0BobFdQ1YMVC2x8wqXEVa+jHkW2H6s mIQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YARqPrFb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id p8-20020a170902bd0800b001b83767e879si388357pls.266.2023.10.11.12.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 12:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YARqPrFb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id E97438215ADB; Wed, 11 Oct 2023 12:51:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233419AbjJKTvW (ORCPT + 99 others); Wed, 11 Oct 2023 15:51:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234840AbjJKTvU (ORCPT ); Wed, 11 Oct 2023 15:51:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB684AF for ; Wed, 11 Oct 2023 12:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697053785; 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=rbzsF8kc6hKEZwL8kF947pxRM0gGlgmaq8q3Uc1AlKE=; b=YARqPrFbl/qRWZwq8r8M5sZfojXsuHNoHRmOfpkaFsbIc+swjPL02gw46uQ7MwFI99bzBN +ZvA4jz+9E2A/essDhjEuePVz34YNdp8L1fJtcFHqdkgpBPkOLV7gPt2jj9vSJd18s6Tmn 5d/UBjqvUC5HC4sZOmbeQh+NEYlAS8U= 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-479-mw5gTCvCM8241slRsYM_Hg-1; Wed, 11 Oct 2023 15:49:42 -0400 X-MC-Unique: mw5gTCvCM8241slRsYM_Hg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 6755D803497; Wed, 11 Oct 2023 19:49:41 +0000 (UTC) Received: from RHTPC1VM0NT.lan (unknown [10.22.34.140]) by smtp.corp.redhat.com (Postfix) with ESMTP id 927441C060B5; Wed, 11 Oct 2023 19:49:40 +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 , shuah@kernel.org Subject: [PATCH net v2 1/4] selftests: openvswitch: Add version check for pyroute2 Date: Wed, 11 Oct 2023 15:49:36 -0400 Message-ID: <20231011194939.704565-2-aconole@redhat.com> In-Reply-To: <20231011194939.704565-1-aconole@redhat.com> References: <20231011194939.704565-1-aconole@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 11 Oct 2023 12:51:34 -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 --- v2: Include version information tools/testing/selftests/net/openvswitch/openvswitch.sh | 2 +- tools/testing/selftests/net/openvswitch/ovs-dpctl.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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..e4c24d5edf20c 100644 --- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py +++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py @@ -28,8 +28,10 @@ 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.") + print("Need to install the python pyroute2 package >= 0.6.") 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 to >= 0.6.") + sys.exit(0) + parser = argparse.ArgumentParser() parser.add_argument( "-v", -- 2.41.0