DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Luca Boccassi <bluca@debian.org>
Subject: [dpdk-dev] [PATCH v4 08/11] app/test: use new allowlist and blocklist
Date: Mon, 13 Jul 2020 22:39:16 -0700
Message-ID: <20200714053919.5609-9-stephen@networkplumber.org> (raw)
In-Reply-To: <20200714053919.5609-1-stephen@networkplumber.org>

Test the renamed pci-blocklist and pci-allowlist arguments.
Use new terms in test variable names as well.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
---
 app/test/autotest.py        | 16 ++++++------
 app/test/autotest_runner.py | 18 ++++++-------
 app/test/test.c             |  2 +-
 app/test/test_eal_flags.c   | 52 ++++++++++++++++++-------------------
 4 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/app/test/autotest.py b/app/test/autotest.py
index b42f48879cc2..14b39a2e3347 100644
--- a/app/test/autotest.py
+++ b/app/test/autotest.py
@@ -11,7 +11,7 @@
 
 def usage():
     print("Usage: autotest.py [test app|test iso image] ",
-          "[target] [whitelist|-blacklist]")
+          "[target] [allowlist|-blocklist]")
 
 if len(sys.argv) < 3:
     usage()
@@ -19,18 +19,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])
 
@@ -40,8 +40,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 95e74c760dba..72180a172553 100644
--- a/app/test/autotest_runner.py
+++ b/app/test/autotest_runner.py
@@ -193,14 +193,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 = []
@@ -274,7 +274,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"]
@@ -284,10 +284,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 94d26ab1f67c..13253ccee0bb 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -61,7 +61,7 @@ do_recursive_call(void)
 			{ "test_master_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 4ee809e3db2e..37807d10931d 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 pci_allowlist "--pci-allowlist"
 #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 allowlist 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_allowlist_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", "", ""},
+				pci_allowlist, "error", "", ""},
 		{prgname, prefix, mp_flag,
-				pci_whitelist, "0:0:0", "", ""},
+				pci_allowlist, "0:0:0", "", ""},
 		{prgname, prefix, mp_flag,
-				pci_whitelist, "0:error:0.1", "", ""},
+				pci_allowlist, "0:error:0.1", "", ""},
 		{prgname, prefix, mp_flag,
-				pci_whitelist, "0:0:0.1error", "", ""},
+				pci_allowlist, "0:0:0.1error", "", ""},
 		{prgname, prefix, mp_flag,
-				pci_whitelist, "error0:0:0.1", "", ""},
+				pci_allowlist, "error0:0:0.1", "", ""},
 		{prgname, prefix, mp_flag,
-				pci_whitelist, "0:0:0.1.2", "", ""},
+				pci_allowlist, "0:0:0.1.2", "", ""},
 	};
-	/* Test with valid whitelist option */
+	/* Test with valid allowlist option */
 	const char *wlval1[] = {prgname, prefix, mp_flag,
-			pci_whitelist, "00FF:09:0B.3"};
+			pci_allowlist, "00FF:09:0B.3"};
 	const char *wlval2[] = {prgname, prefix, mp_flag,
-			pci_whitelist, "09:0B.3", pci_whitelist, "0a:0b.1"};
+			pci_allowlist, "09:0B.3", pci_allowlist, "0a:0b.1"};
 	const char *wlval3[] = {prgname, prefix, mp_flag,
-			pci_whitelist, "09:0B.3,type=test",
-			pci_whitelist, "08:00.1,type=normal",
+			pci_allowlist, "09:0B.3,type=test",
+			pci_allowlist, "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");
+			    "allowlist 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 allowlist\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 allowlist 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 allowlist + 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;
@@ -1489,9 +1489,9 @@ test_eal_flags(void)
 		return ret;
 	}
 
-	ret = test_whitelist_flag();
+	ret = test_allowlist_flag();
 	if (ret < 0) {
-		printf("Error in test_invalid_whitelist_flag()\n");
+		printf("Error in test_invalid_allowlist_flag()\n");
 		return ret;
 	}
 
@@ -1543,7 +1543,7 @@ REGISTER_TEST_COMMAND(eal_flags_master_opt_autotest, test_master_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_allowlist_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);
-- 
2.26.2


  parent reply	other threads:[~2020-07-14  5:40 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-13  0:00 [dpdk-dev] [PATCH v3 00/10] rename blacklist/whitelist to block/allow Stephen Hemminger
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 01/10] rte_ethdev: change comment to rte_dev_eth_mac_addr_add Stephen Hemminger
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 02/10] mk: replace reference to blacklist/whitelist Stephen Hemminger
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 03/10] check_maintainers: change variable names Stephen Hemminger
2020-07-10 17:01   ` Thomas Monjalon
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 04/10] eal: replace usage of blacklist/whitelist in enum Stephen Hemminger
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 05/10] drivers: replace references to blacklist Stephen Hemminger
2020-06-15  6:32   ` Hemant Agrawal
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 06/10] eal: replace pci-whitelist/pci-blacklist options Stephen Hemminger
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 07/10] doc: replace references to blacklist/whitelist Stephen Hemminger
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 08/10] app/test: use new allowlist and blocklist Stephen Hemminger
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 09/10] doc: add note about blacklist/whitelist changes Stephen Hemminger
2020-06-13  0:00 ` [dpdk-dev] [PATCH v3 10/10] eal: mark old macros for blacklist/whitelist as deprecated Stephen Hemminger
2020-06-17 12:05 ` [dpdk-dev] [PATCH v3 00/10] rename blacklist/whitelist to block/allow Mcnamara, John
2020-07-10 15:06 ` David Marchand
2020-07-14  4:43   ` Stephen Hemminger
2020-07-14  5:33   ` Stephen Hemminger
2020-07-15 10:01     ` [dpdk-dev] [dpdk-techboard] " Thomas Monjalon
2020-09-22 14:28       ` Stephen Hemminger
2020-09-22 16:16         ` Thomas Monjalon
2020-09-22 16:18           ` Thomas Monjalon
2020-09-22 17:12           ` Stephen Hemminger
2020-07-14  5:39 ` [dpdk-dev] [PATCH v4 00/11] rename blacklist/whitelist to exclude/include Stephen Hemminger
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 01/11] rte_ethdev: change comment to rte_dev_eth_mac_addr_add Stephen Hemminger
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 02/11] mk: replace reference to blacklist/whitelist Stephen Hemminger
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 03/11] check_maintainers: change variable names Stephen Hemminger
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 04/11] eal: replace usage of blacklist/whitelist in enum Stephen Hemminger
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 05/11] drivers: replace references to blacklist Stephen Hemminger
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 06/11] eal: replace pci-whitelist/pci-blacklist options Stephen Hemminger
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 07/11] doc: replace references to blacklist/whitelist Stephen Hemminger
2020-07-14  5:39   ` Stephen Hemminger [this message]
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 09/11] doc: add note about blacklist/whitelist changes Stephen Hemminger
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 10/11] eal: mark old macros for blacklist/whitelist as deprecated Stephen Hemminger
2020-07-14  5:39   ` [dpdk-dev] [PATCH v4 11/11] doc: update examples to new config options Stephen Hemminger
2020-07-14  6:05   ` [dpdk-dev] [PATCH v4 00/11] rename blacklist/whitelist to exclude/include Stephen Hemminger

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=20200714053919.5609-9-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=bluca@debian.org \
    --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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git