From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6CDC7A0471 for ; Mon, 12 Aug 2019 10:46:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 324211252; Mon, 12 Aug 2019 10:46:14 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4EE3EDE3 for ; Mon, 12 Aug 2019 10:46:11 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 01:46:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,376,1559545200"; d="scan'208";a="187355160" Received: from unknown (HELO dpdk-wenjielx-dtspatch135.sh.intel.com) ([10.240.176.135]) by orsmga002.jf.intel.com with ESMTP; 12 Aug 2019 01:46:05 -0700 From: zhuwenhui To: dts@dpdk.org Cc: zhuwenhui Date: Mon, 12 Aug 2019 16:50:42 +0800 Message-Id: <1565599842-66863-1-git-send-email-wenhuix.zhu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] tests/vhost_1024_ethports:add new case 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" Add a new suite based on test_plan. Signed-off-by: zhuwenhui --- tests/TestSuite_vhost_1024_ethports.py | 102 +++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 tests/TestSuite_vhost_1024_ethports.py diff --git a/tests/TestSuite_vhost_1024_ethports.py b/tests/TestSuite_vhost_1024_ethports.py new file mode 100644 index 0000000..0c14e8d --- /dev/null +++ b/tests/TestSuite_vhost_1024_ethports.py @@ -0,0 +1,102 @@ +# BSD LICENSE +# +# Copyright (c) <2019>, Intel Corporation. +# 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. +Basic test for launch vhost with 1024 ethports +""" + +import utils +from test_case import TestCase + + +class TestVhost1024Ethports(TestCase): + + def set_up_all(self): + """ + Run at the start of each test suite. + """ + self.max_ethport = 1024 + self.queue = 1 + self.dut_ports = self.dut.get_ports() + self.verify(len(self.dut_ports) >= 1, 'Insufficient ports for testing') + self.mem_channels = self.dut.get_memory_channels() + cores = self.dut.get_core_list("1S/2C/1T") + self.coremask = utils.create_mask(cores) + self.build_user_dpdk() + + def set_up(self): + """ + Run before each test case. + """ + self.dut.send_expect('rm -rf ./vhost-net*', '# ') + self.dut.send_expect('killall -s INT testpmd', '# ') + self.vhost_user = self.dut.new_session(suite='vhost-user') + + def build_user_dpdk(self): + self.dut.send_expect( + "sed -i 's/CONFIG_RTE_MAX_ETHPORTS=32$/CONFIG_RTE_MAX_ETHPORTS=1024/' config/common_base", '#', 30) + self.dut.build_install_dpdk(self.target) + + def restore_dpdk(self): + self.dut.send_expect( + "sed -i 's/CONFIG_RTE_MAX_ETHPORTS=1024$/CONFIG_RTE_MAX_ETHPORTS=32/' config/common_base", '#', 30) + self.dut.build_install_dpdk(self.target) + + def test_launch_vhost_with_1024_ethports(self): + """ + Test function of launch vhost with 1024 ethports + """ + command_line_vdev = '' + for ethport in range(self.max_ethport): + command_line_vdev += '--vdev "eth_vhost%d,iface=vhost-net%d,queues=%d" ' %(ethport, ethport, self.queue) + command_line_argument = '/app/testpmd -c %s -n %d --socket-mem 10240,10240 '\ + '--file-prefix=vhost ' %(self.coremask, self.mem_channels) + command_line_client = self.dut.target + command_line_argument + command_line_vdev + '-- -i' + try: + out = self.vhost_user.send_expect(command_line_client, 'testpmd> ', 120) + except Exception as e: + self.verify(0, 'start testpmd failed') + self.vhost_user.send_expect("quit", "#", 120) + self.verify("Done" in out, "launch vhost with 1024 ethports failed") + + def tear_down(self): + """ + Run after each test case. + """ + self.dut.send_expect('rm -rf ./vhost-net*', '# ') + self.dut.close_session(self.vhost_user) + + def tear_down_all(self): + """ + Run after each test suite. + """ + self.restore_dpdk() -- 2.17.2