DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test: add unit tests for metrics library
@ 2018-07-05  7:37 Hari kumar Vemula
  2018-07-05 14:05 ` Remy Horton
  2018-07-21 14:26 ` [dpdk-dev] [PATCH v2] " Hari kumar Vemula
  0 siblings, 2 replies; 12+ messages in thread
From: Hari kumar Vemula @ 2018-07-05  7:37 UTC (permalink / raw)
  To: dev; +Cc: remy.horton, reshma.pattan, Hari kumar Vemula

Unit Testcases are added for metrics library.

Signed-off-by: Hari Kumar <hari.kumarx.vemula@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
---
 test/test/Makefile       |   2 +
 test/test/test_metrics.c | 340 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 342 insertions(+)
 create mode 100644 test/test/test_metrics.c

diff --git a/test/test/Makefile b/test/test/Makefile
index eccc8efcf..8f391cf84 100644
--- a/test/test/Makefile
+++ b/test/test/Makefile
@@ -180,6 +180,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring_perf.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c
 
+SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c
+
 ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y)
 SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
 endif
diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c
new file mode 100644
index 000000000..eaec43dd1
--- /dev/null
+++ b/test/test/test_metrics.c
@@ -0,0 +1,340 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <rte_lcore.h>
+#include <rte_malloc.h>
+#include <rte_metrics.h>
+
+#include "test.h"
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define	REG_METRIC_COUNT	6
+#define	METRIC_LESSER_COUNT	3
+#define INVAL_METRIC_COUNT	30
+#define	KEY	1
+#define	VALUE	1
+#define INVALID_COUNT	257
+
+/* Initializes metric module. This function must be called
+ * from a primary process before metrics are used
+ */
+static int
+test_metrics_init(void)
+{
+	rte_metrics_init(rte_socket_id());
+	return TEST_SUCCESS;
+}
+
+ /* Test Case to check failures when memzone init is not done */
+static int
+test_metrics_without_init(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {0};
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+	};
+
+	/* Failure Test: Checking for memzone initialization */
+	err = rte_metrics_reg_name(NULL);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_reg_names(&mnames[0], 1);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, KEY, &value[0], 4);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err == 0, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL, 0);
+	TEST_ASSERT(err == 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test Case to validate registering a single metric */
+static int
+test_metrics_reg_name_with_validname(void)
+{
+	int err = 0;
+
+	/* Test to register the new metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test to register the same metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test case to validate registering a invalid metric */
+	err = rte_metrics_reg_name(NULL);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate registering a list of valid  metric names */
+static int
+test_metrics_reg_names(void)
+{
+	int err = 0;
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+		};
+
+
+	/* Success Test: valid array and count size */
+	err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames));
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: valid array and higher count size than array size*/
+	err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames) + 2);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: valid array and count size lessthan 1*/
+	err = rte_metrics_reg_names(&mnames[0], 0);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: valid array and count exceeds max count  */
+	err = rte_metrics_reg_names(&mnames[0], INVALID_COUNT);
+	TEST_ASSERT(err == -ENOMEM, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid array and valid count size */
+	err = rte_metrics_reg_names(NULL, ARRAY_SIZE(mnames) + 2);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Valid array and Invalid count size */
+	err = rte_metrics_reg_names(&mnames[0], INVAL_METRIC_COUNT);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a metric */
+static int
+test_metrics_update_value(void)
+{
+	int err = 0;
+
+	/* Successful Test: Valid port_id, key and value */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid port_id otherthan RTE_METRICS_GLOBAL, key
+	 * and value
+	 */
+	err = rte_metrics_update_value(9, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with lower value */
+	err = rte_metrics_update_value(-2, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with higher value */
+	err = rte_metrics_update_value(39, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: valid port id, value with invalid key */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY+12, VALUE);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a list of  metrics  */
+static int
+test_metrics_update_values(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {1, 2, 3, 4, 5, 6};
+
+	/* Success Test: valid data */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid count size */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, &value[0], 0);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	/* Success Test: valid data with lower count stats size */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, &value[0], ARRAY_SIZE(value) - 3);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(lower value) and valid data */
+	err = rte_metrics_update_values(-2, KEY, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(higher value) and valid data */
+	err = rte_metrics_update_values(39, 1, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: higher count size */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, &value[0], ARRAY_SIZE(value) + 5);
+	TEST_ASSERT(err == -ERANGE, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid array */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, NULL, ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get metric name-key lookup table */
+static int
+test_metrics_get_names(void)
+{
+	int err = 0;
+	struct rte_metric_name metrics[METRIC_LESSER_COUNT];
+	struct rte_metric_name success_metrics[REG_METRIC_COUNT];
+
+	/* Successful Test: Invalid array list */
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Correct Count Stats same
+	 * as memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Increase Count Stats than
+	 * memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT+5);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, Not update results:
+	 * Invalid array list, Lesser Count Stats than allocated stats
+	 */
+	err = rte_metrics_get_names(metrics, METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid array list, Correct Count Stats same as
+	 * memzone stats
+	 */
+	err = rte_metrics_get_names(metrics, REG_METRIC_COUNT);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid array list, Increased Count Stats */
+	err = rte_metrics_get_names(metrics, REG_METRIC_COUNT+9);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get list of metric values  */
+static int
+test_metrics_get_values(void)
+{
+	int err = 0;
+	struct rte_metric_value getvalues[REG_METRIC_COUNT] = {0};
+
+	/* Successful Test, Not update results: valid arguments
+	 * count lessthan the memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, update results: valid arguments */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test : valid arguments count greaterthan the
+	 * memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			REG_METRIC_COUNT+2);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(lower value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(-2, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(higher value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(33, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+	/* Successful Test: valid port_id with incorrect values and  valid
+	 * capacity
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+static struct unit_test_suite metrics_testsuite  = {
+	.suite_name = "Metrics Unit Test Suite",
+	.setup = NULL,
+	.teardown = NULL,
+	.unit_test_cases = {
+		/* Test Case 1: Test to check all metric APIs without
+		 * metrics init
+		 */
+		TEST_CASE(test_metrics_without_init),
+
+		/* TEST CASE 2: Test to register valid metrics*/
+		TEST_CASE_ST(test_metrics_init, NULL,
+				test_metrics_reg_name_with_validname),
+
+		/* TEST CASE 3: Test to register list of metrics with valid
+		 * names and valid count size, invalid names and invalid
+		 * count size
+		 */
+		TEST_CASE(test_metrics_reg_names),
+
+		/* TEST CASE 4: Test to register a update value with valid port
+		 * id and invalid port id
+		 */
+		TEST_CASE(test_metrics_update_value),
+
+		/* TEST CASE 5: Test to register update list of values with
+		 * valid port id, key, value, count size and invalid port id,
+		 * key, value, count size
+		 */
+		TEST_CASE(test_metrics_update_values),
+
+		/* TEST CASE 6: Test to get metric names-key with valid
+		 * array list, count size and invalid array list, count size
+		 */
+		TEST_CASE(test_metrics_get_names),
+
+		/* TEST CASE 7: Test to get list of metric values with valid
+		 * port id, array list, count size and invalid port id,
+		 * arraylist, count size
+		 */
+		TEST_CASE(test_metrics_get_values),
+
+		TEST_CASES_END()
+	}
+};
+
+static int
+test_metrics(void)
+{
+	return unit_test_suite_runner(&metrics_testsuite);
+}
+
+REGISTER_TEST_COMMAND(metrics_autotest, test_metrics);
-- 
2.13.6

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

* Re: [dpdk-dev] [PATCH] test: add unit tests for metrics library
  2018-07-05  7:37 [dpdk-dev] [PATCH] test: add unit tests for metrics library Hari kumar Vemula
@ 2018-07-05 14:05 ` Remy Horton
  2018-07-21 14:26 ` [dpdk-dev] [PATCH v2] " Hari kumar Vemula
  1 sibling, 0 replies; 12+ messages in thread
From: Remy Horton @ 2018-07-05 14:05 UTC (permalink / raw)
  To: Hari kumar Vemula; +Cc: reshma.pattan, dev

'noon,

See inline comments.

On 05/07/2018 08:37, Hari kumar Vemula wrote:
> Unit Testcases are added for metrics library.

[..]

> +/* Test case to validate registering a list of valid  metric names */
> +static int
> +test_metrics_reg_names(void)
> +{
> +	int err = 0;
> +	const char * const mnames[] = {
> +		"mean_bits_in", "mean_bits_out",
> +		"peak_bits_in", "peak_bits_out",
> +		};
> +
> +
> +	/* Success Test: valid array and count size */
> +	err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames));
> +	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
> +
> +	/* Failure Test: valid array and higher count size than array size*/
> +	err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames) + 2);
> +	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);

rte_metrics_reg_names() relies on cnt_names being truthful about the 
size of *names. If it is overstated there is nothing to prevent an array 
overrun and in most cases a core-dump.

> +
> +	/* Failure Test: valid array and count size lessthan 1*/
> +	err = rte_metrics_reg_names(&mnames[0], 0);
> +	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
> +
> +	/* Failure Test: valid array and count exceeds max count  */
> +	err = rte_metrics_reg_names(&mnames[0], INVALID_COUNT);
> +	TEST_ASSERT(err == -ENOMEM, "%s, %d", __func__, __LINE__);

See previous comment.

> +
> +	/* Failure Test: Invalid array and valid count size */
> +	err = rte_metrics_reg_names(NULL, ARRAY_SIZE(mnames) + 2);
> +	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
> +
> +	/* Failure Test: Valid array and Invalid count size */
> +	err = rte_metrics_reg_names(&mnames[0], INVAL_METRIC_COUNT);
> +	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);

Ditto.

> +
> +	return TEST_SUCCESS;
> +}
> +

[..]

> +/* Test case to validate update a list of  metrics  */
> +static int
> +test_metrics_update_values(void)
> +{
> +	int err = 0;
> +	const uint64_t  value[REG_METRIC_COUNT] = {1, 2, 3, 4, 5, 6};
> +
> +	/* Success Test: valid data */
> +	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
> +			 KEY, &value[0], ARRAY_SIZE(value));
> +	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);

Updates cannot overlap more than one metric set. A successful test would be:

         /* Success Test: valid data */
         err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 0,
                 &value[0], 1);
         TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
         err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 1,
                 &value[1], 1);
         TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
         err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 2,
                 &value[2], 4);
         TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);

