* [dts] [PATCH] unit_tests_event_timer: Add test script to event_timer_adapter and test plan
@ 2020-05-02 16:57 pvukkisala
2020-05-06 5:48 ` Tu, Lijuan
0 siblings, 1 reply; 2+ messages in thread
From: pvukkisala @ 2020-05-02 16:57 UTC (permalink / raw)
To: dts; +Cc: sshankarnara, Phanendra Vukkisala
From: Phanendra Vukkisala <pvukkisala@marvell.com>
Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
---
framework/dut.py | 2 +-
test_plans/unit_tests_event_timer_test_plan.rst | 18 ++++++
tests/TestSuite_unit_tests_event_timer.py | 77 +++++++++++++++++++++++
3 files changed, 96 insertions(+), 1 deletion(-)
create mode 100644 test_plans/unit_tests_event_timer_test_plan.rst
create mode 100644 tests/TestSuite_unit_tests_event_timer.py
diff --git a/framework/dut.py b/framework/dut.py
index c3e7c86..73f965e 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -643,7 +643,7 @@ class Dut(Crb):
self.send_expect('echo 0 > /sys/bus/pci/devices/%s/limits/ssow' % (eventdev_port), '#')
for eventdev_port in eventdev_ports:
if eventdev_port == port:
- self.send_expect('echo 0 > /sys/bus/pci/devices/%s/limits/tim' % (eventdev_port), '#')
+ self.send_expect('echo 1 > /sys/bus/pci/devices/%s/limits/tim' % (eventdev_port), '#')
self.send_expect('echo 1 > /sys/bus/pci/devices/%s/limits/npa' % (eventdev_port), '#')
self.send_expect('echo 10 > /sys/bus/pci/devices/%s/limits/sso' % (eventdev_port), '#')
self.send_expect('echo 32 > /sys/bus/pci/devices/%s/limits/ssow' % (eventdev_port), '#')
diff --git a/test_plans/unit_tests_event_timer_test_plan.rst b/test_plans/unit_tests_event_timer_test_plan.rst
new file mode 100644
index 0000000..58ac78c
--- /dev/null
+++ b/test_plans/unit_tests_event_timer_test_plan.rst
@@ -0,0 +1,18 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+ Copyright (C) 2019 Marvell International Ltd.
+
+=======================
+Unit Tests: Event Timer
+=======================
+This is the test plan for Event Timer Adapter auto test.
+
+This section explains how to run the unit tests for event_timer_adapter. The
+test can be launched independently using the command line interface.
+
+The steps to run the unit test manually are as follow::
+
+ # make -C ./app/test/
+ # ./app/test/test -n 1 -c ffff -w <timerdev-pci-bus-id>,<devargs>
+ RTE>> event_timer_adapter_test
+
+The final output of the test has to be "Test OK"
diff --git a/tests/TestSuite_unit_tests_event_timer.py b/tests/TestSuite_unit_tests_event_timer.py
new file mode 100644
index 0000000..479220e
--- /dev/null
+++ b/tests/TestSuite_unit_tests_event_timer.py
@@ -0,0 +1,77 @@
+# BSD LICENSE
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (C) 2019 Marvell International Ltd.
+
+"""
+DPDK Test suite.
+Test Event Timer Adapter Unit test
+"""
+
+import utils
+
+from test_case import TestCase
+
+
+class TestUnitTestEventTimer(TestCase):
+
+ def set_up_all(self):
+ """
+ Run at the start of each test suite.
+
+ PMD prerequisites.
+ """
+
+ cores = self.dut.get_core_list("all")
+ self.coremask = utils.create_mask(cores)
+ # Based on h/w type, choose how many ports to use
+ self.dut_ports = self.dut.get_ports()
+
+ if self.nic == "cavium_a063" or self.nic == "cavium_a064":
+ self.eventdev_device_bus_id = "0002:0e:00.0"
+ self.eventdev_device_id = "a0f9"
+ #### Bind evendev device ####
+ self.dut.bind_eventdev_port(port_to_bind=self.eventdev_device_bus_id)
+
+ #### Configuring evendev SS0 & SSOw limits ####
+ self.dut.set_eventdev_port_limits(self.eventdev_device_id, self.eventdev_device_bus_id)
+ elif self.nic == "cavium_a034":
+ self.eventdev_timer_device_bus_id = "0000:0a:01.0"
+ self.dut.bind_eventdev_port(port_to_bind=self.eventdev_timer_device_bus_id)
+
+
+ def set_up(self):
+ """
+ Run before each test case.
+ """
+ pass
+
+ def test_event_timer_adapter(self):
+ """
+ Event Timer Adapter Autotest
+ """
+
+ if self.nic == "cavium_a063" or self.nic == "cavium_a064":
+ self.dut.send_expect("./%s/app/test -n 1 -c %s -w %s,single_ws=1,tim_stats_ena=1" % (self.target, self.coremask, self.eventdev_device_bus_id), "R.*T.*E.*>.*>", 60)
+ elif self.nic == "cavium_a034":
+ self.dut.send_expect("./%s/app/test -n 1 -c %s -w %s,timvf_stats=1" % (self.target, self.coremask, self.eventdev_timer_device_bus_id), "R.*T.*E.*>.*>", 60)
+ out = self.dut.send_expect("event_timer_adapter_test", "RTE>>", 300)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+ return 'SUCCESS'
+
+
+ def tear_down(self):
+ """
+ Run after each test case.
+ """
+ pass
+
+ def tear_down_all(self):
+ """
+ Run after each test suite.
+ """
+ if self.nic == "cavium_a063" or self.nic == "cavium_a064" :
+ self.dut.unbind_eventdev_port(port_to_unbind=self.eventdev_device_bus_id)
+ elif self.nic == "cavium_a034":
+ self.dut.unbind_eventdev_port(port_to_unbind=self.eventdev_timer_device_bus_id)
+ self.dut.kill_all()
--
1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH] unit_tests_event_timer: Add test script to event_timer_adapter and test plan
2020-05-02 16:57 [dts] [PATCH] unit_tests_event_timer: Add test script to event_timer_adapter and test plan pvukkisala
@ 2020-05-06 5:48 ` Tu, Lijuan
0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-05-06 5:48 UTC (permalink / raw)
To: pvukkisala, dts; +Cc: sshankarnara
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of
> pvukkisala@marvell.com
> Sent: Sunday, May 3, 2020 12:57 AM
> To: dts@dpdk.org
> Cc: sshankarnara@marvell.com; Phanendra Vukkisala
> <pvukkisala@marvell.com>
> Subject: [dts] [PATCH] unit_tests_event_timer: Add test script to
> event_timer_adapter and test plan
>
> From: Phanendra Vukkisala <pvukkisala@marvell.com>
>
> Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
> ---
> framework/dut.py | 2 +-
> test_plans/unit_tests_event_timer_test_plan.rst | 18 ++++++
> tests/TestSuite_unit_tests_event_timer.py | 77
> +++++++++++++++++++++++
> 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644
> test_plans/unit_tests_event_timer_test_plan.rst
> create mode 100644 tests/TestSuite_unit_tests_event_timer.py
>
> diff --git a/framework/dut.py b/framework/dut.py index c3e7c86..73f965e
> 100644
> --- a/framework/dut.py
> +++ b/framework/dut.py
> @@ -643,7 +643,7 @@ class Dut(Crb):
> self.send_expect('echo 0 > /sys/bus/pci/devices/%s/limits/ssow' %
> (eventdev_port), '#')
> for eventdev_port in eventdev_ports:
> if eventdev_port == port:
> - self.send_expect('echo 0 > /sys/bus/pci/devices/%s/limits/tim' %
> (eventdev_port), '#')
> + self.send_expect('echo 1 >
> + /sys/bus/pci/devices/%s/limits/tim' % (eventdev_port), '#')
> self.send_expect('echo 1 > /sys/bus/pci/devices/%s/limits/npa' %
> (eventdev_port), '#')
> self.send_expect('echo 10 > /sys/bus/pci/devices/%s/limits/sso' %
> (eventdev_port), '#')
> self.send_expect('echo 32 > /sys/bus/pci/devices/%s/limits/ssow' %
> (eventdev_port), '#') diff --git
> a/test_plans/unit_tests_event_timer_test_plan.rst
> b/test_plans/unit_tests_event_timer_test_plan.rst
> new file mode 100644
> index 0000000..58ac78c
> --- /dev/null
> +++ b/test_plans/unit_tests_event_timer_test_plan.rst
> @@ -0,0 +1,18 @@
> +.. SPDX-License-Identifier: BSD-3-Clause
> + Copyright (C) 2019 Marvell International Ltd.
> +
> +=======================
> +Unit Tests: Event Timer
> +=======================
> +This is the test plan for Event Timer Adapter auto test.
> +
> +This section explains how to run the unit tests for
> +event_timer_adapter. The test can be launched independently using the
> command line interface.
> +
> +The steps to run the unit test manually are as follow::
> +
> + # make -C ./app/test/
> + # ./app/test/test -n 1 -c ffff -w <timerdev-pci-bus-id>,<devargs>
> + RTE>> event_timer_adapter_test
> +
> +The final output of the test has to be "Test OK"
> diff --git a/tests/TestSuite_unit_tests_event_timer.py
> b/tests/TestSuite_unit_tests_event_timer.py
> new file mode 100644
> index 0000000..479220e
> --- /dev/null
> +++ b/tests/TestSuite_unit_tests_event_timer.py
> @@ -0,0 +1,77 @@
> +# BSD LICENSE
> +# SPDX-License-Identifier: BSD-3-Clause # Copyright (C) 2019 Marvell
> +International Ltd.
> +
> +"""
> +DPDK Test suite.
> +Test Event Timer Adapter Unit test
> +"""
> +
> +import utils
> +
> +from test_case import TestCase
> +
> +
> +class TestUnitTestEventTimer(TestCase):
> +
> + def set_up_all(self):
> + """
> + Run at the start of each test suite.
> +
> + PMD prerequisites.
> + """
> +
> + cores = self.dut.get_core_list("all")
> + self.coremask = utils.create_mask(cores)
> + # Based on h/w type, choose how many ports to use
> + self.dut_ports = self.dut.get_ports()
> +
> + if self.nic == "cavium_a063" or self.nic == "cavium_a064":
> + self.eventdev_device_bus_id = "0002:0e:00.0"
> + self.eventdev_device_id = "a0f9"
> + #### Bind evendev device ####
> +
> + self.dut.bind_eventdev_port(port_to_bind=self.eventdev_device_bus_id)
> +
> + #### Configuring evendev SS0 & SSOw limits ####
> + self.dut.set_eventdev_port_limits(self.eventdev_device_id,
> self.eventdev_device_bus_id)
> + elif self.nic == "cavium_a034":
> + self.eventdev_timer_device_bus_id = "0000:0a:01.0"
> +
> + self.dut.bind_eventdev_port(port_to_bind=self.eventdev_timer_device_bu
> + s_id)
> +
> +
> + def set_up(self):
> + """
> + Run before each test case.
> + """
> + pass
> +
> + def test_event_timer_adapter(self):
> + """
> + Event Timer Adapter Autotest
> + """
> +
> + if self.nic == "cavium_a063" or self.nic == "cavium_a064":
> + self.dut.send_expect("./%s/app/test -n 1 -c %s -
> w %s,single_ws=1,tim_stats_ena=1" % (self.target, self.coremask,
> self.eventdev_device_bus_id), "R.*T.*E.*>.*>", 60)
> + elif self.nic == "cavium_a034":
> + self.dut.send_expect("./%s/app/test -n 1 -c %s -w %s,timvf_stats=1" %
> (self.target, self.coremask, self.eventdev_timer_device_bus_id),
> "R.*T.*E.*>.*>", 60)
> + out = self.dut.send_expect("event_timer_adapter_test", "RTE>>", 300)
> + self.dut.send_expect("quit", "# ")
> + self.verify("Test OK" in out, "Test failed")
> + return 'SUCCESS'
> +
> +
> + def tear_down(self):
> + """
> + Run after each test case.
> + """
> + pass
> +
> + def tear_down_all(self):
> + """
> + Run after each test suite.
> + """
> + if self.nic == "cavium_a063" or self.nic == "cavium_a064" :
> +
> self.dut.unbind_eventdev_port(port_to_unbind=self.eventdev_device_bus_i
> d)
> + elif self.nic == "cavium_a034":
> +
> self.dut.unbind_eventdev_port(port_to_unbind=self.eventdev_timer_device
> _bus_id)
> + self.dut.kill_all()
> --
> 1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-06 5:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02 16:57 [dts] [PATCH] unit_tests_event_timer: Add test script to event_timer_adapter and test plan pvukkisala
2020-05-06 5:48 ` Tu, Lijuan
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).