test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille
@ 2015-05-29  8:39 huilong,xu
  2015-05-29  8:39 ` [dts] [dts 2/3] [PATCH V1] add queue start stop test plan huilong,xu
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: huilong,xu @ 2015-05-29  8:39 UTC (permalink / raw)
  To: dts; +Cc: jingguox.fu

From: huilong xu <huilongx.xu@intel.com>


Signed-off-by: huilong xu <huilongx.xu@intel.com>
---
 executions/execution_FVL.cfg |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/executions/execution_FVL.cfg b/executions/execution_FVL.cfg
index bd278ba..f2a3e7e 100644
--- a/executions/execution_FVL.cfg
+++ b/executions/execution_FVL.cfg
@@ -7,7 +7,8 @@ test_suites=
     generic_filter,
     dual_vlan,
     vlan,
-    shutdown_api
+    shutdown_api,
+    queue_start_stop
 targets=
     x86_64-native-linuxapp-gcc
 parameters=nic_type=cfg:func=true
-- 
1.7.4.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dts] [dts 2/3] [PATCH V1] add queue start stop test plan
  2015-05-29  8:39 [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille huilong,xu
@ 2015-05-29  8:39 ` huilong,xu
  2015-06-08  1:55   ` Fu, JingguoX
  2015-05-29  8:39 ` [dts] [dts 3/3] [PATCH V1] add queue start queue test code huilong,xu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: huilong,xu @ 2015-05-29  8:39 UTC (permalink / raw)
  To: dts; +Cc: jingguox.fu

From: huilong xu <huilongx.xu@intel.com>


Signed-off-by: huilong xu <huilongx.xu@intel.com>
---
 test_plans/queue_start_stop_test_plan.rst |   75 +++++++++++++++++++++++++++++
 1 files changed, 75 insertions(+), 0 deletions(-)
 create mode 100644 test_plans/queue_start_stop_test_plan.rst

