All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gaetan Rivet <gaetan.rivet@6wind.com>
To: dev@dpdk.org
Cc: Gaetan Rivet <gaetan.rivet@6wind.com>
Subject: [PATCH v3 06/10] test: remove devargs unit tests
Date: Wed, 21 Mar 2018 00:20:07 +0100	[thread overview]
Message-ID: <de73e70347d17dc3ba8d6c6fe06290bd3aa7142b.1521587199.git.gaetan.rivet@6wind.com> (raw)
In-Reply-To: <cover.1521587199.git.gaetan.rivet@6wind.com>
In-Reply-To: <cover.1521587199.git.gaetan.rivet@6wind.com>

The current test will not be compatible anymore with a private
devargs list.

Moreover, the new functions should have new tests, while the existing
API will be removed.

The current unit tests are thus obsolete and hereby removed.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 MAINTAINERS              |   1 -
 test/test/Makefile       |   1 -
 test/test/test_devargs.c | 103 -----------------------------------------------
 3 files changed, 105 deletions(-)
 delete mode 100644 test/test/test_devargs.c

diff --git a/MAINTAINERS b/MAINTAINERS
index a646ca3e1..c07931d13 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -113,7 +113,6 @@ F: test/test/test_common.c
 F: test/test/test_cpuflags.c
 F: test/test/test_cycles.c
 F: test/test/test_debug.c
-F: test/test/test_devargs.c
 F: test/test/test_eal*
 F: test/test/test_errno.c
 F: test/test/test_interrupts.c
diff --git a/test/test/Makefile b/test/test/Makefile
index a88cc38bf..035b073b7 100644
--- a/test/test/Makefile
+++ b/test/test/Makefile
@@ -161,7 +161,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += test_distributor_perf.c
 
 SRCS-$(CONFIG_RTE_LIBRTE_REORDER) += test_reorder.c
 
-SRCS-y += test_devargs.c
 SRCS-y += virtual_pmd.c
 SRCS-y += packet_burst_generator.c
 SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c
