From patchwork Wed May 13 10:36:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186586 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp335944ilb; Wed, 13 May 2020 03:39:01 -0700 (PDT) X-Google-Smtp-Source: APiQypKCet1Xtqr3BWCgA8a9rqoaQBLPMlS0vgEaPAxwcM1KvXO1YDrOEba0MmSo8IDdMtl6coPF X-Received: by 2002:a1c:5f08:: with SMTP id t8mr27904591wmb.67.1589366341649; Wed, 13 May 2020 03:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589366341; cv=none; d=google.com; s=arc-20160816; b=n4LvIwmxdqRyRtYdYLL+4EpL6hMuP98HlUlWjj/tyrNH5oMAON6HvFrDAk2f0uNEOe y+NdcR2F4gNazirGhkem2sUORWNxxHpmxkKChfRjcoltIAp9GrVKgKmb7lc3xGfdhljn y3HlDQ8r9Ltz9eDijCuhlSf3ytY7mx/WlzafS5KyTwtZ+VJk9z814RZjfXsX5yAi4e/u aY9LctZE45QpwknSfYZebyiXP0ku0lFOBCfE6zUtp8Bc/f9E+aAxnJKQZcxz7l41x+Z3 1ajzpy0Dwc/Pb37pAXzqiYN00W1RHBZtKCw/0vRXMwoLn8dHs2j4tuMDZIScs/KF5fpH UEpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=iYFyhLjckSe9OD9JwmqyvgsjOXKAFDkRmx5E3MjSzz0=; b=T6Xb4VtxhnPI1mFz2fvTfojbLp492w7U2D6YmKKwALsII9W1fJnbykObJ4KoSo/3mi aamdS8h7gc3eEZsT1uuaEZvw636xB8nwjT58GbplmUn7V+/+XHJTCjsifi5sE8Jx+Kj6 MxrRW4evrsG/UeqW2K5G4vVpDRikJXTY7R+P2UBy2L0Sr0Q9c/KdNYnY1xv3ZTmSmtrU p4kai8yxbHPH3Fx0VGsWo7LHSvYxKvY1a37jcfICXaOETy2Gk9wCc9TrxmmVR9pBEFH/ GeGuSDxYNhO8PUuQ6pAnE5Pix/0xe4OsN3bc9UTqfQXniBnu4yEbNToao0jPNM9pp6mH kgXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id o8si16125239wma.51.2020.05.13.03.39.01; Wed, 13 May 2020 03:39:01 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9152F1D425; Wed, 13 May 2020 12:38:58 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 9017C1C2F6 for ; Wed, 13 May 2020 12:38:54 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 25ABC1A146A; Wed, 13 May 2020 12:38:54 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 798621A1470; Wed, 13 May 2020 12:38:52 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 01CCD402D3; Wed, 13 May 2020 18:38:49 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: bruce.richardson@intel.com, Hemant Agrawal Date: Wed, 13 May 2020 16:06:29 +0530 Message-Id: <20200513103629.8436-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200513103629.8436-1-hemant.agrawal@nxp.com> References: <20200513103629.8436-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/2] test: support cleanup in bitrate and latency test 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" both bitratestats_autotest latency test initializes the metrics library. It should be cleaned during exit. Signed-off-by: Hemant Agrawal --- app/test/test_bitratestats.c | 14 ++++++++++++++ app/test/test_latencystats.c | 3 +++ 2 files changed, 17 insertions(+) -- 2.17.1 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; }