From patchwork Wed Sep 16 11:06:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, XiX" X-Patchwork-Id: 77893 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A310A04C7; Wed, 16 Sep 2020 13:05:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E39D41C234; Wed, 16 Sep 2020 13:04:59 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 288A21C232 for ; Wed, 16 Sep 2020 13:04:57 +0200 (CEST) IronPort-SDR: XG/VTkPugd5LzZiwjjslNWNOm7j/dMhi9H6oDWhYplxzvQQ8V2TnGhIokc8g4PZs8L1TgxAE7w F4ZLRihc6gKA== X-IronPort-AV: E=McAfee;i="6000,8403,9745"; a="159494143" X-IronPort-AV: E=Sophos;i="5.76,432,1592895600"; d="scan'208";a="159494143" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2020 04:04:56 -0700 IronPort-SDR: 4MyJJapvjP5WSj+tkYj26JqM5iwf4NJwGGNj3xOp4Z14lNOJ7qg6TUmr2cekW6HipEuPXkUyYe WhYiMHGG5SMw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,432,1592895600"; d="scan'208";a="380132846" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.182.150]) by orsmga001.jf.intel.com with ESMTP; 16 Sep 2020 04:04:55 -0700 From: xizhan4x To: dts@dpdk.org Cc: xizhan4x Date: Wed, 16 Sep 2020 19:06:27 +0800 Message-Id: <1600254387-20435-1-git-send-email-xix.zhang@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1] tests/TestSuite_ieee1588:Modify sed command 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" Modify sed command Signed-off-by: xizhan4x Tested-by: Zhang, XiX Acked-by: lihongx ma --- tests/TestSuite_ieee1588.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py index 19f17d1..8632286 100644 --- a/tests/TestSuite_ieee1588.py +++ b/tests/TestSuite_ieee1588.py @@ -56,6 +56,7 @@ class TestIeee1588(TestCase): # Change the config file to support IEEE1588 and recompile the package. self.dut.send_expect( "sed -i -e 's/IEEE1588=n$/IEEE1588=y/' config/common_base", "# ", 30) + self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'y'}) self.dut.skip_setup = False self.dut.build_install_dpdk(self.target) @@ -91,18 +92,21 @@ class TestIeee1588(TestCase): port = self.tester.get_local_port(dutPorts[0]) itf = self.tester.get_interface(port) - self.tester.send_expect( - "tcpdump -i %s -e ether src %s" % (itf, mac), "tcpdump", 20) self.send_session = self.tester.create_session('send_session') + self.send_session.send_expect( + "tcpdump -i %s -e ether src %s" % (itf, mac), "tcpdump", 20) + setattr(self.send_session, 'tmp_file', self.tester.tmp_file) + setattr(self.send_session, 'tmp_file', self.tester.get_session_output) pkt = Packet(pkt_type='TIMESYNC') pkt.config_layer('ether', {'dst': mac}) - pkt.send_pkt(self.send_session, tx_port=itf) + pkt.send_pkt(self.tester, tx_port=itf) time.sleep(1) + + out = self.send_session.get_session_output(timeout=20) + self.send_session.send_expect("^C", "# ", 20) self.send_session.close() - out = self.tester.get_session_output(timeout=20) - self.tester.send_expect("^C", "# ", 20) self.verify("0x88f7" in out, "Ether type is not PTP") @@ -171,4 +175,5 @@ class TestIeee1588(TestCase): # Restore the config file and recompile the package. self.dut.send_expect( "sed -i -e 's/IEEE1588=y$/IEEE1588=n/' config/common_base", "# ", 30) + self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'n'}) self.dut.build_install_dpdk(self.target)