diff --git a/test/test/test_devargs.c b/test/test/test_devargs.c
deleted file mode 100644
index b8f3146f6..000000000
--- a/test/test/test_devargs.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2014 6WIND S.A.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/queue.h>
-
-#include <rte_debug.h>
-#include <rte_devargs.h>
-
-#include "test.h"
-
-/* clear devargs list that was modified by the test */
-static void free_devargs_list(void)
-{
-	struct rte_devargs *devargs;
-
-	while (!TAILQ_EMPTY(&devargs_list)) {
-		devargs = TAILQ_FIRST(&devargs_list);
-		TAILQ_REMOVE(&devargs_list, devargs, next);
-		free(devargs->args);
-		free(devargs);
-	}
-}
-
-static int
-test_devargs(void)
-{
-	struct rte_devargs_list save_devargs_list;
-	struct rte_devargs *devargs;
-
-	/* save the real devargs_list, it is restored at the end of the test */
-	save_devargs_list = devargs_list;
-	TAILQ_INIT(&devargs_list);
-
-	/* test valid cases */
-	if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "08:00.1") < 0)
-		goto fail;
-	if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "0000:5:00.0") < 0)
-		goto fail;
-	if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "04:00.0,arg=val") < 0)
-		goto fail;
-	if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "0000:01:00.1") < 0)
-		goto fail;
-	if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 2)
-		goto fail;
-	if (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 2)
-		goto fail;
-	if (rte_eal_devargs_type_count(RTE_DEVTYPE_VIRTUAL) != 0)
-		goto fail;
-	if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "net_ring0") < 0)
-		goto fail;
-	if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "net_ring1,key=val,k2=val2") < 0)
-		goto fail;
-	if (rte_eal_devargs_type_count(RTE_DEVTYPE_VIRTUAL) != 2)
-		goto fail;
-	free_devargs_list();
-
-	/* check virtual device with argument parsing */
-	if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "net_ring1,k1=val,k2=val2") < 0)
-		goto fail;
-	devargs = TAILQ_FIRST(&devargs_list);
-	if (strncmp(devargs->name, "net_ring1",
-			sizeof(devargs->name)) != 0)
-		goto fail;
-	if (!devargs->args || strcmp(devargs->args, "k1=val,k2=val2") != 0)
-		goto fail;
-	free_devargs_list();
-
-	/* check PCI device with empty argument parsing */
-	if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "04:00.1") < 0)
-		goto fail;
-	devargs = TAILQ_FIRST(&devargs_list);
-	if (strcmp(devargs->name, "04:00.1") != 0)
-		goto fail;
-	if (!devargs->args || strcmp(devargs->args, "") != 0)
-		goto fail;
-	free_devargs_list();
-
-	/* test error case: bad PCI address */
-	if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "08:1") == 0)
-		goto fail;
-	if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "00.1") == 0)
-		goto fail;
-	if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "foo") == 0)
-		goto fail;
-	if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, ",") == 0)
-		goto fail;
-	if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "000f:0:0") == 0)
-		goto fail;
-
-	devargs_list = save_devargs_list;
-	return 0;
-
- fail:
-	free_devargs_list();
-	devargs_list = save_devargs_list;
-	return -1;
-}
-
-REGISTER_TEST_COMMAND(devargs_autotest, test_devargs);
-- 
2.11.0

  parent reply	other threads:[~2018-03-20 23:20 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 16:07 [PATCH 0/6] devargs cleanup Gaetan Rivet
2017-08-25 16:07 ` [PATCH 1/6] devargs: introduce iterator Gaetan Rivet
2017-08-25 16:07 ` [PATCH 2/6] devargs: introduce foreach macro Gaetan Rivet
2017-08-25 16:07 ` [PATCH 3/6] vdev: do not reference devargs_list Gaetan Rivet
2017-08-25 16:07 ` [PATCH 4/6] bus/pci: " Gaetan Rivet
2017-08-25 16:07 ` [PATCH 5/6] test: remove rte_devargs unit tests Gaetan Rivet
2017-08-25 16:07 ` [PATCH 6/6] devargs: make devargs_list private Gaetan Rivet
2017-10-12  8:21 ` [PATCH v2 00/18] devargs cleanup Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 01/18] eal: prepend busname on legacy device declaration Gaetan Rivet
2017-12-11 13:57     ` Shreyansh Jain
2017-10-12  8:21   ` [PATCH v2 02/18] eal: remove generic devtype Gaetan Rivet
2017-10-17 18:16     ` Aaron Conole
2017-10-18  8:20       ` Gaëtan Rivet
2017-10-12  8:21   ` [PATCH v2 03/18] devargs: introduce iterator Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 04/18] devargs: introduce foreach macro Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 05/18] vdev: do not reference devargs list Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 06/18] bus/pci: " Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 07/18] test: remove devargs unit tests Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 08/18] devargs: make devargs list private Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 09/18] devargs: make parsing variadic Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 10/18] devargs: require bus name prefix Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 11/18] devargs: simplify implementation Gaetan Rivet
2017-10-16 11:39     ` Shreyansh Jain
2017-10-16 11:42       ` Shreyansh Jain
2017-10-16 13:42         ` Gaëtan Rivet
2017-10-17  5:58           ` Shreyansh Jain
2017-10-12  8:21   ` [PATCH v2 12/18] eal: add generic device declaration parameter Gaetan Rivet
2017-12-13 14:26     ` Shreyansh Jain
2017-12-13 14:47       ` Gaëtan Rivet
2017-12-13 15:24         ` Shreyansh Jain
2017-10-12  8:21   ` [PATCH v2 13/18] bus: make device recognition function public Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 14/18] net/failsafe: keep legacy sub-device declaration Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 15/18] ether: use new devargs parsing function Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 16/18] devargs: remove old " Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 17/18] devargs: use proper prefix Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 18/18] doc: remove devargs deprecation notices Gaetan Rivet
2017-10-12 11:28     ` Mcnamara, John
2017-12-13 10:17     ` Shreyansh Jain
2017-12-13 10:25       ` Gaëtan Rivet
2017-12-13 10:54         ` Shreyansh Jain
2017-12-22  4:59           ` Shreyansh Jain
2017-12-22  8:33             ` Gaëtan Rivet
2017-10-17 18:18   ` [PATCH v2 00/18] devargs cleanup Aaron Conole
2017-10-18  8:36     ` Gaëtan Rivet
2018-03-20 23:20   ` [PATCH v3 00/10] " Gaetan Rivet
2018-03-20 23:20     ` [PATCH v3 01/10] devargs: introduce iterator Gaetan Rivet
2018-03-21  5:43       ` Tan, Jianfeng
2018-03-21  8:50         ` Gaëtan Rivet
2018-03-20 23:20     ` [PATCH v3 02/10] devargs: introduce foreach macro Gaetan Rivet
2018-04-22 21:42       ` Thomas Monjalon
2018-03-20 23:20     ` [PATCH v3 03/10] bus/vdev: do not reference devargs list Gaetan Rivet
2018-03-21  5:41       ` Tan, Jianfeng
2018-03-20 23:20     ` [PATCH v3 04/10] bus/pci: " Gaetan Rivet
2018-03-20 23:20     ` [PATCH v3 05/10] net/vdev_netvsc: " Gaetan Rivet
2018-03-20 23:20     ` Gaetan Rivet [this message]
2018-03-20 23:20     ` [PATCH v3 07/10] devargs: make devargs list private Gaetan Rivet
2018-04-22 21:46       ` Thomas Monjalon
2018-03-20 23:20     ` [PATCH v3 08/10] devargs: make parsing variadic Gaetan Rivet
2018-04-22 21:52       ` Thomas Monjalon
2018-03-20 23:20     ` [PATCH v3 09/10] devargs: use proper namespace prefix Gaetan Rivet
2018-03-20 23:20     ` [PATCH v3 10/10] devargs: rename legacy API Gaetan Rivet
2018-04-22 22:00     ` [PATCH v3 00/10] devargs cleanup Thomas Monjalon
2018-04-23 22:41 ` [PATCH v4 " Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 01/10] devargs: introduce iterator Gaetan Rivet
2018-04-23 23:54     ` Stephen Hemminger
2018-04-24 10:22       ` Gaëtan Rivet
2018-04-23 22:41   ` [PATCH v4 02/10] devargs: introduce foreach macro Gaetan Rivet
2018-04-23 23:56     ` Stephen Hemminger
2018-04-24 10:26       ` Gaëtan Rivet
2018-04-23 22:41   ` [PATCH v4 03/10] bus/vdev: do not reference devargs list Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 04/10] bus/pci: " Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 05/10] net/vdev_netvsc: " Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 06/10] test: remove devargs unit tests Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 07/10] devargs: make devargs list private Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 08/10] devargs: make parsing variadic Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 09/10] devargs: use proper namespace prefix Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 10/10] devargs: rename legacy API Gaetan Rivet
2018-04-23 23:54 ` [PATCH v5 00/10] devargs cleanup Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 01/10] devargs: introduce iterator Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 02/10] bus/vdev: do not reference devargs list Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 03/10] bus/pci: " Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 04/10] net/vdev_netvsc: " Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 05/10] test: remove devargs unit tests Gaetan Rivet
2018-04-25  0:45     ` Thomas Monjalon
2018-04-23 23:54   ` [PATCH v5 06/10] devargs: make devargs list private Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 07/10] devargs: make parsing variadic Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 08/10] devargs: update devargs add documentation Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 09/10] devargs: use proper namespace prefix Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 10/10] devargs: rename legacy API Gaetan Rivet
2018-04-25  1:51     ` Thomas Monjalon
2018-04-25  1:57   ` [PATCH v5 00/10] devargs cleanup Thomas Monjalon

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=de73e70347d17dc3ba8d6c6fe06290bd3aa7142b.1521587199.git.gaetan.rivet@6wind.com \
    --to=gaetan.rivet@6wind.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.