From patchwork Fri Oct 23 09:25:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yufen.Mo" X-Patchwork-Id: 81913 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 681BAA04DE; Fri, 23 Oct 2020 11:30:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 38442A900; Fri, 23 Oct 2020 11:30:29 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 6E5117DF8 for ; Fri, 23 Oct 2020 11:30:27 +0200 (CEST) IronPort-SDR: PTgauyTohs/m3w0OZl5mumrO6YVEl6GqsBzJ6rd+78lHf6IHxIBcRI+W/w9wgI1lv1reRPs9X/ JY94S3P6M9fQ== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="146942775" X-IronPort-AV: E=Sophos;i="5.77,407,1596524400"; d="scan'208";a="146942775" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 02:30:22 -0700 IronPort-SDR: GSphy7ZrTvnlhVQfVXcJQoOEZm4TRApGsSvVbtO7VcT7TYGA2p4opld2hODbm8YRt5Mnp10bGc C6X9ijTl0m/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,407,1596524400"; d="scan'208";a="523445826" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.208]) by fmsmga006.fm.intel.com with ESMTP; 23 Oct 2020 02:30:20 -0700 From: yufengmx To: dts@dpdk.org, lijuan.tu@intel.com, lihongx.ma@intel.com Cc: yufengmx Date: Fri, 23 Oct 2020 17:25:47 +0800 Message-Id: <20201023092549.33439-2-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20201023092549.33439-1-yufengx.mo@intel.com> References: <20201023092549.33439-1-yufengx.mo@intel.com> MIME-Version: 1.0 Subject: [dts] [PATCH V5 1/3] framework: check the python version X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" implement a method to check the python version of tester and the server that run dts. If the version is lower than 3.6.9, print a warning message. Signed-off-by: yufengmx --- framework/utils.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/framework/utils.py b/framework/utils.py index e74e6c5..6084ea6 100644 --- a/framework/utils.py +++ b/framework/utils.py @@ -32,6 +32,7 @@ import json # json format import re import os +import sys import inspect import socket import struct @@ -280,3 +281,30 @@ def get_backtrace_object(file_name, obj_name): obj = getattr(frame.f_locals['self'], obj_name, None) return obj + + +def check_crb_python_version(crb): + cmd = 'python3 -V' + out = crb.send_expect(cmd, '#', 5) + pat = "Python (\d+).(\d+).(\d+)" + result = re.findall(pat, out) + if not result or \ + int(result[0][0]) < 3 or \ + (int(result[0][0]) == 3 and int(result[0][1]) < 6) or \ + (int(result[0][0]) == 3 and int(result[0][1]) == 6 and int(result[0][2]) < 9): + crb.logger.warning( + ("WARNING: Tester node python version is lower than python 3.6, " + "it is deprecated for use in DTS, " + "and will not work in future releases.")) + crb.logger.warning("Please use Python >= 3.6.9 instead") + + +def check_dts_python_version(): + if sys.version_info.major < 3 or \ + (sys.version_info.major == 3 and sys.version_info.minor < 6) or \ + (sys.version_info.major == 3 and sys.version_info.minor == 6 and sys.version_info.micro < 9): + print(RED( + ("WARNING: Dts running node python version is lower than python 3.6, " + "it is deprecated for use in DTS, " + "and will not work in future releases.")), file=sys.stderr) + print(RED("Please use Python >= 3.6.9 instead"), file=sys.stderr) From patchwork Fri Oct 23 09:25:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yufen.Mo" X-Patchwork-Id: 81912 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EA5EEA04DE; Fri, 23 Oct 2020 11:30:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E24528D9A; Fri, 23 Oct 2020 11:30:27 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id CB6067DF8 for ; Fri, 23 Oct 2020 11:30:25 +0200 (CEST) IronPort-SDR: f8zCvWb0YwVt8ipT5wpP4i3+8IDJhYJnPs/zy/EEXUBHfYG9VJlLO4+It/XbaRYkXnJdAsbp3N hU6uUxxfSfvA== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="146942777" X-IronPort-AV: E=Sophos;i="5.77,407,1596524400"; d="scan'208";a="146942777" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 02:30:23 -0700 IronPort-SDR: V0k/arGj2tTT9+rfpao/i+35+D2q0F8j4sXzu6R7ErU+GDsEoUK4gfkNtUF5e6oOJJL+J3M/4Q C2Y4LvNb+RXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,407,1596524400"; d="scan'208";a="523445839" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.208]) by fmsmga006.fm.intel.com with ESMTP; 23 Oct 2020 02:30:22 -0700 From: yufengmx To: dts@dpdk.org, lijuan.tu@intel.com, lihongx.ma@intel.com Cc: yufengmx Date: Fri, 23 Oct 2020 17:25:48 +0800 Message-Id: <20201023092549.33439-3-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20201023092549.33439-1-yufengx.mo@intel.com> References: <20201023092549.33439-1-yufengx.mo@intel.com> MIME-Version: 1.0 Subject: [dts] [PATCH V5 2/3] framework: check the python version X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" check the python version of the server that run dts. If the version is lower than 3.6.9, print a warning message. Signed-off-by: yufengmx --- framework/dts.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/dts.py b/framework/dts.py index 4fcec3a..697602d 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -58,7 +58,8 @@ import logger import debugger from config import CrbsConf from checkCase import CheckCase -from utils import get_subclasses, copy_instance_attr, create_parallel_locks +from utils import (get_subclasses, copy_instance_attr, create_parallel_locks, + check_dts_python_version) import sys import imp imp.reload(sys) @@ -505,6 +506,9 @@ def run_all(config_file, pkgName, git, patch, skip_setup, global log_handler global check_case_inst + # check the python version of the server that run dts + check_dts_python_version() + # save global variable serializer = Serializer() From patchwork Fri Oct 23 09:25:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yufen.Mo" X-Patchwork-Id: 81914 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2BA19A04DF; Fri, 23 Oct 2020 11:30:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 70E0CA906; Fri, 23 Oct 2020 11:30:29 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 12E60A8F7 for ; Fri, 23 Oct 2020 11:30:27 +0200 (CEST) IronPort-SDR: 539Jo+RS63k1XdKspOlguN2KZN5LbF5djXUJhl+ShdU2MHiV/v1gAd138Vyas+LGg85bAK7TTX /Ia4/VyQjpaQ== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="146942779" X-IronPort-AV: E=Sophos;i="5.77,407,1596524400"; d="scan'208";a="146942779" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 02:30:24 -0700 IronPort-SDR: 8C2y75vptMSWHJ1EdU5y4ZBd/kuL+tZ2b0llPi/e3JPTEfw+rcr3DSsaNTbKv2eVJnyOzxrVav KFbbXGD9hvpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,407,1596524400"; d="scan'208";a="523445844" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.208]) by fmsmga006.fm.intel.com with ESMTP; 23 Oct 2020 02:30:23 -0700 From: yufengmx To: dts@dpdk.org, lijuan.tu@intel.com, lihongx.ma@intel.com Cc: yufengmx Date: Fri, 23 Oct 2020 17:25:49 +0800 Message-Id: <20201023092549.33439-4-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20201023092549.33439-1-yufengx.mo@intel.com> References: <20201023092549.33439-1-yufengx.mo@intel.com> MIME-Version: 1.0 Subject: [dts] [PATCH V5 3/3] framework: check the python version X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" check the python version of tester. If the version is lower than 3.6.9, print a warning message. Signed-off-by: yufengmx --- framework/tester.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/tester.py b/framework/tester.py index ca179b2..482b0e4 100644 --- a/framework/tester.py +++ b/framework/tester.py @@ -43,7 +43,8 @@ from crb import Crb from net_device import GetNicObj from etgen import IxiaPacketGenerator, SoftwarePacketGenerator import random -from utils import GREEN, convert_int2ip, convert_ip2int +from utils import (GREEN, convert_int2ip, convert_ip2int, + check_crb_python_version) from exception import ParameterInvalidException from multiprocessing import Process from pktgen import getPacketGenerator @@ -66,6 +67,8 @@ class Tester(Crb): self.NAME = 'tester' self.scapy_session = None super(Tester, self).__init__(crb, serializer, self.NAME) + # check the python version of tester + check_crb_python_version(self) self.bgProcIsRunning = False self.duts = None