From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id E6BD55A53 for ; Thu, 19 Nov 2015 03:43:05 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 18 Nov 2015 18:43:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,316,1444719600"; d="scan'208";a="841997217" Received: from stv-crb-56.sh.intel.com (HELO [10.239.128.116]) ([10.239.128.116]) by fmsmga001.fm.intel.com with ESMTP; 18 Nov 2015 18:42:53 -0800 Message-ID: <564D376C.4080805@intel.com> Date: Thu, 19 Nov 2015 10:43:56 +0800 From: "Liu, Yong" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Lijuan Tu , dts@dpdk.org References: <1447843229-2720-1-git-send-email-lijuanx.a.tu@intel.com> In-Reply-To: <1447843229-2720-1-git-send-email-lijuanx.a.tu@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dts] [PATCH]nvgre, vxlan, multiprocess: fix get-output errors 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: , X-List-Received-Date: Thu, 19 Nov 2015 02:43:06 -0000 Applied with commit log modification. Thanks. On 11/18/2015 06:40 PM, Lijuan Tu wrote: > fix test script get the output from the pmd driver correctly if the command inputs aren't from send_expect > > Signed-off-by: Lijuan Tu > --- > tests/TestSuite_multiprocess.py | 49 +++++++++++++++++++---------------------- > tests/TestSuite_nvgre.py | 6 +++-- > tests/TestSuite_vxlan.py | 6 +++-- > 3 files changed, 31 insertions(+), 30 deletions(-) > > diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py > index 6ed6984..7bc005d 100644 > --- a/tests/TestSuite_multiprocess.py > +++ b/tests/TestSuite_multiprocess.py > @@ -80,23 +80,23 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > Basic operation. > """ > # Send message from secondary to primary > - self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary |tee out " % self.target, "Finished Process Init", 100) > + self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary" % self.target, "Finished Process Init", 100) > time.sleep(20) > - self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary" % self.target, "Finished Process Init", 100) > + self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary" % self.target, "Finished Process Init", 100) > > - self.dut.send_expect("send hello_primary", ">") > - self.dut.send_expect("quit", "# ") > - self.dut.alt_session.send_expect("quit","# ") > - out = self.dut.alt_session.send_expect("cat out","# ") > + self.dut.alt_session.send_expect("send hello_primary", ">") > + out = self.dut.get_session_output() > + self.dut.alt_session.send_expect("quit", "# ") > + self.dut.send_expect("quit","# ") > self.verify("Received 'hello_primary'" in out, "Message not received on primary process") > # Send message from primary to secondary > self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary " % self.target, "Finished Process Init", 100) > time.sleep(20) > - self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary | tee out " % self.target, "Finished Process Init", 100) > + self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary" % self.target, "Finished Process Init", 100) > self.dut.alt_session.send_expect("send hello_secondary", ">") > + out = self.dut.get_session_output() > self.dut.alt_session.send_expect("quit", "# ") > self.dut.send_expect("quit", "# ") > - out = self.dut.send_expect("cat out", "# ") > > self.verify("Received 'hello_secondary'" in out, > "Message not received on primary process") > @@ -109,7 +109,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > self.dut.kill_all() > self.dut.send_expect("fg", "# ") > > - self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary > testing.txt &" % self.target, "# ", 100) > + self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary" % self.target, "Finished Process Init", 100) > time.sleep(20) > self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary" % self.target, "Finished Process Init", 100) > stringsSent = 0 > @@ -122,7 +122,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > > time.sleep(5) > self.dut.send_expect("quit", "# ") > - self.dut.send_expect("fg", ">") > + self.dut.alt_session.send_expect("quit", "# ") > > def test_multiprocess_simple_mpapplicationstartup(self): > """ > @@ -132,32 +132,30 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > self.dut.kill_all() > > # Send message from secondary to primary (auto process type) > - self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto |tee out " % self.target, "Finished Process Init", 100) > + out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto " % self.target, "Finished Process Init", 100) > + self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly") > time.sleep(20) > - out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=auto" % self.target, "Finished Process Init", 100) > + out = self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=auto" % self.target, "Finished Process Init", 100) > self.verify("EAL: Auto-detected process type: SECONDARY" in out, > "The type of process (SECONDARY) was not detected properly") > > - self.dut.send_expect("send hello_primary", ">") > - self.dut.send_expect("quit", "# ") > + self.dut.alt_session.send_expect("send hello_primary", ">") > + out = self.dut.get_session_output() > self.dut.alt_session.send_expect("quit", "# ") > - out = self.dut.send_expect("cat out", "# ") > - > - self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly") > + self.dut.send_expect("quit", "# ") > self.verify("Received 'hello_primary'" in out, "Message not received on primary process") > > # Send message from primary to secondary (auto process type) > - out = self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto |tee out_primary " % self.target, "Finished Process Init", 100) > + out = self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto" % self.target, "Finished Process Init", 100) > + self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly") > time.sleep(20) > - self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=auto |tee out_secondary " % self.target, "Finished Process Init", 100) > + out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=auto" % self.target, "Finished Process Init", 100) > + self.verify("EAL: Auto-detected process type: SECONDARY" in out, "The type of process (SECONDARY) was not detected properly") > self.dut.alt_session.send_expect("send hello_secondary", ">",100) > + out = self.dut.get_session_output() > self.dut.alt_session.send_expect("quit", "# ") > self.dut.send_expect("quit", "# ") > - out = self.dut.send_expect("cat out_primary", "# ") > - self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly") > > - out = self.dut.send_expect("cat out_secondary", "# ") > - self.verify("EAL: Auto-detected process type: SECONDARY" in out, "The type of process (SECONDARY) was not detected properly") > self.verify("Received 'hello_secondary'" in out, > "Message not received on primary process") > > @@ -167,14 +165,13 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > """ > > self.dut.kill_all() > - self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 -m 64 &" % self.target, "Finished Process Init", 100) > + self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 -m 64" % self.target, "Finished Process Init", 100) > out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C" % self.target, "# ", 100) > > self.verify("Is another primary process running" in out, > "No other primary process detected") > > - self.dut.send_expect("fg", " > ") > - self.dut.send_expect("quit", "# ") > + self.dut.alt_session.send_expect("quit", "# ") > > def test_perf_multiprocess_client_serverperformance(self): > """ > diff --git a/tests/TestSuite_nvgre.py b/tests/TestSuite_nvgre.py > index 954259d..86609ab 100644 > --- a/tests/TestSuite_nvgre.py > +++ b/tests/TestSuite_nvgre.py > @@ -452,9 +452,10 @@ class TestNvgre(TestCase): > config.outer_mac_dst = self.dut_rx_port_mac > config.create_pcap() > # time.sleep(10) > + self.dut.send_expect("start", "testpmd>", 10) > config.send_pcap() > # check whether detect nvgre type > - out = self.dut.send_expect("start", "testpmd>", 10) > + out = self.dut.get_session_output() > print out > self.verify(config.packet_type() in out, "Nvgre Packet not detected") > out = self.dut.send_expect("show port stats all", "testpmd>", 10) > @@ -497,8 +498,9 @@ class TestNvgre(TestCase): > > # send nvgre packet > config.create_pcap() > + self.dut.send_expect("start", "testpmd>", 10) > config.send_pcap() > - out = self.dut.send_expect("start", "testpmd>", 10) > + out = self.dut.get_session_output() > print out > queue = -1 > pattern = re.compile("- Receive queue=0x(\d)") > diff --git a/tests/TestSuite_vxlan.py b/tests/TestSuite_vxlan.py > index 5c994c8..cefe817 100644 > --- a/tests/TestSuite_vxlan.py > +++ b/tests/TestSuite_vxlan.py > @@ -391,10 +391,11 @@ class TestVxlan(TestCase, IxiaPacketGenerator): > # be same > config.outer_mac_dst = self.dut_port_mac > config.create_pcap() > + self.dut.send_expect("start", "testpmd>", 10) > config.send_pcap(self.tester_iface) > > # check whether detect vxlan type > - out = self.dut.send_expect("start", "testpmd>", 10) > + out = self.dut.get_session_output() > self.verify(config.packet_type() in out, "Vxlan Packet not detected") > out = self.dut.send_expect("stop", "testpmd>", 10) > self.dut.send_expect("quit", "#", 10) > @@ -595,8 +596,9 @@ class TestVxlan(TestCase, IxiaPacketGenerator): > > # send vxlan packet > config.create_pcap() > + self.dut.send_expect("start", "testpmd>", 10) > config.send_pcap(self.tester_iface) > - out = self.dut.send_expect("start", "testpmd>", 10) > + out = self.dut.get_session_output() > > queue = -1 > pattern = re.compile("- Receive queue=0x(\d)")