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 57888A0487 for ; Tue, 2 Jul 2019 11:30:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4AACF2BC8; Tue, 2 Jul 2019 11:30:25 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 0BD472BB5 for ; Tue, 2 Jul 2019 11:30:23 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2019 02:30:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,442,1557212400"; d="scan'208";a="190587434" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.176.135]) by fmsmga002.fm.intel.com with ESMTP; 02 Jul 2019 02:30:21 -0700 From: "xiao,qimai" To: dts@dpdk.org Cc: "xiao,qimai" Date: Tue, 2 Jul 2019 17:35:04 +0800 Message-Id: <1562060104-127705-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] update kni for env with single cpu on socket 0 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" 1.update kni to run on env with single cpu on socket 0 2.add cmd to close firewall on ubuntu Signed-off-by: xiao,qimai --- tests/TestSuite_kni.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index 6bf388c..a1c07a2 100644 --- a/tests/TestSuite_kni.py +++ b/tests/TestSuite_kni.py @@ -263,13 +263,34 @@ class TestKni(TestCase): out = self.dut.build_dpdk_apps("./examples/kni/") self.verify('Error' not in out, "Compilation failed") + p0_pci = self.dut.ports_info[0]['pci'] + numa_node = int(self.dut.send_expect("cat /sys/bus/pci/devices/%s/numa_node"%p0_pci, "# ", 30)) + socket_id = numa_node if numa_node > 0 else 0 + if socket_id==0: + global default_1_port_cores_config + global default_2_port_cores_config + global routing_performance_steps + global bridge_performance_steps + global loopback_performance_steps + + default_1_port_cores_config=default_1_port_cores_config.replace('C{1.','C{0.') + default_2_port_cores_config=default_1_port_cores_config.replace('C{1.','C{0.') + for i in range(len(routing_performance_steps)): + routing_performance_steps[i]['config'] = routing_performance_steps[i]['config'].replace('C{1.','C{0.') + for j in range(len(bridge_performance_steps)): + bridge_performance_steps[j]['config'] = bridge_performance_steps[j]['config'].replace('C{1.','C{0.') + for k in range(len(loopback_performance_steps)): + loopback_performance_steps[k]['config'] = loopback_performance_steps[k]['config'].replace('C{1.','C{0.') self.extract_ports_cores_config(default_1_port_cores_config) out = self.start_kni() self.verify("Error" not in out, "Error found during kni start") - - self.dut.send_expect("service iptables stop", "# ") - self.dut.send_expect("service firewalld stop", "# ") + out = self.dut.send_expect("cat /etc/os-release", "# ") + if "Ubuntu" in out: + self.dut.send_expect("ufw disable", "# ") + else: + self.dut.send_expect("service iptables stop", "# ") + self.dut.send_expect("service firewalld stop", "# ") # get dts output path if self.logger.log_path.startswith(os.sep): -- 2.17.1