From patchwork Fri Jan 22 01:59:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, XiX" X-Patchwork-Id: 87046 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8CAA8A0A0A; Fri, 22 Jan 2021 02:58:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6125A140CEF; Fri, 22 Jan 2021 02:58:58 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 42803140CEB for ; Fri, 22 Jan 2021 02:58:57 +0100 (CET) IronPort-SDR: zIBAHOa6Uj31/PBYC/u5ROOj+1YRmtXaeV//18oaJZE6N86S0oiPiyto1+zoSOv4/IeKYu7xo0 DMoMzDqB5TlA== X-IronPort-AV: E=McAfee;i="6000,8403,9871"; a="240915669" X-IronPort-AV: E=Sophos;i="5.79,365,1602572400"; d="scan'208";a="240915669" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2021 17:58:54 -0800 IronPort-SDR: 8WpCd7NfNff497oYcG03h3hzrCQr8MHpkDwM2tLt4txiKtG1QXeU2pLgMCLRiczor86Qa8s7ma Pzx3ZS1/bUlQ== X-IronPort-AV: E=Sophos;i="5.79,365,1602572400"; d="scan'208";a="356739386" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.182.150]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2021 17:58:53 -0800 From: xizhan4x To: dts@dpdk.org Cc: xizhan4x Date: Fri, 22 Jan 2021 09:59:12 +0800 Message-Id: <1611280752-17173-1-git-send-email-xix.zhang@intel.com> X-Mailer: git-send-email 2.4.0 Subject: [dts] [PATCH V1] tests/short_live, kni:remove packet.log and used current timestamp X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" kni:Delete listening files before use short_live:Different timestamps are used in the loop Signed-off-by: xizhan4x --- framework/dut.py | 1 + tests/TestSuite_kni.py | 9 +++++---- tests/TestSuite_short_live.py | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/framework/dut.py b/framework/dut.py index c4301df..13cabfc 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -120,6 +120,7 @@ class Dut(Crb): :return: eal_str eg:'-c 0xf -a 0000:88:00.0 -a 0000:88:00.1 --file-prefix=dpdk_1112_20190809143420', if dpdk version < 20.11-rc4, eal_str eg: '-c 0xf -w 0000:88:00.0 --file-prefix=dpdk_1112_20190809143420', """ + self.prefix_subfix = str(os.getpid()) + '_' + time.strftime("%Y%m%d%H%M%S", time.localtime()) default_cores = '1S/2C/1T' blank = ' ' os_type = self.get_os_type() diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index 0a30053..6ed8c5e 100644 --- a/tests/TestSuite_kni.py +++ b/tests/TestSuite_kni.py @@ -663,8 +663,10 @@ class TestKni(TestCase): # Ports and cores configuration set in set_up_all function self.dut.kill_all() self.start_kni() + + file_name='packet.log' for port in self.config['ports']: - + self.dut.send_expect(f"rm -rf {file_name}","#") virtual_interface = self.virtual_interface_name(port) tx_port = self.tester.get_local_port(port) @@ -674,12 +676,11 @@ class TestKni(TestCase): self.dut.send_expect("ifconfig %s up" % virtual_interface, "# ") time.sleep(5) - # Start tcpdump with filters for src and dst MAC address, this avoids # unwanted broadcast, ICPM6... packets out = self.dut.send_expect( - 'tcpdump -i %s -e -w packet.log "ether src %s and ether dst %s"' % - (virtual_interface, tx_mac, rx_mac), + 'tcpdump -i %s -e -w %s "ether src %s and ether dst %s"' % + (virtual_interface,file_name, tx_mac, rx_mac), "listening on %s" % virtual_interface, 30) packets_to_send = [ diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.py index 525be9d..91deded 100644 --- a/tests/TestSuite_short_live.py +++ b/tests/TestSuite_short_live.py @@ -67,7 +67,7 @@ class TestShortLiveApp(TestCase): self.app_l2fwd_path = self.dut.apps_name['l2fwd'] self.app_l3fwd_path = self.dut.apps_name['l3fwd'] self.app_testpmd = self.dut.apps_name['test-pmd'] - self.eal_para = self.dut.create_eal_parameters() + self.eal_para = self.dut.create_eal_parameters def set_up(self): """ @@ -142,7 +142,7 @@ class TestShortLiveApp(TestCase): Basic rx/tx forwarding test """ #dpdk start - self.dut.send_expect("./%s %s -- -i --portmask=0x3" % (self.app_testpmd, self.eal_para), "testpmd>", 120) + self.dut.send_expect("./%s %s -- -i --portmask=0x3" % (self.app_testpmd, self.eal_para()), "testpmd>", 120) time.sleep(5) self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("set promisc all off", "testpmd>") @@ -175,7 +175,7 @@ class TestShortLiveApp(TestCase): for i in range(repeat_time): #dpdk start print("clean_up_with_signal_testpmd round %d" % (i + 1)) - self.dut.send_expect("./%s %s -- -i --portmask=0x3" % (self.app_testpmd, self.eal_para), "testpmd>", 120) + self.dut.send_expect("./%s %s -- -i --portmask=0x3" % (self.app_testpmd, self.eal_para()), "testpmd>", 120) self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("set promisc all off", "testpmd>") self.dut.send_expect("start", "testpmd>") @@ -200,7 +200,7 @@ class TestShortLiveApp(TestCase): for i in range(repeat_time): #dpdk start print("clean_up_with_signal_l2fwd round %d" % (i + 1)) - self.dut.send_expect("%s %s -- -p 0x3 &" % (self.app_l2fwd_path, self.eal_para), "L2FWD: entering main loop", 60) + self.dut.send_expect("%s %s -- -p 0x3 &" % (self.app_l2fwd_path, self.eal_para()), "L2FWD: entering main loop", 60) self.check_forwarding([0, 1], self.nic) # kill with different Signal @@ -216,7 +216,7 @@ class TestShortLiveApp(TestCase): for i in range(repeat_time): #dpdk start print("clean_up_with_signal_l3fwd round %d" % (i + 1)) - self.dut.send_expect("%s %s -- -p 0x3 --config='(0,0,1),(1,0,2)' &" % (self.app_l3fwd_path, self.eal_para), "L3FWD: entering main loop", 120) + self.dut.send_expect("%s %s -- -p 0x3 --config='(0,0,1),(1,0,2)' &" % (self.app_l3fwd_path, self.eal_para()), "L3FWD: entering main loop", 120) self.check_forwarding([0, 0], self.nic) # kill with different Signal