diff --git a/test_plans/queue_start_stop_test_plan.rst b/test_plans/queue_start_stop_test_plan.rst
new file mode 100644
index 0000000..5dd99cc
--- /dev/null
+++ b/test_plans/queue_start_stop_test_plan.rst
@@ -0,0 +1,75 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+======================================
+Intel. DPDK Shutdown API Feature Tests
+======================================
+
+This tests for Shutdown API feature can be run on linux userspace. It
+will check if NIC port can be stopped and restarted without exiting the
+application process. Furthermore, it will check if it can reconfigure
+new configurations for a port after the port is stopped, and if it is
+able to restart with those new configurations. It is based on testpmd
+application.
+
+The test is performed by running the testpmd application and using a
+traffic generator. Port/queue configurations can be set interactively,
+and still be set at the command line when launching the application in
+order to be compatible with previous test framework.
+
+Prerequisites
+-------------
+
+Assume port A and B are connected to the remote ports, e.g. packet generator.
+To run the testpmd application in linuxapp environment with 4 lcores,
+4 channels with other default parameters in interactive mode.
+
+        $ ./testpmd -c 0xf -n 4 -- -i
+
+Test Case: queue start/stop
+---------------------------------------
+this case support PF (fortville), VF(fortville,niantic)
+1. update testpmd source code. add a C code "printf("ports %u queue %u revice %u packages\n", fs->rx_port, fs->rx_queue, nb_rx)".
+in ./app/test-pmd/fwdmac.c
+2. compile testpmd again, then run testpmd.
+3. run "set fwd mac" to set fwd type
+4. run "start" to start fwd package
+5. start packet generator to transmit and receive packets
+6. run "port 0 rxq 0 stop" to stop rxq 0 in port 0
+7. start packet generator to transmit and not receive packets
+8. run "port 0 rxq 0 start" to start rxq 0 in port 0
+9. run "port 1 txq 1 stop" to start txq 0 in port 1
+10. start packet generator to transmit and not receive packets but in testpmd it is a "ports 0 queue 0 revice 1 packages" print
+11. run "port 1 txq 1 start" to start txq 0 in port 1
+12  start packet generator to transmit and receive packets
+13 test it again with VF
+successfully  
-- 
1.7.4.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dts] [dts 3/3] [PATCH V1] add queue start queue test code
  2015-05-29  8:39 [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille huilong,xu
  2015-05-29  8:39 ` [dts] [dts 2/3] [PATCH V1] add queue start stop test plan huilong,xu
@ 2015-05-29  8:39 ` huilong,xu
  2015-06-08  1:55   ` Fu, JingguoX
  2015-06-01  9:21 ` [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille Liu, Yong
  2015-06-08  1:54 ` Fu, JingguoX
  3 siblings, 1 reply; 7+ messages in thread
From: huilong,xu @ 2015-05-29  8:39 UTC (permalink / raw)
  To: dts; +Cc: jingguox.fu

From: huilong xu <huilongx.xu@intel.com>


Signed-off-by: huilong xu <huilongx.xu@intel.com>
---
 tests/TestSuite_queue_start_stop.py |  207 +++++++++++++++++++++++++++++++++++
 1 files changed, 207 insertions(+), 0 deletions(-)
 create mode 100644 tests/TestSuite_queue_start_stop.py

diff --git a/tests/TestSuite_queue_start_stop.py b/tests/TestSuite_queue_start_stop.py
new file mode 100644
index 0000000..4fdc921
--- /dev/null
+++ b/tests/TestSuite_queue_start_stop.py
@@ -0,0 +1,207 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+"""
+DPDK Test suite.
+
+Test queue start stop Feature
+
+"""
+
+import dts
+import time
+import re
+import os
+from test_case import TestCase
+from pmd_output import PmdOutput
+
+#
+#
+# Test class.
+#
+
+
+class TestQueueStartStop(TestCase):
+    #
+    #
+    #
+    # Test cases.
+    #
+
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        """
+        self.ports = self.dut.get_ports(self.nic)
+        self.verify(len(self.ports) >= 2, "Insufficient number of ports.")
+
+    def set_up(self):
+        """
+        Run before each test case.
+        """
+        pass
+
+    def check_forwarding(self, ports, nic, testerports=[None, None], pktSize=64, received=True):
+        self.send_packet(ports[0], ports[1], self.nic, testerports[1], pktSize, received)
+
+    def send_packet(self, txPort, rxPort, nic, testerports=None, pktSize=64, received=True):
+        """
+        Send packages according to parameters.
+        """
+
+        if testerports is None:
+            rxitf = self.tester.get_interface(self.tester.get_local_port(rxPort))
+            txitf = self.tester.get_interface(self.tester.get_local_port(txPort))
+        else:
+            itf = testerports
+        mac = self.dut.get_mac_address(txPort)
+
+        self.tester.scapy_background()
+        self.tester.scapy_append('p=sniff(iface="%s",count=1,timeout=5)' % rxitf)
+        self.tester.scapy_append('RESULT=str(p)')
+
+        self.tester.scapy_foreground()
+
+        if self.nic in ["fortville_eagle", "fortville_spirit",
+                        "fortville_spirit_single", "bartonhills",
+                        "powerville", "springville", "hartwell"]:
+            pktlen = pktSize - 22
+        else:
+            pktlen = pktSize - 18
+        padding = pktlen - 20
+        self.tester.scapy_append('sendp([Ether(dst="%s")/IP()/Raw(load="\x50"*%s)], iface="%s")' % (mac, padding, txitf))
+
+        self.tester.scapy_execute()
+        time.sleep(3)
+
+        out = self.tester.scapy_get_result()
+        if received:
+            self.verify('\x50\x50\x50' in out, "start queue failed")
+        else:
+            self.verify('\x50\x50\x50' not in out, "stop queue failed")
+
+    def add_code_to_dpdk(self, file_name, standard_row, add_rows, offset=0):
+        """
+        this function for add code in dpdk src code file.
+        file: source code full path
+        standard_row: standard row for find the place that add code
+        offset: need offset row number
+        add_rows:add source code
+
+        return: source code lines
+        """
+        file_handel = open(file_name, "r+w")
+        source_lines = file_handel.readlines()
+
+        write_lines = source_lines
+
+        # get the index that need add code
+        index = -1
+        for line in write_lines:
+            if standard_row in line:
+                index = write_lines.index(line) + offset
+                break
+
+        # add source code and re-write the file
+        # print write_lines,index
+        for line in add_rows:
+            write_lines.insert(index, line)
+            index += 1
+        # print write_lines
+        file_handel.seek(file_handel.tell() * -1, 2)
+        file_handel.writelines(write_lines)
+        file_handel.close()
+
+        return source_lines
+
+    def test_queue_start_stop(self):
+        """
+        queue start/stop test for fortville nic
+        """
+        fwdmac_file = os.getcwd() + r'/dep/dpdk/app/test-pmd/macfwd.c'
+        printf_lines = ['printf("ports %u queue %u revice %u packages", fs->rx_port, fs->rx_queue, nb_rx);\n', r'printf("\n");',"\n"]
+        sourcelines = self.add_code_to_dpdk(fwdmac_file, r'(unlikely(nb_rx == 0)', printf_lines, 2)
+        self.dut.session.copy_file_to(fwdmac_file)
+        self.dut.send_expect('scp  /root/macfwd.c /root/dpdk/app/test-pmd/macfwd.c', "#")
+        self.dut.build_dpdk_apps('./app/test-pmd')
+
+        self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i", "testpmd>", 120)
+        self.dut.send_expect("set fwd mac", "testpmd>")
+        self.dut.send_expect("start", "testpmd>")
+        self.check_forwarding([0, 1], self.nic)
+
+        # stop rx queue test
+        print "test stop rx queue"
+        self.dut.send_expect("stop", "testpmd>")
+        self.dut.send_expect("port 0 rxq 0 stop", "testpmd>")
+        self.dut.send_expect("start", "testpmd>")
+        self.check_forwarding([0, 1], self.nic, received=False)
+
+        # start rx queue test
+        print "test start rx queue stop tx queue"
+        self.dut.send_expect("stop", "testpmd>")
+        self.dut.send_expect("port 0 rxq 0 start", "testpmd>")
+        self.dut.send_expect("port 1 txq 0 stop", "testpmd>")
+        self.dut.send_expect("start", "testpmd>")
+        self.check_forwarding([0, 1], self.nic, received=False)
+        out = self.dut.send_expect("\n", "testpmd>")
+        # print out
+        self.verify("ports 0 queue 0 revice 1 packages" in out, "start queue revice package failed")
+
+        # start tx queue test
+        print "test start rx and tx queue"
+        self.dut.send_expect("stop", "testpmd>")
+        self.dut.send_expect("port 0 rxq 0 start", "testpmd>")
+        self.dut.send_expect("port 1 txq 0 start", "testpmd>")
+        self.dut.send_expect("start", "testpmd>")
+        self.check_forwarding([0, 1], self.nic)
+
+        # recover testpmd changed
+        file_handel = open(fwdmac_file, "w")
+        file_handel.writelines(sourcelines)
+        file_handel.close()
+
+    def tear_down(self):
+        """
+        Run after each test case.
+        """
+        self.dut.kill_all()
+
+    def tear_down_all(self):
+        """
+        Run after each test suite.
+        """
+        self.dut.kill_all()
+        #self.dut.send_expect("rm -rf ./app/test-pmd/testpmd", "#")
+        #self.dut.send_expect("rm -rf ./app/test-pmd/*.o", "#")
+        #self.dut.send_expect("rm -rf ./app/test-pmd/build", "#")
-- 
1.7.4.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille
  2015-05-29  8:39 [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille huilong,xu
  2015-05-29  8:39 ` [dts] [dts 2/3] [PATCH V1] add queue start stop test plan huilong,xu
  2015-05-29  8:39 ` [dts] [dts 3/3] [PATCH V1] add queue start queue test code huilong,xu
@ 2015-06-01  9:21 ` Liu, Yong
  2015-06-08  1:54 ` Fu, JingguoX
  3 siblings, 0 replies; 7+ messages in thread
From: Liu, Yong @ 2015-06-01  9:21 UTC (permalink / raw)
  To: Xu, HuilongX, dts; +Cc: Fu, JingguoX

Thanks, applied in 1.1 branch.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of huilong,xu
> Sent: Friday, May 29, 2015 4:40 PM
> To: dts@dpdk.org
> Cc: Fu, JingguoX
> Subject: [dts] [dts 1/3] [PATCH V1] add queue start/stop test for
> forvtille
> 
> From: huilong xu <huilongx.xu@intel.com>
> 
> 
> Signed-off-by: huilong xu <huilongx.xu@intel.com>
> ---
>  executions/execution_FVL.cfg |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/executions/execution_FVL.cfg b/executions/execution_FVL.cfg
> index bd278ba..f2a3e7e 100644
> --- a/executions/execution_FVL.cfg
> +++ b/executions/execution_FVL.cfg
> @@ -7,7 +7,8 @@ test_suites=
>      generic_filter,
>      dual_vlan,
>      vlan,
> -    shutdown_api
> +    shutdown_api,
> +    queue_start_stop
>  targets=
>      x86_64-native-linuxapp-gcc
>  parameters=nic_type=cfg:func=true
> --
> 1.7.4.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille
  2015-05-29  8:39 [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille huilong,xu
                   ` (2 preceding siblings ...)
  2015-06-01  9:21 ` [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille Liu, Yong
@ 2015-06-08  1:54 ` Fu, JingguoX
  3 siblings, 0 replies; 7+ messages in thread
From: Fu, JingguoX @ 2015-06-08  1:54 UTC (permalink / raw)
  To: Xu, HuilongX, dts



> -----Original Message-----
> From: Xu, HuilongX
> Sent: Friday, May 29, 2015 16:40
> To: dts@dpdk.org
> Cc: Fu, JingguoX; Xu, HuilongX
> Subject: [dts 1/3] [PATCH V1] add queue start/stop test for forvtille
> 
> From: huilong xu <huilongx.xu@intel.com>
> 
> 
> Signed-off-by: huilong xu <huilongx.xu@intel.com>
> ---
>  executions/execution_FVL.cfg |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/executions/execution_FVL.cfg b/executions/execution_FVL.cfg
> index bd278ba..f2a3e7e 100644
> --- a/executions/execution_FVL.cfg
> +++ b/executions/execution_FVL.cfg
> @@ -7,7 +7,8 @@ test_suites=
>      generic_filter,
>      dual_vlan,
>      vlan,
> -    shutdown_api
> +    shutdown_api,
> +    queue_start_stop
>  targets=
>      x86_64-native-linuxapp-gcc
>  parameters=nic_type=cfg:func=true
> --
> 1.7.4.4


Acked-by: Jingguo Fu <jingguox.fu@intel.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dts] [dts 2/3] [PATCH V1] add queue start stop test plan
  2015-05-29  8:39 ` [dts] [dts 2/3] [PATCH V1] add queue start stop test plan huilong,xu
@ 2015-06-08  1:55   ` Fu, JingguoX
  0 siblings, 0 replies; 7+ messages in thread
From: Fu, JingguoX @ 2015-06-08  1:55 UTC (permalink / raw)
  To: Xu, HuilongX, dts



> -----Original Message-----
> From: Xu, HuilongX
> Sent: Friday, May 29, 2015 16:40
> To: dts@dpdk.org
> Cc: Fu, JingguoX; Xu, HuilongX
> Subject: [dts 2/3] [PATCH V1] add queue start stop test plan
> 
> From: huilong xu <huilongx.xu@intel.com>
> 
> 
> Signed-off-by: huilong xu <huilongx.xu@intel.com>
> ---
>  test_plans/queue_start_stop_test_plan.rst |   75
> +++++++++++++++++++++++++++++
>  1 files changed, 75 insertions(+), 0 deletions(-)
>  create mode 100644 test_plans/queue_start_stop_test_plan.rst
> 
> diff --git a/test_plans/queue_start_stop_test_plan.rst
> b/test_plans/queue_start_stop_test_plan.rst
> new file mode 100644
> index 0000000..5dd99cc
> --- /dev/null
> +++ b/test_plans/queue_start_stop_test_plan.rst
> @@ -0,0 +1,75 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +#   * Redistributions of source code must retain the above copyright
> +#     notice, this list of conditions and the following disclaimer.
> +#   * Redistributions in binary form must reproduce the above copyright
> +#     notice, this list of conditions and the following disclaimer in
> +#     the documentation and/or other materials provided with the
> +#     distribution.
> +#   * Neither the name of Intel Corporation nor the names of its
> +#     contributors may be used to endorse or promote products derived
> +#     from this software without specific prior written permission.
> +#
> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +
> +======================================
> +Intel. DPDK Shutdown API Feature Tests
> +======================================
> +
> +This tests for Shutdown API feature can be run on linux userspace. It
> +will check if NIC port can be stopped and restarted without exiting the
> +application process. Furthermore, it will check if it can reconfigure
> +new configurations for a port after the port is stopped, and if it is
> +able to restart with those new configurations. It is based on testpmd
> +application.
> +
> +The test is performed by running the testpmd application and using a
> +traffic generator. Port/queue configurations can be set interactively,
> +and still be set at the command line when launching the application in
> +order to be compatible with previous test framework.
> +
> +Prerequisites
> +-------------
> +
> +Assume port A and B are connected to the remote ports, e.g. packet generator.
> +To run the testpmd application in linuxapp environment with 4 lcores,
> +4 channels with other default parameters in interactive mode.
> +
> +        $ ./testpmd -c 0xf -n 4 -- -i
> +
> +Test Case: queue start/stop
> +---------------------------------------
> +this case support PF (fortville), VF(fortville,niantic)
> +1. update testpmd source code. add a C code "printf("ports %u queue %u
> revice %u packages\n", fs->rx_port, fs->rx_queue, nb_rx)".
> +in ./app/test-pmd/fwdmac.c
> +2. compile testpmd again, then run testpmd.
> +3. run "set fwd mac" to set fwd type
> +4. run "start" to start fwd package
> +5. start packet generator to transmit and receive packets
> +6. run "port 0 rxq 0 stop" to stop rxq 0 in port 0
> +7. start packet generator to transmit and not receive packets
> +8. run "port 0 rxq 0 start" to start rxq 0 in port 0
> +9. run "port 1 txq 1 stop" to start txq 0 in port 1
> +10. start packet generator to transmit and not receive packets but in testpmd
> it is a "ports 0 queue 0 revice 1 packages" print
> +11. run "port 1 txq 1 start" to start txq 0 in port 1
> +12  start packet generator to transmit and receive packets
> +13 test it again with VF
> +successfully
> --
> 1.7.4.4

Acked-by: Jingguo Fu <jingguox.fu@intel.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dts] [dts 3/3] [PATCH V1] add queue start queue test code
  2015-05-29  8:39 ` [dts] [dts 3/3] [PATCH V1] add queue start queue test code huilong,xu
@ 2015-06-08  1:55   ` Fu, JingguoX
  0 siblings, 0 replies; 7+ messages in thread
