DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [dpdk-dev] [PATCH 2/2] test: support cleanup in bitrate and latency test
Date: Wed, 13 May 2020 16:06:29 +0530	[thread overview]
Message-ID: <20200513103629.8436-2-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20200513103629.8436-1-hemant.agrawal@nxp.com>

both bitratestats_autotest latency test initializes
the metrics library. It should be cleaned during exit.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 app/test/test_bitratestats.c | 14 ++++++++++++++
 app/test/test_latencystats.c |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/app/test/test_bitratestats.c b/app/test/test_bitratestats.c
index 3a7d9c037..39d7f734d 100644
--- a/app/test/test_bitratestats.c
+++ b/app/test/test_bitratestats.c
@@ -32,6 +32,18 @@ test_stats_bitrate_create(void)
 	return TEST_SUCCESS;
 }
 
+/* To test free the resources from bitrate_reg test */
+static int
+test_stats_bitrate_free(void)
+{
+	int ret = 0;
+
+	ret = rte_metrics_deinit();
+	TEST_ASSERT(ret >= 0, "Test Failed: rte_metrics_deinit failed");
+
+	return TEST_SUCCESS;
+}
+
 /* To test bit rate registration */
 static int
 test_stats_bitrate_reg(void)
@@ -214,6 +226,8 @@ unit_test_suite bitratestats_testsuite  = {
 		 */
 		TEST_CASE_ST(test_bit_packet_forward, NULL,
 				test_stats_bitrate_calc),
+		/* TEST CASE 9: Test to do the cleanup w.r.t create */
+		TEST_CASE(test_stats_bitrate_free),
 		TEST_CASES_END()
 	}
 };
diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c
index 968e0bc47..427339904 100644
--- a/app/test/test_latencystats.c
+++ b/app/test/test_latencystats.c
@@ -60,6 +60,9 @@ static int test_latency_uninit(void)
 	ret = rte_latencystats_uninit();
 	TEST_ASSERT(ret >= 0, "Test Failed: rte_latencystats_uninit failed");
 
+	ret = rte_metrics_deinit();
+	TEST_ASSERT(ret >= 0, "Test Failed: rte_metrics_deinit failed");
+
 	return TEST_SUCCESS;
 }
 
-- 
2.17.1


  reply	other threads:[~2020-05-13 10:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 10:36 [dpdk-dev] [PATCH 1/2] lib/metrics: fix to reset the init flag Hemant Agrawal
2020-05-13 10:36 ` Hemant Agrawal [this message]
2020-05-19  9:31 ` David Marchand
2020-05-19  9:50   ` Hemant Agrawal
2020-05-19 10:52 ` [dpdk-dev] [PATCH v2 " Hemant Agrawal
2020-05-19 10:52   ` [dpdk-dev] [PATCH v2 2/2] test: support cleanup in bitrate and latency test Hemant Agrawal
2020-05-19 15:24     ` Stephen Hemminger
2020-05-19 12:12   ` [dpdk-dev] [PATCH v2 1/2] lib/metrics: fix to reset the init flag David Marchand
2020-05-19 15:23   ` Stephen Hemminger

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20200513103629.8436-2-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

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

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