From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id EB3A67D5E for ; Fri, 25 Aug 2017 18:08:28 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id b189so1951690wmd.0 for ; Fri, 25 Aug 2017 09:08:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=LGvl9v6cy0e84+nPwYX4MI2Xk+26ld2LUlo+RpcykW4=; b=IEqyhHHSWv4HdkkX9+4uKgE7y6CiWBoyOEh+dq1YccCs9lcnXvCKfyqd654LvtRgDt n0PbM3tuaoPPWAJno0UHiasnMY4+EPRO39ZW+KLdvb44WjP09+b1VJDMbT0VgetODtU0 8oMWWClUjDfbChfmKL3gkCDsMaVWPnATgpzCVfrmkxQyANMjLxFLk1Os1LM6Kqy9hXvJ 2KXoUsJgELAMGp2kufJkz/nT1c7cCbycNPjhk1gEw03SoePjmvxi9Et30kaDxKyNwKmb N3JAqkzRswJnN9WIt2GGVcdOF8xLUxjmdcopi/afRgpewMbBXQ9GtFKvgPTQCRUR5rhy Kl3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=LGvl9v6cy0e84+nPwYX4MI2Xk+26ld2LUlo+RpcykW4=; b=bbnBddQlEJ7ULQ9llee07GcRsYAKM0YcbSfvPn/nvGVBQ/UwBo1GOnVx5ME2jSZw7R rq6M3+V7fpiPu2KSyOzxozmPSiySgs2B/Fo4AB2/qB2l9tMXuI8bmJkQLeWskuCC3etC wQFoImHER+N3oMmM331EuTvmH+wUptT6jhuxA8dBD8P9OQ8HeZ3ZpJuyN7gFHfcxGpDU lu2TCKVRhwOBOyPVEm9H8rfR7ObARp5a1bVp+k8WvqtU9o0ypQKqQUexvPnpdcJ+Mty4 JcDWpscdACwOeZpc/QjKGcZKLW0A6OerhmJID3d7zZBl6f+QQEdPecS6T8dF7bZvwjQ/ VY5w== X-Gm-Message-State: AHYfb5jRkfnJeI49qimFjpqYcOiqqkrfSi7kR+hsP2U0x0uItOo23iFM oRMh62nYv3nIyVY59e8= X-Received: by 10.28.180.9 with SMTP id d9mr1200004wmf.167.1503677308136; Fri, 25 Aug 2017 09:08:28 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id h190sm1351661wmd.4.2017.08.25.09.08.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Aug 2017 09:08:27 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 25 Aug 2017 18:07:25 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 5/6] test: remove rte_devargs unit tests 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: , X-List-Received-Date: Fri, 25 Aug 2017 16:08:29 -0000 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 --- MAINTAINERS | 1 - test/test/Makefile | 1 - test/test/test_devargs.c | 131 ----------------------------------------------- 3 files changed, 133 deletions(-) delete mode 100644 test/test/test_devargs.c diff --git a/MAINTAINERS b/MAINTAINERS index a0cd75e..f6a096a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -93,7 +93,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 42d9a49..42c9cea 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -180,7 +180,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 18f54ed..0000000 --- a/test/test/test_devargs.c +++ /dev/null @@ -1,131 +0,0 @@ -/*- - * BSD LICENSE - * - * Copyright 2014 6WIND S.A. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of 6WIND S.A nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include - -#include -#include - -#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.1.4