From patchwork Wed Oct 11 19:49:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 151534 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp777041vqb; Wed, 11 Oct 2023 12:51:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkNp6YzHRDLRFElciBIsDh6tKxoFT3n76IMMyaZG7U9n6i14uq+dl2uGnwxCaXHzK8hMkw X-Received: by 2002:a05:6a00:2e92:b0:692:b3d4:e6c3 with SMTP id fd18-20020a056a002e9200b00692b3d4e6c3mr24045286pfb.0.1697053896966; Wed, 11 Oct 2023 12:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697053896; cv=none; d=google.com; s=arc-20160816; b=xehnGgHvLaJSpl4mkxv9gNdlTqn4hLBBQ23diCmVfi3VK/PgZlzrbo5NxAf3WOdP0V cfVoM9RpVolpy9ER3BlaY9Dhvdac8oZpaMxRI8xnvmvWhmRIjMaIINgCP1wCzkwiNoGR ZmicDHWoEUDQNBAbyS8sCQu/V2EM06MqUkCUgnvO1mQO+YawL6Z42CYcAfxdgSj5AKRZ iP7mFGqgDMWUMEDNLgzCajB6//4SFJWYlTxKl8K8tMP6QMCv6Sc2fuVUvfoFwAG/RaJp yt+7lO5s4RKz2fhVoMnzh3mL+tY3N+INYyxozW52AL/nLjfBHvmMgtBUVijchW6iAhPk xyvg== 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 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id fj33-20020a056a003a2100b006910070695fsi12806183pfb.31.2023.10.11.12.51.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 12:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; 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 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id DDD238021ED8; Wed, 11 Oct 2023 12:51:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345948AbjJKTvW (ORCPT + 18 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 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, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Wed, 11 Oct 2023 12:51:30 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779489987143359996 X-GMAIL-MSGID: 1779489987143359996 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",