test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Liu, Yong" <yong.liu@intel.com>
To: Lijuan Tu <lijuanx.a.tu@intel.com>, dts@dpdk.org
Subject: Re: [dts] [PATCH]nvgre, vxlan, multiprocess: fix get-output errors
Date: Thu, 19 Nov 2015 10:43:56 +0800	[thread overview]
Message-ID: <564D376C.4080805@intel.com> (raw)
In-Reply-To: <1447843229-2720-1-git-send-email-lijuanx.a.tu@intel.com>

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 <lijuanx.a.tu@intel.com>
> ---
>   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)")

      reply	other threads:[~2015-11-19  2:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 10:40 Lijuan Tu
2015-11-19  2:43 ` Liu, Yong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=564D376C.4080805@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuanx.a.tu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).