From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harman Kalra Subject: [PATCH v2 2/2] test/metrics: first test case fails on continuous Date: Fri, 1 Mar 2019 10:07:41 +0000 Message-ID: <1551434828-3518-2-git-send-email-hkalra@marvell.com> References: <1551264691-26353-1-git-send-email-hkalra@marvell.com> <1551434828-3518-1-git-send-email-hkalra@marvell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "stable@dpdk.org" , "Harman Kalra" To: "remy.horton@intel.com" , "anatoly.burakov@intel.com" , "marko.kovacevic@intel.com" , "john.mcnamara@intel.com" Return-path: In-Reply-To: <1551434828-3518-1-git-send-email-hkalra@marvell.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Issue is observed while running 'metrics_autotest' continuously without quiting. During first execution all test cases pass but second run onwards first test case fails as library is already initialized. To resolve, introduced a new API to deinitialise the library after all test cases are executed. Cc: stable@dpdk.org Signed-off-by: Harman Kalra --- v2: * Adding stable@dpdk.org into cc as patch 1/2 of same patchset falls between bug fix and new feature. app/test/test_metrics.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/test/test_metrics.c b/app/test/test_metrics.c index 3c2f36b8a..78b3936ee 100644 --- a/app/test/test_metrics.c +++ b/app/test/test_metrics.c @@ -28,6 +28,19 @@ test_metrics_init(void) return TEST_SUCCESS; } =20 +/* Deinitialize metric module. This function must be called + * from a primary process after metrics usage is over + */ +static int +test_metrics_deinitialize(void) +{ + int err =3D 0; + err =3D rte_metrics_deinit(); + TEST_ASSERT(err =3D=3D 0, "%s, %d", __func__, __LINE__); + + return TEST_SUCCESS; +} + /* Test Case to check failures when memzone init is not done */ static int test_metrics_without_init(void) @@ -300,6 +313,10 @@ static struct unit_test_suite metrics_testsuite =3D { * arraylist, count size */ TEST_CASE(test_metrics_get_values), + + /* TEST CASE 8: Test to unregister metrics*/ + TEST_CASE(test_metrics_deinitialize), + TEST_CASES_END() } }; --=20 2.18.0