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 5E9ADA04DD; Tue, 20 Oct 2020 18:21:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 05201AD02; Tue, 20 Oct 2020 18:20:42 +0200 (CEST) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by dpdk.org (Postfix) with ESMTP id 8C0D1A9C7 for ; Tue, 20 Oct 2020 18:20:36 +0200 (CEST) Received: by mail-pj1-f41.google.com with SMTP id hk7so1219363pjb.2 for ; Tue, 20 Oct 2020 09:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k1G03dkv5xc23/0pGa6N/Q0eC6Xa6yaClKZq6KkZgIg=; b=1wuz/D/+iLYnA1pgpD8tXgZsW4ByCyr0qZOcFb7+oQbyIteh2ijC6Y8gk87SmYvtoI zFOWKYw8VniWOguWfTBYRttLdSX8TQvWpANhq6JdCjh3xr+5hl/Q9hFx78Uqa2fkWxVl FpqVaviMOAKz2LYmqQcg/kGvkmNBsHKEn0TH7CNuf0aCG/5cbWlFg4veCdwfDBNPbW42 hWF/P6bglfwbASH7ERaW4VYlks52EhrpFc5cohNx5aFpBuVBeeeZgdb8c/6MG7yBrUtJ 7iAKLlBTmByh5ahcsWmseCzWhZSqRBII4kW7m7kzep6MiikHeA07mOO9gA+HiPGYEFq0 UdSw== 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:mime-version:content-transfer-encoding; bh=k1G03dkv5xc23/0pGa6N/Q0eC6Xa6yaClKZq6KkZgIg=; b=pxHDvoaw19sm9nQb+XHafIR4bEh+CUO+u4US49kc31p8+rSppB7dMf056E/SbDVa2t aTD1Gh8A7eUqO3sJvGM4uOJRR6azhiSl4A4Rlp6B30XLV6jZVm1bQrdh1qhDitmoM5Vc C4ZTSKzTwMuQ4QRPllwpT/0sH736lb9TiGrn0mX0briHOU1y92gyXzLT/y0I74qaYM3O tVQt7jPa/tYSGi3MUF4di6Q7351k/RwRj8cBPmP8LiVdm60YHNMVTtj54tWrcfa6Omf8 mRzjX2E+SkVGM9BfeVvUA+2jUPiDXmc9om/w46EDhlwDsV2e2f66CfRwyGLXBlELke+j eBeQ== X-Gm-Message-State: AOAM5312HUenF5qV0NpGAQF6Bm83WMXcPfeRGxTL3W5epjty1dDYSBVL Z6NrtGOPXuBRm/7tNIyDCCf25tKAlNJokA== X-Google-Smtp-Source: ABdhPJwOFHlwvlLrlkjfQ1VJFJrW4S5SUQ+b8HYlcTqDwnt6ExrS3M1j517QovZsyHuXI4mqLV+NdQ== X-Received: by 2002:a17:90a:1704:: with SMTP id z4mr3372282pjd.7.1603210834157; Tue, 20 Oct 2020 09:20:34 -0700 (PDT) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 8sm2393015pjk.20.2020.10.20.09.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 09:20:33 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Luca Boccassi Date: Tue, 20 Oct 2020 09:20:17 -0700 Message-Id: <20201020162018.10058-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201020162018.10058-1-stephen@networkplumber.org> References: <20200922143202.8755-1-stephen@networkplumber.org> <20201020162018.10058-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 4/5] app/test: use new allowlist and blocklist 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" Test the renamed blocklist and allowlist arguments. Use new terms in test variable names as well. Signed-off-by: Stephen Hemminger Acked-by: Luca Boccassi --- app/test/autotest.py | 16 +++---- app/test/autotest_runner.py | 18 ++++---- app/test/test.c | 2 +- app/test/test_eal_flags.c | 52 +++++++++++----------- lib/librte_eal/common/eal_common_options.c | 4 +- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/app/test/autotest.py b/app/test/autotest.py index 9eef1efbe565..988d054ba6c8 100644 --- a/app/test/autotest.py +++ b/app/test/autotest.py @@ -10,7 +10,7 @@ def usage(): print("Usage: autotest.py [test app|test iso image] ", - "[target] [whitelist|-blacklist]") + "[target] [allowlist|-blocklist]") if len(sys.argv) < 3: usage() @@ -18,18 +18,18 @@ def usage(): target = sys.argv[2] -test_whitelist = None -test_blacklist = None +test_allowlist = None +test_blocklist = None -# get blacklist/whitelist +# get blocklist/allowlist if len(sys.argv) > 3: testlist = sys.argv[3].split(',') testlist = [test.lower() for test in testlist] if testlist[0].startswith('-'): testlist[0] = testlist[0].lstrip('-') - test_blacklist = testlist + test_blocklist = testlist else: - test_whitelist = testlist + test_allowlist = testlist cmdline = "%s -c f" % (sys.argv[1]) @@ -39,8 +39,8 @@ def usage(): # processes, so make it 1, otherwise make it 4. ignored for non-parallel tests n_processes = 1 if "bsd" in target else 4 -runner = autotest_runner.AutotestRunner(cmdline, target, test_blacklist, - test_whitelist, n_processes) +runner = autotest_runner.AutotestRunner(cmdline, target, test_blocklist, + test_allowlist, n_processes) runner.parallel_tests = autotest_data.parallel_test_list[:] runner.non_parallel_tests = autotest_data.non_parallel_test_list[:] diff --git a/app/test/autotest_runner.py b/app/test/autotest_runner.py index 998fe57a55d1..9fb94ae27352 100644 --- a/app/test/autotest_runner.py +++ b/app/test/autotest_runner.py @@ -188,14 +188,14 @@ class AutotestRunner: n_tests = 0 fails = 0 log_buffers = [] - blacklist = [] - whitelist = [] + blocklist = [] + allowlist = [] - def __init__(self, cmdline, target, blacklist, whitelist, n_processes): + def __init__(self, cmdline, target, blocklist, allowlist, n_processes): self.cmdline = cmdline self.target = target - self.blacklist = blacklist - self.whitelist = whitelist + self.blocklist = blocklist + self.allowlist = allowlist self.skipped = [] self.parallel_tests = [] self.non_parallel_tests = [] @@ -269,7 +269,7 @@ def __process_result(self, result): self.csvwriter.writerow([test_name, test_result, result_str]) # this function checks individual test and decides if this test should be in - # the group by comparing it against whitelist/blacklist. it also checks if + # the group by comparing it against allowlist/blocklist. it also checks if # the test is compiled into the binary, and marks it as skipped if necessary def __filter_test(self, test): test_cmd = test["Command"] @@ -279,10 +279,10 @@ def __filter_test(self, test): if "_autotest" in test_id: test_id = test_id[:-len("_autotest")] - # filter out blacklisted/whitelisted tests - if self.blacklist and test_id in self.blacklist: + # filter out blocklisted/allowlisted tests + if self.blocklist and test_id in self.blocklist: return False - if self.whitelist and test_id not in self.whitelist: + if self.allowlist and test_id not in self.allowlist: return False # if test wasn't compiled in, remove it as well diff --git a/app/test/test.c b/app/test/test.c index f27a56e03390..d78eb04a25e4 100644 --- a/app/test/test.c +++ b/app/test/test.c @@ -61,7 +61,7 @@ do_recursive_call(void) { "test_main_lcore_flag", no_action }, { "test_invalid_n_flag", no_action }, { "test_no_hpet_flag", no_action }, - { "test_whitelist_flag", no_action }, + { "test_allowlist_flag", no_action }, { "test_invalid_b_flag", no_action }, { "test_invalid_vdev_flag", no_action }, { "test_invalid_r_flag", no_action }, diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index da119d4e4a92..3d3032bb4577 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -30,7 +30,7 @@ #define no_hpet "--no-hpet" #define no_huge "--no-huge" #define no_shconf "--no-shconf" -#define pci_whitelist "--pci-whitelist" +#define allow "--allow" #define vdev "--vdev" #define memtest "memtest" #define memtest1 "memtest1" @@ -223,12 +223,12 @@ get_number_of_sockets(void) #endif /* - * Test that the app doesn't run with invalid whitelist option. + * Test that the app doesn't run with invalid allow option. * Final tests ensures it does run with valid options as sanity check (one * test for with Domain+BDF, second for just with BDF) */ static int -test_whitelist_flag(void) +test_allow_flag(void) { unsigned i; #ifdef RTE_EXEC_ENV_FREEBSD @@ -245,45 +245,45 @@ test_whitelist_flag(void) const char *wlinval[][7] = { {prgname, prefix, mp_flag, - pci_whitelist, "error", "", ""}, + allow, "error", "", ""}, {prgname, prefix, mp_flag, - pci_whitelist, "0:0:0", "", ""}, + allow, "0:0:0", "", ""}, {prgname, prefix, mp_flag, - pci_whitelist, "0:error:0.1", "", ""}, + allow, "0:error:0.1", "", ""}, {prgname, prefix, mp_flag, - pci_whitelist, "0:0:0.1error", "", ""}, + allow, "0:0:0.1error", "", ""}, {prgname, prefix, mp_flag, - pci_whitelist, "error0:0:0.1", "", ""}, + allow, "error0:0:0.1", "", ""}, {prgname, prefix, mp_flag, - pci_whitelist, "0:0:0.1.2", "", ""}, + allow, "0:0:0.1.2", "", ""}, }; - /* Test with valid whitelist option */ + /* Test with valid allow option */ const char *wlval1[] = {prgname, prefix, mp_flag, - pci_whitelist, "00FF:09:0B.3"}; + allow, "00FF:09:0B.3"}; const char *wlval2[] = {prgname, prefix, mp_flag, - pci_whitelist, "09:0B.3", pci_whitelist, "0a:0b.1"}; + allow, "09:0B.3", allow, "0a:0b.1"}; const char *wlval3[] = {prgname, prefix, mp_flag, - pci_whitelist, "09:0B.3,type=test", - pci_whitelist, "08:00.1,type=normal", + allow, "09:0B.3,type=test", + allow, "08:00.1,type=normal", }; for (i = 0; i < RTE_DIM(wlinval); i++) { if (launch_proc(wlinval[i]) == 0) { printf("Error - process did run ok with invalid " - "whitelist parameter\n"); + "allow parameter\n"); return -1; } } if (launch_proc(wlval1) != 0 ) { - printf("Error - process did not run ok with valid whitelist\n"); + printf("Error - process did not run ok with valid allow\n"); return -1; } if (launch_proc(wlval2) != 0 ) { - printf("Error - process did not run ok with valid whitelist value set\n"); + printf("Error - process did not run ok with valid allow value set\n"); return -1; } if (launch_proc(wlval3) != 0 ) { - printf("Error - process did not run ok with valid whitelist + args\n"); + printf("Error - process did not run ok with valid allow + args\n"); return -1; } @@ -291,7 +291,7 @@ test_whitelist_flag(void) } /* - * Test that the app doesn't run with invalid blacklist option. + * Test that the app doesn't run with invalid blocklist option. * Final test ensures it does run with valid options as sanity check */ static int @@ -317,7 +317,7 @@ test_invalid_b_flag(void) {prgname, prefix, mp_flag, "-b", "error0:0:0.1"}, {prgname, prefix, mp_flag, "-b", "0:0:0.1.2"}, }; - /* Test with valid blacklist option */ + /* Test with valid blocklist option */ const char *blval[] = {prgname, prefix, mp_flag, "-b", "FF:09:0B.3"}; @@ -326,12 +326,12 @@ test_invalid_b_flag(void) for (i = 0; i != RTE_DIM(blinval); i++) { if (launch_proc(blinval[i]) == 0) { printf("Error - process did run ok with invalid " - "blacklist parameter\n"); + "blocklist parameter\n"); return -1; } } if (launch_proc(blval) != 0) { - printf("Error - process did not run ok with valid blacklist value\n"); + printf("Error - process did not run ok with valid blocklist value\n"); return -1; } return 0; @@ -419,7 +419,7 @@ test_invalid_r_flag(void) {prgname, prefix, mp_flag, "-r", "-1"}, {prgname, prefix, mp_flag, "-r", "17"}, }; - /* Test with valid blacklist option */ + /* Test with valid blocklist option */ const char *rval[] = {prgname, prefix, mp_flag, "-r", "16"}; int i; @@ -1492,9 +1492,9 @@ test_eal_flags(void) return ret; } - ret = test_whitelist_flag(); + ret = test_allow_flag(); if (ret < 0) { - printf("Error in test_invalid_whitelist_flag()\n"); + printf("Error in test_invalid_allow_flag()\n"); return ret; } @@ -1546,7 +1546,7 @@ REGISTER_TEST_COMMAND(eal_flags_main_opt_autotest, test_main_lcore_flag); REGISTER_TEST_COMMAND(eal_flags_n_opt_autotest, test_invalid_n_flag); REGISTER_TEST_COMMAND(eal_flags_hpet_autotest, test_no_hpet_flag); REGISTER_TEST_COMMAND(eal_flags_no_huge_autotest, test_no_huge_flag); -REGISTER_TEST_COMMAND(eal_flags_w_opt_autotest, test_whitelist_flag); +REGISTER_TEST_COMMAND(eal_flags_w_opt_autotest, test_allow_flag); REGISTER_TEST_COMMAND(eal_flags_b_opt_autotest, test_invalid_b_flag); REGISTER_TEST_COMMAND(eal_flags_vdev_opt_autotest, test_invalid_vdev_flag); REGISTER_TEST_COMMAND(eal_flags_r_opt_autotest, test_invalid_r_flag); diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 96ba5fe9f632..879a384fb7c1 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -90,8 +90,8 @@ eal_long_options[] = { {OPT_NO_HUGE, 0, NULL, OPT_NO_HUGE_NUM }, {OPT_NO_PCI, 0, NULL, OPT_NO_PCI_NUM }, {OPT_NO_SHCONF, 0, NULL, OPT_NO_SHCONF_NUM }, - {OPT_IN_MEMORY, 0, NULL, OPT_IN_MEMORY_NUM }, - {OPT_DEV_BLOCK, 1, NULL, OPT_DEV_BLOCK_NUM }, + {OPT_IN_MEMORY, 0, NULL, OPT_IN_MEMORY_NUM }, + {OPT_DEV_BLOCK, 1, NULL, OPT_DEV_BLOCK_NUM }, {OPT_DEV_ALLOW, 1, NULL, OPT_DEV_ALLOW_NUM }, {OPT_PROC_TYPE, 1, NULL, OPT_PROC_TYPE_NUM }, {OPT_SOCKET_MEM, 1, NULL, OPT_SOCKET_MEM_NUM }, -- 2.27.0