From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id EBC23C1EE for ; Wed, 6 Jun 2018 07:34:05 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2018 22:34:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,482,1520924400"; d="scan'208";a="55112381" Received: from shecgisg006.sh.intel.com ([10.239.39.68]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jun 2018 22:34:03 -0700 Received: from shecgisg006.sh.intel.com (localhost [127.0.0.1]) by shecgisg006.sh.intel.com with ESMTP id w565Y3Bm022646; Wed, 6 Jun 2018 13:34:03 +0800 Received: (from yufengmx@localhost) by shecgisg006.sh.intel.com with œ id w565Y3ke022642; Wed, 6 Jun 2018 13:34:03 +0800 From: yufengx.mo@intel.com To: dts@dpdk.org Cc: yufengmx Date: Wed, 6 Jun 2018 13:34:02 +0800 Message-Id: <1528263242-22459-3-git-send-email-yufengx.mo@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1528263242-22459-1-git-send-email-yufengx.mo@intel.com> References: <1528263242-22459-1-git-send-email-yufengx.mo@intel.com> Subject: [dts] [PATCH V1 2/2] ethtool_stats: suite automation script 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: , X-List-Received-Date: Wed, 06 Jun 2018 05:34:06 -0000 From: yufengmx Currently Ethtool supports a more complete list of stats for the same drivers that DPDK supports. The idea behind this epic is two fold as following: 1. To achieve metric equivalence with what linux's ethtool provides. 2. To extend the functionality of the xstats API to enable the following options: ## the retrieval of aggregate stats upon request (Top level stats). ## the retrieval of the extended NIC stats. ## grouping of stats logically so they can be retrieved per logical grouping. ## the option to enable/disable the stats groups to retrieve similar to set private flags in ethtool. Signed-off-by: yufengmx --- tests/TestSuite_ethtool_stats.py | 566 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 566 insertions(+) create mode 100644 tests/TestSuite_ethtool_stats.py diff --git a/tests/TestSuite_ethtool_stats.py b/tests/TestSuite_ethtool_stats.py new file mode 100644 index 0000000..d8cd0df --- /dev/null +++ b/tests/TestSuite_ethtool_stats.py @@ -0,0 +1,566 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2018 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +DPDK Test suite. + +''' + +import re +import time +import os, sys + +import utils +from qemu_kvm import QEMUKvm +from test_case import TestCase +from pmd_output import PmdOutput +from exception import VerifyFailure + +from scapy.utils import rdpcap + +from packet import Packet, sniff_packets, load_sniff_packets +from settings import HEADER_SIZE + +import logger + + +class TestEthtoolStats(TestCase): + def set_up_all(self): + self.dut_ports = self.dut.get_ports(self.nic) + self.verify(len(self.dut_ports) >= 1, 'Insufficient ports') + self.printFlag = self._enable_debug + # get link port pairs + self.link_ports_pair = {} + for port_num in range(len(self.dut_ports)): + local_port = self.tester.get_local_port(0) + self.src_intf =self.tester.get_interface(local_port) + self.src_mac = self.tester.get_mac(local_port) + self.dst_mac = self.dut.get_mac_address(0) + self.link_ports_pair[port_num] = [self.src_intf, + self.src_mac, + self.dst_mac] + # + self.pmd_cmds = list() + self.testpmd = PmdOutput(self.dut) + self.testpmd_flag = False + # dpdk pro-info + ports_count = len(self.dut_ports) + ports_mask = reduce(lambda x, y: x | y, + map(lambda x: 0x1<