I am wondering whether this constraint should be removed.


> +	/* Failed Test: Invalid count size */
> +	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
> +			 KEY, &value[0], 0);
> +	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);

Good catch. Will update library code.


> +
> +	/* Success Test: valid data with lower count stats size */
> +	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
> +			 KEY, &value[0], ARRAY_SIZE(value) - 3);
> +	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);

KEY should be 2, which is where the set of size four starts. The set 
starting at KEY (i.e 1) is of size one.


> +
> +	/* Failed Test: Invalid port_id(lower value) and valid data */
> +	err = rte_metrics_update_values(-2, KEY, &value[0], ARRAY_SIZE(value));
> +	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
> +
> +	/* Failed Test: Invalid port_id(higher value) and valid data */
> +	err = rte_metrics_update_values(39, 1, &value[0], ARRAY_SIZE(value));
> +	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);

Testcases Ok.

> +
> +	/* Failed Test: higher count size */
> +	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
> +			 KEY, &value[0], ARRAY_SIZE(value) + 5);
> +	TEST_ASSERT(err == -ERANGE, "%s, %d", __func__, __LINE__);

Array sizes should not be overstated.

> +
> +	/* Failed Test: Invalid array */
> +	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
> +			 KEY, NULL, ARRAY_SIZE(value));
> +	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
> +
> +	return TEST_SUCCESS;
> +}


> +
> +/* Test to validate get metric name-key lookup table */
> +static int
> +test_metrics_get_names(void)
> +{
[..]

> +
> +	/* Failure Test: Invalid array list, Correct Count Stats same as
> +	 * memzone stats
> +	 */
> +	err = rte_metrics_get_names(metrics, REG_METRIC_COUNT);
> +	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);

Overstated array size.

> +
> +	/* Failure Test: Invalid array list, Increased Count Stats */
> +	err = rte_metrics_get_names(metrics, REG_METRIC_COUNT+9);
> +	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);

Overstated array size.


> +
> +	return TEST_SUCCESS;
> +}
> +
> +/* Test to validate get list of metric values  */


..Remy

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

* [dpdk-dev] [PATCH v2] test: add unit tests for metrics library
  2018-07-05  7:37 [dpdk-dev] [PATCH] test: add unit tests for metrics library Hari kumar Vemula
  2018-07-05 14:05 ` Remy Horton
@ 2018-07-21 14:26 ` Hari kumar Vemula
  2018-07-24 14:53   ` Remy Horton
  2018-08-03 14:33   ` [dpdk-dev] [PATCH v3 0/3] add unit test " Hari Kumar Vemula
  1 sibling, 2 replies; 12+ messages in thread
From: Hari kumar Vemula @ 2018-07-21 14:26 UTC (permalink / raw)
  To: dev; +Cc: remy.horton, reshma.pattan, Hari Kumar Vemula

From: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>

Unit testcases are added for metrics library.

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Remy Horton <remy.horton@intel.com>
---
v2: Removal of overstated array size based testcases as suggested
---
 test/test/Makefile       |   2 +
 test/test/test_metrics.c | 307 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 309 insertions(+)
 create mode 100644 test/test/test_metrics.c

diff --git a/test/test/Makefile b/test/test/Makefile
index e6967bab6..30bc53087 100644
--- a/test/test/Makefile
+++ b/test/test/Makefile
@@ -183,6 +183,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c
 
+SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c
+
 ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y)
 SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
 endif
diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c
new file mode 100644
index 000000000..d01f381cd
--- /dev/null
+++ b/test/test/test_metrics.c
@@ -0,0 +1,307 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <rte_lcore.h>
+#include <rte_malloc.h>
+#include <rte_metrics.h>
+
+#include "test.h"
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define	REG_METRIC_COUNT	6
+#define	METRIC_LESSER_COUNT	3
+#define	KEY	1
+#define	VALUE	1
+
+/* Initializes metric module. This function must be called
+ * from a primary process before metrics are used
+ */
+static int
+test_metrics_init(void)
+{
+	rte_metrics_init(rte_socket_id());
+	return TEST_SUCCESS;
+}
+
+ /* Test Case to check failures when memzone init is not done */
+static int
+test_metrics_without_init(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {0};
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+	};
+
+	/* Failure Test: Checking for memzone initialization */
+	err = rte_metrics_reg_name(NULL);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_reg_names(&mnames[0], 1);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, KEY, &value[0], 4);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err == 0, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL, 0);
+	TEST_ASSERT(err == 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test Case to validate registering a single metric */
+static int
+test_metrics_reg_name_with_validname(void)
+{
+	int err = 0;
+
+	/* Test to register the new metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test to register the same metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test case to validate registering a invalid metric */
+	err = rte_metrics_reg_name(NULL);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate registering a list of valid  metric names */
+static int
+test_metrics_reg_names(void)
+{
+	int err = 0;
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+		};
+
+	/* Success Test: valid array and count size */
+	err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames));
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a metric */
+static int
+test_metrics_update_value(void)
+{
+	int err = 0;
+
+	/* Successful Test: Valid port_id, key and value */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid port_id otherthan RTE_METRICS_GLOBAL, key
+	 * and value
+	 */
+	err = rte_metrics_update_value(9, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with lower value */
+	err = rte_metrics_update_value(-2, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with higher value */
+	err = rte_metrics_update_value(39, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: valid port id, value with invalid key */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY+12, VALUE);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a list of  metrics  */
+static int
+test_metrics_update_values(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {1, 2, 3, 4, 5, 6};
+
+	/* Successful Test: update metrics with first set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 0,
+			&value[0], 1);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: update metrics with second set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 1,
+			&value[1], 1);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: update metrics with third set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 2,
+			&value[2], 4);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid count size */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, &value[0], 0);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(lower value) and valid data */
+	err = rte_metrics_update_values(-2, KEY, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(higher value) and valid data */
+	err = rte_metrics_update_values(39, 1, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid array */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, NULL, ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get metric name-key lookup table */
+static int
+test_metrics_get_names(void)
+{
+	int err = 0;
+	struct rte_metric_name metrics[METRIC_LESSER_COUNT];
+	struct rte_metric_name success_metrics[REG_METRIC_COUNT];
+
+	/* Successful Test: Invalid array list */
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Correct Count Stats same
+	 * as memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Increase Count Stats than
+	 * memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT+5);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, Not update results:
+	 * Invalid array list, Lesser Count Stats than allocated stats
+	 */
+	err = rte_metrics_get_names(metrics, METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get list of metric values  */
+static int
+test_metrics_get_values(void)
+{
+	int err = 0;
+	struct rte_metric_value getvalues[REG_METRIC_COUNT] = {0};
+
+	/* Successful Test, Not update results: valid arguments
+	 * count lessthan the memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, update results: valid arguments */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test : valid arguments count greaterthan the
+	 * memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			REG_METRIC_COUNT+2);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(lower value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(-2, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(higher value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(33, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: valid port_id with incorrect values and  valid
+	 * capacity
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+static struct unit_test_suite metrics_testsuite  = {
+	.suite_name = "Metrics Unit Test Suite",
+	.setup = NULL,
+	.teardown = NULL,
+	.unit_test_cases = {
+		/* Test Case 1: Test to check all metric APIs without
+		 * metrics init
+		 */
+		TEST_CASE(test_metrics_without_init),
+
+		/* TEST CASE 2: Test to register valid metrics*/
+		TEST_CASE_ST(test_metrics_init, NULL,
+				test_metrics_reg_name_with_validname),
+
+		/* TEST CASE 3: Test to register list of metrics with valid
+		 * names and valid count size, invalid names and invalid
+		 * count size
+		 */
+		TEST_CASE(test_metrics_reg_names),
+
+		/* TEST CASE 4: Test to register a update value with valid port
+		 * id and invalid port id
+		 */
+		TEST_CASE(test_metrics_update_value),
+
+		/* TEST CASE 5: Test to register update list of values with
+		 * valid port id, key, value, count size and invalid port id,
+		 * key, value, count size
+		 */
+		TEST_CASE(test_metrics_update_values),
+
+		/* TEST CASE 6: Test to get metric names-key with valid
+		 * array list, count size and invalid array list, count size
+		 */
+		TEST_CASE(test_metrics_get_names),
+
+		/* TEST CASE 7: Test to get list of metric values with valid
+		 * port id, array list, count size and invalid port id,
+		 * arraylist, count size
+		 */
+		TEST_CASE(test_metrics_get_values),
+		TEST_CASES_END()
+	}
+};
+
+static int
+test_metrics(void)
+{
+	return unit_test_suite_runner(&metrics_testsuite);
+}
+
+REGISTER_TEST_COMMAND(metrics_autotest, test_metrics);
-- 
2.13.6

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

* Re: [dpdk-dev] [PATCH v2] test: add unit tests for metrics library
  2018-07-21 14:26 ` [dpdk-dev] [PATCH v2] " Hari kumar Vemula
@ 2018-07-24 14:53   ` Remy Horton
  2018-08-03 14:33   ` [dpdk-dev] [PATCH v3 0/3] add unit test " Hari Kumar Vemula
  1 sibling, 0 replies; 12+ messages in thread
From: Remy Horton @ 2018-07-24 14:53 UTC (permalink / raw)
  To: Hari kumar Vemula, dev; +Cc: reshma.pattan

Tested using the following patches also applied:

http://patches.dpdk.org/patch/42097/
http://patches.dpdk.org/patch/42098/
http://patches.dpdk.org/patch/42510/
http://patches.dpdk.org/patch/42971/

Two test-cases fail, but these in themselves ought not block this patch. 
Details below.

Acked-by: Remy Horton <remy.horton@intel.com>


> + /* Test Case to check failures when memzone init is not done */
> +static int
> +test_metrics_without_init(void)
> +{
> +	int err = 0;
> +	const uint64_t  value[REG_METRIC_COUNT] = {0};
> +	const char * const mnames[] = {
> +		"mean_bits_in", "mean_bits_out",
> +		"peak_bits_in", "peak_bits_out",
> +	};
> +
> +	/* Failure Test: Checking for memzone initialization */
> +	err = rte_metrics_reg_name(NULL);
> +	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);

Returns -EINVAL instead of -EIO due to NULL check coming before memzone 
check. Suggest using non-NULL value.


> +/* Test case to validate update a list of  metrics  */
> +static int
> +test_metrics_update_values(void)
> +{
[..]
> +	/* Failed Test: Invalid count size */
> +	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
> +			 KEY, &value[0], 0);
> +	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);

Test fails, fault with library: Silent handling length of zero. Will 
send patch.

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

* [dpdk-dev] [PATCH v3 0/3] add unit test for metrics library
  2018-07-21 14:26 ` [dpdk-dev] [PATCH v2] " Hari kumar Vemula
  2018-07-24 14:53   ` Remy Horton
@ 2018-08-03 14:33   ` Hari Kumar Vemula
  2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 1/3] test: add unit tests " Hari Kumar Vemula
                       ` (3 more replies)
  1 sibling, 4 replies; 12+ messages in thread
From: Hari Kumar Vemula @ 2018-08-03 14:33 UTC (permalink / raw)
  To: dev; +Cc: remy.horton, reshma.pattan, Hari Kumar Vemula

1/3: add unit tests for metrics library
2/3: add new unit tests to autotest list
3/3: updated maintainer for metrics test

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>

---
v3: Resolved clang compilation issue,
    changed the expected value of tests in test_metrics_without_init
    as per library fix
    added metrics test to the autotest list
    updated maintainers file for metrics unit test
v2: Removal of overstated array size based testcases as suggested
---

Hari Kumar Vemula (3):
  test: add unit tests for metrics library
  autotest: add new unit tests to autotest list
  maintainers: add metrics test

 MAINTAINERS                |   1 +
 test/test/Makefile         |   2 +
 test/test/autotest_data.py |   6 +
 test/test/test_metrics.c   | 312 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 321 insertions(+)
 create mode 100644 test/test/test_metrics.c

-- 
2.13.6

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

* [dpdk-dev] [PATCH v3 1/3] test: add unit tests for metrics library
  2018-08-03 14:33   ` [dpdk-dev] [PATCH v3 0/3] add unit test " Hari Kumar Vemula
@ 2018-08-03 14:33     ` Hari Kumar Vemula
  2018-08-15  9:29       ` Pattan, Reshma
  2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 2/3] autotest: add new unit tests to autotest list Hari Kumar Vemula
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Hari Kumar Vemula @ 2018-08-03 14:33 UTC (permalink / raw)
  To: dev; +Cc: remy.horton, reshma.pattan, Hari Kumar Vemula

Unit testcases are added for metrics library.

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Remy Horton <remy.horton@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
---
 test/test/Makefile       |   2 +
 test/test/test_metrics.c | 312 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 314 insertions(+)
 create mode 100644 test/test/test_metrics.c

diff --git a/test/test/Makefile b/test/test/Makefile
index e6967bab6..30bc53087 100644
--- a/test/test/Makefile
+++ b/test/test/Makefile
@@ -183,6 +183,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c
 
+SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c
+
 ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y)
 SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
 endif
diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c
new file mode 100644
index 000000000..12b96625f
--- /dev/null
+++ b/test/test/test_metrics.c
@@ -0,0 +1,312 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <rte_lcore.h>
+#include <rte_malloc.h>
+#include <rte_metrics.h>
+
+#include "test.h"
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define	REG_METRIC_COUNT	6
+#define	METRIC_LESSER_COUNT	3
+#define	KEY	1
+#define	VALUE	1
+
+/* Initializes metric module. This function must be called
+ * from a primary process before metrics are used
+ */
+static int
+test_metrics_init(void)
+{
+	rte_metrics_init(rte_socket_id());
+	return TEST_SUCCESS;
+}
+
+ /* Test Case to check failures when memzone init is not done */
+static int
+test_metrics_without_init(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {0};
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+	};
+
+	/* Failure Test: Checking for memzone initialization */
+	err = rte_metrics_reg_name("peak_bits_in");
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_reg_names(&mnames[0], 1);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, KEY, &value[0], 4);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL, 0);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test Case to validate registering a single metric */
+static int
+test_metrics_reg_name_with_validname(void)
+{
+	int err = 0;
+
+	/* Test to register the new metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test to register the same metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test case to validate registering a invalid metric */
+	err = rte_metrics_reg_name(NULL);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate registering a list of valid  metric names */
+static int
+test_metrics_reg_names(void)
+{
+	int err = 0;
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+		};
+
+	/* Success Test: valid array and count size */
+	err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames));
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a metric */
+static int
+test_metrics_update_value(void)
+{
+	int err = 0;
+
+	/* Successful Test: Valid port_id, key and value */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid port_id otherthan RTE_METRICS_GLOBAL, key
+	 * and value
+	 */
+	err = rte_metrics_update_value(9, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with lower value */
+	err = rte_metrics_update_value(-2, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with higher value */
+	err = rte_metrics_update_value(39, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: valid port id, value with invalid key */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY+12, VALUE);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a list of  metrics  */
+static int
+test_metrics_update_values(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {1, 2, 3, 4, 5, 6};
+
+	/* Successful Test: update metrics with first set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 0,
+			&value[0], 1);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: update metrics with second set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 1,
+			&value[1], 1);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: update metrics with third set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 2,
+			&value[2], 4);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid count size */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, &value[0], 0);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(lower value) and valid data */
+	err = rte_metrics_update_values(-2, KEY, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(higher value) and valid data */
+	err = rte_metrics_update_values(39, 1, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid array */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, NULL, ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get metric name-key lookup table */
+static int
+test_metrics_get_names(void)
+{
+	int err = 0;
+	struct rte_metric_name metrics[METRIC_LESSER_COUNT];
+	struct rte_metric_name success_metrics[REG_METRIC_COUNT];
+
+	/* Successful Test: Invalid array list */
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Correct Count Stats same
+	 * as memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Increase Count Stats than
+	 * memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT+5);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, Not update results:
+	 * Invalid array list, Lesser Count Stats than allocated stats
+	 */
+	err = rte_metrics_get_names(metrics, METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get list of metric values  */
+static int
+test_metrics_get_values(void)
+{
+	int i = 0;
+	int err = 0;
+	struct rte_metric_value getvalues[REG_METRIC_COUNT];
+
+	size_t m_size = sizeof(struct rte_metric_value);
+	for (i = 0; i < REG_METRIC_COUNT; i++)
+		memset(&getvalues[i], 0, m_size);
+
+	/* Successful Test, Not update results: valid arguments
+	 * count lessthan the memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, update results: valid arguments */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test : valid arguments count greaterthan the
+	 * memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			REG_METRIC_COUNT+2);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(lower value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(-2, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(higher value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(33, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: valid port_id with incorrect values and  valid
+	 * capacity
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+static struct unit_test_suite metrics_testsuite  = {
+	.suite_name = "Metrics Unit Test Suite",
+	.setup = NULL,
+	.teardown = NULL,
+	.unit_test_cases = {
+		/* Test Case 1: Test to check all metric APIs without
+		 * metrics init
+		 */
+		TEST_CASE(test_metrics_without_init),
+
+		/* TEST CASE 2: Test to register valid metrics*/
+		TEST_CASE_ST(test_metrics_init, NULL,
+				test_metrics_reg_name_with_validname),
+
+		/* TEST CASE 3: Test to register list of metrics with valid
+		 * names and valid count size, invalid names and invalid
+		 * count size
+		 */
+		TEST_CASE(test_metrics_reg_names),
+
+		/* TEST CASE 4: Test to register a update value with valid port
+		 * id and invalid port id
+		 */
+		TEST_CASE(test_metrics_update_value),
+
+		/* TEST CASE 5: Test to register update list of values with
+		 * valid port id, key, value, count size and invalid port id,
+		 * key, value, count size
+		 */
+		TEST_CASE(test_metrics_update_values),
+
+		/* TEST CASE 6: Test to get metric names-key with valid
+		 * array list, count size and invalid array list, count size
+		 */
+		TEST_CASE(test_metrics_get_names),
+
+		/* TEST CASE 7: Test to get list of metric values with valid
+		 * port id, array list, count size and invalid port id,
+		 * arraylist, count size
+		 */
+		TEST_CASE(test_metrics_get_values),
+		TEST_CASES_END()
+	}
+};
+
+static int
+test_metrics(void)
+{
+	return unit_test_suite_runner(&metrics_testsuite);
+}
+
+REGISTER_TEST_COMMAND(metrics_autotest, test_metrics);
-- 
2.13.6

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

* [dpdk-dev] [PATCH v3 2/3] autotest: add new unit tests to autotest list
  2018-08-03 14:33   ` [dpdk-dev] [PATCH v3 0/3] add unit test " Hari Kumar Vemula
  2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 1/3] test: add unit tests " Hari Kumar Vemula
@ 2018-08-03 14:33     ` Hari Kumar Vemula
  2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 3/3] maintainers: add metrics test Hari Kumar Vemula
  2018-08-24 12:56     ` [dpdk-dev] [PATCH v4] test: add unit tests for metrics library Hari Kumar Vemula
  3 siblings, 0 replies; 12+ messages in thread
From: Hari Kumar Vemula @ 2018-08-03 14:33 UTC (permalink / raw)
  To: dev; +Cc: remy.horton, reshma.pattan, Hari Kumar Vemula

added metrics unit test to autotest list.

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
---
 test/test/autotest_data.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/test/autotest_data.py b/test/test/autotest_data.py
index f68d9b111..9fc4f2fbc 100644
--- a/test/test/autotest_data.py
+++ b/test/test/autotest_data.py
@@ -482,6 +482,12 @@
         "Func":    default_autotest,
         "Report":  None,
     },
+    {
+        "Name":    "Metrics autotest",
+        "Command": "metrics_autotest",
+        "Func":    default_autotest,
+        "Report":  None,
+    },
     #
     #Please always keep all dump tests at the end and together!
     #
-- 
2.13.6

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

* [dpdk-dev] [PATCH v3 3/3] maintainers: add metrics test
  2018-08-03 14:33   ` [dpdk-dev] [PATCH v3 0/3] add unit test " Hari Kumar Vemula
  2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 1/3] test: add unit tests " Hari Kumar Vemula
  2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 2/3] autotest: add new unit tests to autotest list Hari Kumar Vemula
@ 2018-08-03 14:33     ` Hari Kumar Vemula
  2018-08-24 12:56     ` [dpdk-dev] [PATCH v4] test: add unit tests for metrics library Hari Kumar Vemula
  3 siblings, 0 replies; 12+ messages in thread
From: Hari Kumar Vemula @ 2018-08-03 14:33 UTC (permalink / raw)
  To: dev; +Cc: remy.horton, reshma.pattan, Hari Kumar Vemula

Update MAINTAINERSHIP for metrics unit test

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3b9fec76f..7057b8a0c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1140,6 +1140,7 @@ F: doc/guides/sample_app_ug/l2_forward_job_stats.rst
 Metrics
 M: Remy Horton <remy.horton@intel.com>
 F: lib/librte_metrics/
+F: test/test/test_metrics.c
 
 Bit-rate statistics
 M: Remy Horton <remy.horton@intel.com>
-- 
2.13.6

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

* Re: [dpdk-dev] [PATCH v3 1/3] test: add unit tests for metrics library
  2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 1/3] test: add unit tests " Hari Kumar Vemula
@ 2018-08-15  9:29       ` Pattan, Reshma
  0 siblings, 0 replies; 12+ messages in thread
From: Pattan, Reshma @ 2018-08-15  9:29 UTC (permalink / raw)
  To: Vemula, Hari KumarX, dev; +Cc: Horton, Remy

Hi Hari,

> -----Original Message-----
> From: Vemula, Hari KumarX
> Sent: Friday, August 3, 2018 3:33 PM
> To: dev@dpdk.org
> Cc: Horton, Remy <remy.horton@intel.com>; Pattan, Reshma
> <reshma.pattan@intel.com>; Vemula, Hari KumarX
> <hari.kumarx.vemula@intel.com>
> Subject: [PATCH v3 1/3] test: add unit tests for metrics library
> 
> Unit testcases are added for metrics library.
> 
> Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
> Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
> Reviewed-by: Remy Horton <remy.horton@intel.com>
> Acked-by: Remy Horton <remy.horton@intel.com>
> ---
>  test/test/Makefile       |   2 +
>  test/test/test_metrics.c | 312
> +++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 314 insertions(+)
>  create mode 100644 test/test/test_metrics.c
> 
> diff --git a/test/test/Makefile b/test/test/Makefile index
> e6967bab6..30bc53087 100644
> --- a/test/test/Makefile
> +++ b/test/test/Makefile
> @@ -183,6 +183,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) +=
>  SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c  endif

You have to update meson.build as well, to include new UT.
And make sure meson build works fine.

Thanks,
Reshma

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

* [dpdk-dev] [PATCH v4] test: add unit tests for metrics library
  2018-08-03 14:33   ` [dpdk-dev] [PATCH v3 0/3] add unit test " Hari Kumar Vemula
                       ` (2 preceding siblings ...)
  2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 3/3] maintainers: add metrics test Hari Kumar Vemula
@ 2018-08-24 12:56     ` Hari Kumar Vemula
  2018-10-08 13:01       ` [dpdk-dev] [PATCH v5] " Hari Kumar Vemula
  3 siblings, 1 reply; 12+ messages in thread
From: Hari Kumar Vemula @ 2018-08-24 12:56 UTC (permalink / raw)
  To: dev; +Cc: remy.horton, reshma.pattan, Hari Kumar Vemula

Unit testcases are added for metrics library
Added metrics unit test to autotest list
Updated meson build file
Updated MAINTAINERSHIP for metrics unit test

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Remy Horton <remy.horton@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
---
v4: Updated changes required for meson build
    Updated headers as per iwyu
v3: Resolved clang compilation issue,
    changed the expected value of tests in test_metrics_without_init
    as per library fix
    added metrics test to the autotest list
    updated maintainers file for metrics unit test
v2: Removal of overstated array size based testcases as suggested
---
 MAINTAINERS                |   1 +
 test/test/Makefile         |   2 +
 test/test/autotest_data.py |   6 +
 test/test/meson.build      |   3 +
 test/test/test_metrics.c   | 313 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 325 insertions(+)
 create mode 100644 test/test/test_metrics.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 9fd258fad..3b04419c8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1140,6 +1140,7 @@ F: doc/guides/sample_app_ug/l2_forward_job_stats.rst
 Metrics
 M: Remy Horton <remy.horton@intel.com>
 F: lib/librte_metrics/
+F: test/test/test_metrics.c
 
 Bit-rate statistics
 M: Remy Horton <remy.horton@intel.com>
diff --git a/test/test/Makefile b/test/test/Makefile
index e6967bab6..30bc53087 100644
--- a/test/test/Makefile
+++ b/test/test/Makefile
@@ -183,6 +183,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c
 
+SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c
+
 ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y)
 SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
 endif
diff --git a/test/test/autotest_data.py b/test/test/autotest_data.py
index f68d9b111..9fc4f2fbc 100644
--- a/test/test/autotest_data.py
+++ b/test/test/autotest_data.py
@@ -482,6 +482,12 @@
         "Func":    default_autotest,
         "Report":  None,
     },
+    {
+        "Name":    "Metrics autotest",
+        "Command": "metrics_autotest",
+        "Func":    default_autotest,
+        "Report":  None,
+    },
     #
     #Please always keep all dump tests at the end and together!
     #
diff --git a/test/test/meson.build b/test/test/meson.build
index b1dd6eca2..7f846f707 100644
--- a/test/test/meson.build
+++ b/test/test/meson.build
@@ -63,6 +63,7 @@ test_sources = files('commands.c',
 	'test_mempool_perf.c',
 	'test_memzone.c',
 	'test_meter.c',
+	'test_metrics.c',
 	'test_mp_secondary.c',
 	'test_per_lcore.c',
 	'test_pmd_perf.c',
@@ -111,6 +112,7 @@ test_deps = ['acl',
 	'hash',
 	'lpm',
 	'member',
+	'metrics',
 	'pipeline',
 	'port',
 	'reorder',
@@ -183,6 +185,7 @@ test_names = [
 	'mempool_perf_autotest',
 	'memzone_autotest',
 	'meter_autotest',
+	'metrics_autotest',
 	'multiprocess_autotest',
 	'per_lcore_autotest',
 	'pmd_perf_autotest',
diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c
new file mode 100644
index 000000000..94d54d71c
--- /dev/null
+++ b/test/test/test_metrics.c
@@ -0,0 +1,313 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <errno.h>
+
+#include <rte_lcore.h>
+#include <rte_metrics.h>
+
+#include "test.h"
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define	REG_METRIC_COUNT	6
+#define	METRIC_LESSER_COUNT	3
+#define	KEY	1
+#define	VALUE	1
+
+/* Initializes metric module. This function must be called
+ * from a primary process before metrics are used
+ */
+static int
+test_metrics_init(void)
+{
+	rte_metrics_init(rte_socket_id());
+	return TEST_SUCCESS;
+}
+
+ /* Test Case to check failures when memzone init is not done */
+static int
+test_metrics_without_init(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {0};
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+	};
+
+	/* Failure Test: Checking for memzone initialization */
+	err = rte_metrics_reg_name("peak_bits_in");
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_reg_names(&mnames[0], 1);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, KEY, &value[0], 4);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL, 0);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test Case to validate registering a single metric */
+static int
+test_metrics_reg_name_with_validname(void)
+{
+	int err = 0;
+
+	/* Test to register the new metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test to register the same metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test case to validate registering a invalid metric */
+	err = rte_metrics_reg_name(NULL);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate registering a list of valid  metric names */
+static int
+test_metrics_reg_names(void)
+{
+	int err = 0;
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+		};
+
+	/* Success Test: valid array and count size */
+	err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames));
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a metric */
+static int
+test_metrics_update_value(void)
+{
+	int err = 0;
+
+	/* Successful Test: Valid port_id, key and value */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid port_id otherthan RTE_METRICS_GLOBAL, key
+	 * and value
+	 */
+	err = rte_metrics_update_value(9, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with lower value */
+	err = rte_metrics_update_value(-2, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with higher value */
+	err = rte_metrics_update_value(39, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: valid port id, value with invalid key */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY+12, VALUE);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a list of  metrics  */
+static int
+test_metrics_update_values(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {1, 2, 3, 4, 5, 6};
+
+	/* Successful Test: update metrics with first set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 0,
+			&value[0], 1);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: update metrics with second set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 1,
+			&value[1], 1);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: update metrics with third set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 2,
+			&value[2], 4);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid count size */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, &value[0], 0);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(lower value) and valid data */
+	err = rte_metrics_update_values(-2, KEY, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(higher value) and valid data */
+	err = rte_metrics_update_values(39, 1, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid array */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, NULL, ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get metric name-key lookup table */
+static int
+test_metrics_get_names(void)
+{
+	int err = 0;
+	struct rte_metric_name metrics[METRIC_LESSER_COUNT];
+	struct rte_metric_name success_metrics[REG_METRIC_COUNT];
+
+	/* Successful Test: Invalid array list */
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Correct Count Stats same
+	 * as memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Increase Count Stats than
+	 * memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT+5);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, Not update results:
+	 * Invalid array list, Lesser Count Stats than allocated stats
+	 */
+	err = rte_metrics_get_names(metrics, METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get list of metric values  */
+static int
+test_metrics_get_values(void)
+{
+	int i = 0;
+	int err = 0;
+	struct rte_metric_value getvalues[REG_METRIC_COUNT];
+
+	size_t m_size = sizeof(struct rte_metric_value);
+	for (i = 0; i < REG_METRIC_COUNT; i++)
+		memset(&getvalues[i], 0, m_size);
+
+	/* Successful Test, Not update results: valid arguments
+	 * count lessthan the memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, update results: valid arguments */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test : valid arguments count greaterthan the
+	 * memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			REG_METRIC_COUNT+2);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(lower value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(-2, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(higher value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(33, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: valid port_id with incorrect values and  valid
+	 * capacity
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+static struct unit_test_suite metrics_testsuite  = {
+	.suite_name = "Metrics Unit Test Suite",
+	.setup = NULL,
+	.teardown = NULL,
+	.unit_test_cases = {
+		/* Test Case 1: Test to check all metric APIs without
+		 * metrics init
+		 */
+		TEST_CASE(test_metrics_without_init),
+
+		/* TEST CASE 2: Test to register valid metrics*/
+		TEST_CASE_ST(test_metrics_init, NULL,
+				test_metrics_reg_name_with_validname),
+
+		/* TEST CASE 3: Test to register list of metrics with valid
+		 * names and valid count size, invalid names and invalid
+		 * count size
+		 */
+		TEST_CASE(test_metrics_reg_names),
+
+		/* TEST CASE 4: Test to register a update value with valid port
+		 * id and invalid port id
+		 */
+		TEST_CASE(test_metrics_update_value),
+
+		/* TEST CASE 5: Test to register update list of values with
+		 * valid port id, key, value, count size and invalid port id,
+		 * key, value, count size
+		 */
+		TEST_CASE(test_metrics_update_values),
+
+		/* TEST CASE 6: Test to get metric names-key with valid
+		 * array list, count size and invalid array list, count size
+		 */
+		TEST_CASE(test_metrics_get_names),
+
+		/* TEST CASE 7: Test to get list of metric values with valid
+		 * port id, array list, count size and invalid port id,
+		 * arraylist, count size
+		 */
+		TEST_CASE(test_metrics_get_values),
+		TEST_CASES_END()
+	}
+};
+
+static int
+test_metrics(void)
+{
+	return unit_test_suite_runner(&metrics_testsuite);
+}
+
+REGISTER_TEST_COMMAND(metrics_autotest, test_metrics);
-- 
2.13.6

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

* [dpdk-dev] [PATCH v5] test: add unit tests for metrics library
  2018-08-24 12:56     ` [dpdk-dev] [PATCH v4] test: add unit tests for metrics library Hari Kumar Vemula
@ 2018-10-08 13:01       ` Hari Kumar Vemula
  2018-10-29  3:01         ` Thomas Monjalon
  0 siblings, 1 reply; 12+ messages in thread
From: Hari Kumar Vemula @ 2018-10-08 13:01 UTC (permalink / raw)
  To: dev; +Cc: remy.horton, reshma.pattan, Hari Kumar Vemula

Unit testcases are added for metrics library
Added metrics unit test to autotest list
Updated meson build file
Updated MAINTAINERSHIP for metrics unit test

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Remy Horton <remy.horton@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
---
v5: Rebased on new codebase
v4: Updated changes required for meson build
v3: Resolved clang compilation issue,
    changed the expected value of tests in test_metrics_without_init
    as per library fix
    added metrics test to the autotest list
    updated maintainers file for metrics unit test
v2: Removal of overstated array size based testcases as suggested
---
 MAINTAINERS                |   1 +
 test/test/Makefile         |   2 +
 test/test/autotest_data.py |   6 +
 test/test/meson.build      |   3 +
 test/test/test_metrics.c   | 313 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 325 insertions(+)
 create mode 100644 test/test/test_metrics.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 84b9ff786..6b73dc22d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1152,6 +1152,7 @@ F: doc/guides/sample_app_ug/l2_forward_job_stats.rst
 Metrics
 M: Remy Horton <remy.horton@intel.com>
 F: lib/librte_metrics/
+F: test/test/test_metrics.c
 
 Bit-rate statistics
 M: Remy Horton <remy.horton@intel.com>
diff --git a/test/test/Makefile b/test/test/Makefile
index dcea4410d..e01fdd90a 100644
--- a/test/test/Makefile
+++ b/test/test/Makefile
@@ -183,6 +183,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c
 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c
 
+SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c
+
 ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y)
 SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
 endif
diff --git a/test/test/autotest_data.py b/test/test/autotest_data.py
index f68d9b111..9fc4f2fbc 100644
--- a/test/test/autotest_data.py
+++ b/test/test/autotest_data.py
@@ -482,6 +482,12 @@
         "Func":    default_autotest,
         "Report":  None,
     },
+    {
+        "Name":    "Metrics autotest",
+        "Command": "metrics_autotest",
+        "Func":    default_autotest,
+        "Report":  None,
+    },
     #
     #Please always keep all dump tests at the end and together!
     #
diff --git a/test/test/meson.build b/test/test/meson.build
index bacb5b144..9dba82d52 100644
--- a/test/test/meson.build
+++ b/test/test/meson.build
@@ -67,6 +67,7 @@ test_sources = files('commands.c',
 	'test_mempool_perf.c',
 	'test_memzone.c',
 	'test_meter.c',
+	'test_metrics.c',
 	'test_mp_secondary.c',
 	'test_per_lcore.c',
 	'test_pmd_perf.c',
@@ -115,6 +116,7 @@ test_deps = ['acl',
 	'hash',
 	'lpm',
 	'member',
+	'metrics',
 	'pipeline',
 	'port',
 	'reorder',
@@ -192,6 +194,7 @@ test_names = [
 	'mempool_perf_autotest',
 	'memzone_autotest',
 	'meter_autotest',
+	'metrics_autotest',
 	'multiprocess_autotest',
 	'per_lcore_autotest',
 	'pmd_perf_autotest',
diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c
new file mode 100644
index 000000000..94d54d71c
--- /dev/null
+++ b/test/test/test_metrics.c
@@ -0,0 +1,313 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <errno.h>
+
+#include <rte_lcore.h>
+#include <rte_metrics.h>
+
+#include "test.h"
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define	REG_METRIC_COUNT	6
+#define	METRIC_LESSER_COUNT	3
+#define	KEY	1
+#define	VALUE	1
+
+/* Initializes metric module. This function must be called
+ * from a primary process before metrics are used
+ */
+static int
+test_metrics_init(void)
+{
+	rte_metrics_init(rte_socket_id());
+	return TEST_SUCCESS;
+}
+
+ /* Test Case to check failures when memzone init is not done */
+static int
+test_metrics_without_init(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {0};
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+	};
+
+	/* Failure Test: Checking for memzone initialization */
+	err = rte_metrics_reg_name("peak_bits_in");
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_reg_names(&mnames[0], 1);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, KEY, &value[0], 4);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL, 0);
+	TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test Case to validate registering a single metric */
+static int
+test_metrics_reg_name_with_validname(void)
+{
+	int err = 0;
+
+	/* Test to register the new metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test to register the same metric name */
+	err = rte_metrics_reg_name("peak_bits_out");
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Test case to validate registering a invalid metric */
+	err = rte_metrics_reg_name(NULL);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate registering a list of valid  metric names */
+static int
+test_metrics_reg_names(void)
+{
+	int err = 0;
+	const char * const mnames[] = {
+		"mean_bits_in", "mean_bits_out",
+		"peak_bits_in", "peak_bits_out",
+		};
+
+	/* Success Test: valid array and count size */
+	err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames));
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a metric */
+static int
+test_metrics_update_value(void)
+{
+	int err = 0;
+
+	/* Successful Test: Valid port_id, key and value */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid port_id otherthan RTE_METRICS_GLOBAL, key
+	 * and value
+	 */
+	err = rte_metrics_update_value(9, KEY, VALUE);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with lower value */
+	err = rte_metrics_update_value(-2, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id with higher value */
+	err = rte_metrics_update_value(39, KEY, VALUE);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: valid port id, value with invalid key */
+	err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY+12, VALUE);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test case to validate update a list of  metrics  */
+static int
+test_metrics_update_values(void)
+{
+	int err = 0;
+	const uint64_t  value[REG_METRIC_COUNT] = {1, 2, 3, 4, 5, 6};
+
+	/* Successful Test: update metrics with first set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 0,
+			&value[0], 1);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: update metrics with second set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 1,
+			&value[1], 1);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: update metrics with third set */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL, 2,
+			&value[2], 4);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid count size */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, &value[0], 0);
+	TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(lower value) and valid data */
+	err = rte_metrics_update_values(-2, KEY, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid port_id(higher value) and valid data */
+	err = rte_metrics_update_values(39, 1, &value[0], ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failed Test: Invalid array */
+	err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
+			 KEY, NULL, ARRAY_SIZE(value));
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get metric name-key lookup table */
+static int
+test_metrics_get_names(void)
+{
+	int err = 0;
+	struct rte_metric_name metrics[METRIC_LESSER_COUNT];
+	struct rte_metric_name success_metrics[REG_METRIC_COUNT];
+
+	/* Successful Test: Invalid array list */
+	err = rte_metrics_get_names(NULL, 0);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Correct Count Stats same
+	 * as memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: Valid array list, Increase Count Stats than
+	 * memzone stats
+	 */
+	err = rte_metrics_get_names(success_metrics, REG_METRIC_COUNT+5);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, Not update results:
+	 * Invalid array list, Lesser Count Stats than allocated stats
+	 */
+	err = rte_metrics_get_names(metrics, METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+/* Test to validate get list of metric values  */
+static int
+test_metrics_get_values(void)
+{
+	int i = 0;
+	int err = 0;
+	struct rte_metric_value getvalues[REG_METRIC_COUNT];
+
+	size_t m_size = sizeof(struct rte_metric_value);
+	for (i = 0; i < REG_METRIC_COUNT; i++)
+		memset(&getvalues[i], 0, m_size);
+
+	/* Successful Test, Not update results: valid arguments
+	 * count lessthan the memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 METRIC_LESSER_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test, update results: valid arguments */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test : valid arguments count greaterthan the
+	 * memzone stats
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, getvalues,
+			REG_METRIC_COUNT+2);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(lower value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(-2, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Failure Test: Invalid port_id(higher value) with correct values
+	 * and  Capacity
+	 */
+	err = rte_metrics_get_values(33, getvalues, REG_METRIC_COUNT);
+	TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
+
+	/* Successful Test: valid port_id with incorrect values and  valid
+	 * capacity
+	 */
+	err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL,
+			 REG_METRIC_COUNT);
+	TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
+static struct unit_test_suite metrics_testsuite  = {
+	.suite_name = "Metrics Unit Test Suite",
+	.setup = NULL,
+	.teardown = NULL,
+	.unit_test_cases = {
+		/* Test Case 1: Test to check all metric APIs without
+		 * metrics init
+		 */
+		TEST_CASE(test_metrics_without_init),
+
+		/* TEST CASE 2: Test to register valid metrics*/
+		TEST_CASE_ST(test_metrics_init, NULL,
+				test_metrics_reg_name_with_validname),
+
+		/* TEST CASE 3: Test to register list of metrics with valid
+		 * names and valid count size, invalid names and invalid
+		 * count size
+		 */
+		TEST_CASE(test_metrics_reg_names),
+
+		/* TEST CASE 4: Test to register a update value with valid port
+		 * id and invalid port id
+		 */
+		TEST_CASE(test_metrics_update_value),
+
+		/* TEST CASE 5: Test to register update list of values with
+		 * valid port id, key, value, count size and invalid port id,
+		 * key, value, count size
+		 */
+		TEST_CASE(test_metrics_update_values),
+
+		/* TEST CASE 6: Test to get metric names-key with valid
+		 * array list, count size and invalid array list, count size
+		 */
+		TEST_CASE(test_metrics_get_names),
+
+		/* TEST CASE 7: Test to get list of metric values with valid
+		 * port id, array list, count size and invalid port id,
+		 * arraylist, count size
+		 */
+		TEST_CASE(test_metrics_get_values),
+		TEST_CASES_END()
+	}
+};
+
+static int
+test_metrics(void)
+{
+	return unit_test_suite_runner(&metrics_testsuite);
+}
+
+REGISTER_TEST_COMMAND(metrics_autotest, test_metrics);
-- 
2.13.6

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

* Re: [dpdk-dev] [PATCH v5] test: add unit tests for metrics library
  2018-10-08 13:01       ` [dpdk-dev] [PATCH v5] " Hari Kumar Vemula
@ 2018-10-29  3:01         ` Thomas Monjalon
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2018-10-29  3:01 UTC (permalink / raw)
  To: Hari Kumar Vemula; +Cc: dev, remy.horton, reshma.pattan

08/10/2018 15:01, Hari Kumar Vemula:
> Unit testcases are added for metrics library
> Added metrics unit test to autotest list
> Updated meson build file
> Updated MAINTAINERSHIP for metrics unit test
> 
> Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
> Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
> Reviewed-by: Remy Horton <remy.horton@intel.com>
> Acked-by: Remy Horton <remy.horton@intel.com>

Applied, thanks

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

end of thread, other threads:[~2018-10-29  3:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-05  7:37 [dpdk-dev] [PATCH] test: add unit tests for metrics library Hari kumar Vemula
2018-07-05 14:05 ` Remy Horton
2018-07-21 14:26 ` [dpdk-dev] [PATCH v2] " Hari kumar Vemula
2018-07-24 14:53   ` Remy Horton
2018-08-03 14:33   ` [dpdk-dev] [PATCH v3 0/3] add unit test " Hari Kumar Vemula
2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 1/3] test: add unit tests " Hari Kumar Vemula
2018-08-15  9:29       ` Pattan, Reshma
2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 2/3] autotest: add new unit tests to autotest list Hari Kumar Vemula
2018-08-03 14:33     ` [dpdk-dev] [PATCH v3 3/3] maintainers: add metrics test Hari Kumar Vemula
2018-08-24 12:56     ` [dpdk-dev] [PATCH v4] test: add unit tests for metrics library Hari Kumar Vemula
2018-10-08 13:01       ` [dpdk-dev] [PATCH v5] " Hari Kumar Vemula
2018-10-29  3:01         ` Thomas Monjalon

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