From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D627E58C3 for ; Wed, 18 Nov 2015 11:45:00 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 18 Nov 2015 02:44:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,312,1444719600"; d="scan'208";a="841371195" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.238.55.12]) by fmsmga001.fm.intel.com with ESMTP; 18 Nov 2015 02:45:00 -0800 From: Lijuan Tu To: dts@dpdk.org Date: Wed, 18 Nov 2015 18:40:29 +0800 Message-Id: <1447843229-2720-1-git-send-email-lijuanx.a.tu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [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: Wed, 18 Nov 2015 10:45:01 -0000 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)") -- 1.9.1