[v1,1/2] raw/skeleton: reset rawdev test statistics

Message ID 20200921214420.29171-1-l.wojciechow@partner.samsung.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v1,1/2] raw/skeleton: reset rawdev test statistics |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Lukasz Wojciechowski Sept. 21, 2020, 9:44 p.m. UTC
  Statistics: passed, failed, unsupported and total are kept
in global static variables. As global variables they are initiated
with zeroes. However running test multiple times cumulates results
from previous calls.

This patch resets statistics with zeroes in testsuite_setup().

To reproduce issue fixed by this patch, run rawdev_autotest command
in dpdk-test app multiple times.

Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
Cc: shreyansh.jain@nxp.com

Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
---
 drivers/raw/skeleton/skeleton_rawdev_test.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Hemant Agrawal Sept. 22, 2020, 4:15 a.m. UTC | #1
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  
Thomas Monjalon Oct. 6, 2020, 9:31 p.m. UTC | #2
21/09/2020 23:44, Lukasz Wojciechowski:
> Statistics: passed, failed, unsupported and total are kept
> in global static variables. As global variables they are initiated
> with zeroes. However running test multiple times cumulates results
> from previous calls.
> 
> This patch resets statistics with zeroes in testsuite_setup().
> 
> To reproduce issue fixed by this patch, run rawdev_autotest command
> in dpdk-test app multiple times.
> 
> Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
> Cc: shreyansh.jain@nxp.com
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Applied, thanks
  

Patch

diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c
index bb4b6efe4..1405df080 100644
--- a/drivers/raw/skeleton/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton/skeleton_rawdev_test.c
@@ -42,6 +42,12 @@  static int
 testsuite_setup(void)
 {
 	uint8_t count;
+
+	total = 0;
+	passed = 0;
+	failed = 0;
+	unsupported = 0;
+
 	count = rte_rawdev_count();
 	if (!count) {
 		SKELDEV_TEST_INFO("\tNo existing rawdev; "