From: Fu, JingguoX @ 2015-06-08  1:55 UTC (permalink / raw)
  To: Xu, HuilongX, dts



> -----Original Message-----
> From: Xu, HuilongX
> Sent: Friday, May 29, 2015 16:40
> To: dts@dpdk.org
> Cc: Fu, JingguoX; Xu, HuilongX
> Subject: [dts 3/3] [PATCH V1] add queue start queue test code
> 
> From: huilong xu <huilongx.xu@intel.com>
> 
> 
> Signed-off-by: huilong xu <huilongx.xu@intel.com>
> ---
>  tests/TestSuite_queue_start_stop.py |  207
> +++++++++++++++++++++++++++++++++++
>  1 files changed, 207 insertions(+), 0 deletions(-)
>  create mode 100644 tests/TestSuite_queue_start_stop.py
> 
> diff --git a/tests/TestSuite_queue_start_stop.py
> b/tests/TestSuite_queue_start_stop.py
> new file mode 100644
> index 0000000..4fdc921
> --- /dev/null
> +++ b/tests/TestSuite_queue_start_stop.py
> @@ -0,0 +1,207 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +#   * Redistributions of source code must retain the above copyright
> +#     notice, this list of conditions and the following disclaimer.
> +#   * Redistributions in binary form must reproduce the above copyright
> +#     notice, this list of conditions and the following disclaimer in
> +#     the documentation and/or other materials provided with the
> +#     distribution.
> +#   * Neither the name of Intel Corporation nor the names of its
> +#     contributors may be used to endorse or promote products derived
> +#     from this software without specific prior written permission.
> +#
> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +
> +
> +"""
> +DPDK Test suite.
> +
> +Test queue start stop Feature
> +
> +"""
> +
> +import dts
> +import time
> +import re
> +import os
> +from test_case import TestCase
> +from pmd_output import PmdOutput
> +
> +#
> +#
> +# Test class.
> +#
> +
> +
> +class TestQueueStartStop(TestCase):
> +    #
> +    #
> +    #
> +    # Test cases.
> +    #
> +
> +    def set_up_all(self):
> +        """
> +        Run at the start of each test suite.
> +        """
> +        self.ports = self.dut.get_ports(self.nic)
> +        self.verify(len(self.ports) >= 2, "Insufficient number of ports.")
> +
> +    def set_up(self):
> +        """
> +        Run before each test case.
> +        """
> +        pass
> +
> +    def check_forwarding(self, ports, nic, testerports=[None, None],
> pktSize=64, received=True):
> +        self.send_packet(ports[0], ports[1], self.nic, testerports[1],
> pktSize, received)
> +
> +    def send_packet(self, txPort, rxPort, nic, testerports=None, pktSize=64,
> received=True):
> +        """
> +        Send packages according to parameters.
> +        """
> +
> +        if testerports is None:
> +            rxitf =
> self.tester.get_interface(self.tester.get_local_port(rxPort))
> +            txitf =
> self.tester.get_interface(self.tester.get_local_port(txPort))
> +        else:
> +            itf = testerports
> +        mac = self.dut.get_mac_address(txPort)
> +
> +        self.tester.scapy_background()
> +        self.tester.scapy_append('p=sniff(iface="%s",count=1,timeout=5)' %
> rxitf)
> +        self.tester.scapy_append('RESULT=str(p)')
> +
> +        self.tester.scapy_foreground()
> +
> +        if self.nic in ["fortville_eagle", "fortville_spirit",
> +                        "fortville_spirit_single", "bartonhills",
> +                        "powerville", "springville", "hartwell"]:
> +            pktlen = pktSize - 22
> +        else:
> +            pktlen = pktSize - 18
> +        padding = pktlen - 20
> +
> self.tester.scapy_append('sendp([Ether(dst="%s")/IP()/Raw(load="\x50"*%s)],
> iface="%s")' % (mac, padding, txitf))
> +
> +        self.tester.scapy_execute()
> +        time.sleep(3)
> +
> +        out = self.tester.scapy_get_result()
> +        if received:
> +            self.verify('\x50\x50\x50' in out, "start queue failed")
> +        else:
> +            self.verify('\x50\x50\x50' not in out, "stop queue failed")
> +
> +    def add_code_to_dpdk(self, file_name, standard_row, add_rows, offset=0):
> +        """
> +        this function for add code in dpdk src code file.
> +        file: source code full path
> +        standard_row: standard row for find the place that add code
> +        offset: need offset row number
> +        add_rows:add source code
> +
> +        return: source code lines
> +        """
> +        file_handel = open(file_name, "r+w")
> +        source_lines = file_handel.readlines()
> +
> +        write_lines = source_lines
> +
> +        # get the index that need add code
> +        index = -1
> +        for line in write_lines:
> +            if standard_row in line:
> +                index = write_lines.index(line) + offset
> +                break
> +
> +        # add source code and re-write the file
> +        # print write_lines,index
> +        for line in add_rows:
> +            write_lines.insert(index, line)
> +            index += 1
> +        # print write_lines
> +        file_handel.seek(file_handel.tell() * -1, 2)
> +        file_handel.writelines(write_lines)
> +        file_handel.close()
> +
> +        return source_lines
> +
> +    def test_queue_start_stop(self):
> +        """
> +        queue start/stop test for fortville nic
> +        """
> +        fwdmac_file = os.getcwd() + r'/dep/dpdk/app/test-pmd/macfwd.c'
> +        printf_lines = ['printf("ports %u queue %u revice %u packages", fs-
> >rx_port, fs->rx_queue, nb_rx);\n', r'printf("\n");',"\n"]
> +        sourcelines = self.add_code_to_dpdk(fwdmac_file, r'(unlikely(nb_rx ==
> 0)', printf_lines, 2)
> +        self.dut.session.copy_file_to(fwdmac_file)
> +        self.dut.send_expect('scp  /root/macfwd.c /root/dpdk/app/test-
> pmd/macfwd.c', "#")
> +        self.dut.build_dpdk_apps('./app/test-pmd')
> +
> +        self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i",
> "testpmd>", 120)
> +        self.dut.send_expect("set fwd mac", "testpmd>")
> +        self.dut.send_expect("start", "testpmd>")
> +        self.check_forwarding([0, 1], self.nic)
> +
> +        # stop rx queue test
> +        print "test stop rx queue"
> +        self.dut.send_expect("stop", "testpmd>")
> +        self.dut.send_expect("port 0 rxq 0 stop", "testpmd>")
> +        self.dut.send_expect("start", "testpmd>")
> +        self.check_forwarding([0, 1], self.nic, received=False)
> +
> +        # start rx queue test
> +        print "test start rx queue stop tx queue"
> +        self.dut.send_expect("stop", "testpmd>")
> +        self.dut.send_expect("port 0 rxq 0 start", "testpmd>")
> +        self.dut.send_expect("port 1 txq 0 stop", "testpmd>")
> +        self.dut.send_expect("start", "testpmd>")
> +        self.check_forwarding([0, 1], self.nic, received=False)
> +        out = self.dut.send_expect("\n", "testpmd>")
> +        # print out
> +        self.verify("ports 0 queue 0 revice 1 packages" in out, "start queue
> revice package failed")
> +
> +        # start tx queue test
> +        print "test start rx and tx queue"
> +        self.dut.send_expect("stop", "testpmd>")
> +        self.dut.send_expect("port 0 rxq 0 start", "testpmd>")
> +        self.dut.send_expect("port 1 txq 0 start", "testpmd>")
> +        self.dut.send_expect("start", "testpmd>")
> +        self.check_forwarding([0, 1], self.nic)
> +
> +        # recover testpmd changed
> +        file_handel = open(fwdmac_file, "w")
> +        file_handel.writelines(sourcelines)
> +        file_handel.close()
> +
> +    def tear_down(self):
> +        """
> +        Run after each test case.
> +        """
> +        self.dut.kill_all()
> +
> +    def tear_down_all(self):
> +        """
> +        Run after each test suite.
> +        """
> +        self.dut.kill_all()
> +        #self.dut.send_expect("rm -rf ./app/test-pmd/testpmd", "#")
> +        #self.dut.send_expect("rm -rf ./app/test-pmd/*.o", "#")
> +        #self.dut.send_expect("rm -rf ./app/test-pmd/build", "#")
> --
> 1.7.4.4

Acked-by: Jingguo Fu <jingguox.fu@intel.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-06-08  1:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-29  8:39 [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille huilong,xu
2015-05-29  8:39 ` [dts] [dts 2/3] [PATCH V1] add queue start stop test plan huilong,xu
2015-06-08  1:55   ` Fu, JingguoX
2015-05-29  8:39 ` [dts] [dts 3/3] [PATCH V1] add queue start queue test code huilong,xu
2015-06-08  1:55   ` Fu, JingguoX
2015-06-01  9:21 ` [dts] [dts 1/3] [PATCH V1] add queue start/stop test for forvtille Liu, Yong
2015-06-08  1:54 ` Fu, JingguoX

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).