From patchwork Fri Jan 22 02:11:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, XiX" X-Patchwork-Id: 87047 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 C0175A0A0A; Fri, 22 Jan 2021 03:10:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87488140D29; Fri, 22 Jan 2021 03:10:57 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 5B7DD140D0F for ; Fri, 22 Jan 2021 03:10:55 +0100 (CET) IronPort-SDR: oJRAa44FY+Jlt/eJnDnu9cEaGA+tOxyhmRpMR9RxeL+LN4OC12girJ1VDlIvWMtUJXtYTxoBgK 3cxcIdPdf0Eg== X-IronPort-AV: E=McAfee;i="6000,8403,9871"; a="158558632" X-IronPort-AV: E=Sophos;i="5.79,365,1602572400"; d="scan'208";a="158558632" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2021 18:10:53 -0800 IronPort-SDR: X/YIbEeUXaUxNrnHyjKeQDUal7JpBlGMIj6vGZWUzwaL2y/lSbJ6bKQ+0+8MNOmMSksIN/gG+9 d+/WUjMd/cBQ== X-IronPort-AV: E=Sophos;i="5.79,365,1602572400"; d="scan'208";a="356743108" 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 18:10:52 -0800 From: xizhan4x To: dts@dpdk.org Cc: xizhan4x Date: Fri, 22 Jan 2021 10:11:23 +0800 Message-Id: <1611281483-18024-1-git-send-email-xix.zhang@intel.com> X-Mailer: git-send-email 2.4.0 Subject: [dts] [PATCH V2] 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 Tested-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..3535f52 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() - for port in self.config['ports']: + 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