From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 802E1A00E6 for ; Thu, 11 Jul 2019 11:26:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 44D591B958; Thu, 11 Jul 2019 11:26:20 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id ABB751B958 for ; Thu, 11 Jul 2019 11:26:18 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6B9OrHs019602; Thu, 11 Jul 2019 02:26:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=dXmXeT3AQkFIb6rmoZZQy6k5Vghi0fA6Bj6fYD/NsBE=; b=TAj6Xnq1PpKMUuO8kPkUWmiBcWUGMBI8pVdz7OBdkPyga6JcEmxsDlMWkA6gsXBzPZql aaUTmPXlfKkMfko8VSvu0AaTT4Ktn1UZnQPhUndaAwirWOcJTmo1H3602HMEoTi+juUP EtCXxcDxTT4+XLGp4JQaaYhneZNZZpyk4DPJwTaHYQNlsO2ABT1CpJr+uR5QtSI0WQxs cdhxpSbEa0fyYD/AaVQFCcSlIo7ywd2AAaPKgfsOn8cagM0b4mbbecQqWPH9piMO66Qj k77uBybzpRhYr5XJLdEnIafUqzuBTd5sbJRNajEj7f/tdjnDgVAAOVmy6r9VYqaKsekw WQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2tnys9gksh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2019 02:26:17 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 11 Jul 2019 02:26:16 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.52) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Thu, 11 Jul 2019 02:26:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iwGTbR96/OPf2CQu/gQky+RfKYioknUGJyi5IoR6heZeei1BHIJOURGvh9frsl6gGMx+5YfE+S9eN10DYUW2sXs4DqqicpGO/rYDi58b0MpQgRGecfcnnci0keb0gijGJVufbE1mqsbFhq/vlpw7r6bZaqVofrHOyjsUFepy9CqG9xyQ6YxlOCNzBbBKts4NAqioOjPtzLSt7HLu69iSAXoigNIofCgkBlVAS6ZIKHG0PnHxb04wDL6kfC4KpnLFMoMSWxkI/CCYMG/vzl6S9K81MQuZokl98r6cbQkI6bJn29qUa+VUbHvZkE0f7lzrtTw6X1tQeciIqqR2lsjODw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dXmXeT3AQkFIb6rmoZZQy6k5Vghi0fA6Bj6fYD/NsBE=; b=JZE8+8KYYFakDxNPxMArkzUsgQzFGViE5wTfDSG6dfzmgBUTKfn8Z+BI8u8fG+t76zRP+mwFkGObLyrAPouyFGKpRrkUYn9b4XlVumh8UKkbq5uhXeBhOIbjdo0TG83A7sPXl0Qc6ca0D8uxRIVkSCYVOf/YK29zRLUJjuB5zkMAc7rwjyu1xlBNbzsCvT3G4H3s9gO2dWPmyhcF5wyDRz1/A8E2haP8acRwR2/A7GjGBEXut3tp9OdRk7zLk5MXPvdPdVLfpe4sAQGkSex/5uyDrqmg1nscwHpfyAXWKsgQwHkJbJowvXG//cvVHJLd6xZSLwwBw9qVfiYXp+U14Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=marvell.com;dmarc=pass action=none header.from=marvell.com;dkim=pass header.d=marvell.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dXmXeT3AQkFIb6rmoZZQy6k5Vghi0fA6Bj6fYD/NsBE=; b=Y459LdsdYoqv1sR6rtkggVTzAYDuGHzd0+rY+NvvrGrqVsuj1LZ94SIbv3aIWxuP8oyFF6HhqpM4Mky4AkkF91lstMAo0E0P0VMrIaVVGkb0RSWV9K9qWHpSEiI52YJKoxirwN5gppW20Qs/pPjcOPpZTAshGZnl15QEOwBN304= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.21.149) by MN2PR18MB3072.namprd18.prod.outlook.com (20.179.20.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.10; Thu, 11 Jul 2019 09:26:12 +0000 Received: from MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::4447:9459:5386:2e18]) by MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::4447:9459:5386:2e18%7]) with mapi id 15.20.2073.008; Thu, 11 Jul 2019 09:26:12 +0000 From: Harman Kalra To: "thomas@monjalon.net" , "remy.horton@intel.com" , "reshma.pattan@intel.com" , "anatoly.burakov@intel.com" , "marko.kovacevic@intel.com" , "john.mcnamara@intel.com" CC: "dev@dpdk.org" , Harman Kalra Thread-Topic: [PATCH v4 2/2] test/metrics: fix metrics autotest failure Thread-Index: AQHVN8qu+lxTseGTBEOKiBuIzmq9oQ== Date: Thu, 11 Jul 2019 09:26:12 +0000 Message-ID: <1562837134-14830-2-git-send-email-hkalra@marvell.com> References: <2087123.3zRFCGiTdz@xps> <1562837134-14830-1-git-send-email-hkalra@marvell.com> In-Reply-To: <1562837134-14830-1-git-send-email-hkalra@marvell.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PN1PR0101CA0058.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::20) To MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:3e::21) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b1adccfe-c260-45d4-6be0-08d705e1d06c x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR18MB3072; x-ms-traffictypediagnostic: MN2PR18MB3072: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 0095BCF226 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39850400004)(346002)(376002)(396003)(136003)(366004)(199004)(189003)(6116002)(3846002)(86362001)(68736007)(107886003)(11346002)(71190400001)(8676002)(53936002)(81166006)(2616005)(2201001)(66946007)(446003)(81156014)(486006)(66476007)(64756008)(66556008)(66446008)(14454004)(25786009)(6512007)(71200400001)(476003)(36756003)(6436002)(6506007)(52116002)(4326008)(76176011)(7736002)(478600001)(99286004)(386003)(50226002)(5660300002)(2906002)(55236004)(316002)(6486002)(305945005)(102836004)(110136005)(66066001)(2501003)(26005)(54906003)(186003)(256004)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3072; H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: spzEIYhxcJTOdKYVZJ6JHtAUlif8Ml1Atija+JxXZMOUTRoj5Qoz1LAoD7FJdsL/7Qc4fpJUAmqKHmHZpTQhl+CHiLvLsK1c0797vk7bo/wgYJbicnQeBd6l4vqp342aqMnwhXcITvcRP2Q3SgIeLiS07j5OQU1GRG8oJx/MFR3njxk1fYhxTp2oyCFnB8HWb+O4Qpekkwo6BABRf2pX8SXYTIsHa7CJYXVyCXrkJiXuhbVDX/H3Qqv9g8KG62Q09ls60QR6TefxUpklFg/RqKuc/C/L0d5ewhEO37m17Q42ZoDhjmvdZWJqiMRt+8ebfd+cXO+NWyFmXWfpBTzwIuR3xHpS8r5lz7PJBa6wPFeJ4d2VkNbjcogE1mDuy/X0xPs9wCzK4IWE8oF0oKUCfl6tt3rpj7yg/CtnvI5oBko= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b1adccfe-c260-45d4-6be0-08d705e1d06c X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2019 09:26:12.1050 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hkalra@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3072 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-11_01:, , signatures=0 Subject: [dpdk-dev] [PATCH v4 2/2] test/metrics: fix metrics autotest failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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. Fixes: cd3804242901 ("test/metrics: add unit tests for metrics library") Signed-off-by: Harman Kalra Tested-by : Reshma Pattan Reviewed-by: Reshma Pattan Acked-by: Reshma Pattan Acked-by: Remy Horton --- 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