diff mbox series

[v7,2/7] wpa_supplicant: src: tests: Replace Sanity.

Message ID 20210919062432.431077-3-arowa@google.com
State Accepted
Headers show
Series Replace oppressive terms with inclusive terms | expand

Commit Message

Arowa Suliman Sept. 19, 2021, 6:24 a.m. UTC
Replaced the word Sanity with the inclusive word Validity.

Signed-off-by: Arowa Suliman <arowa@chromium.org>
---
 src/ap/acs.c                       | 2 --
 src/ap/wpa_auth_ft.c               | 4 ++--
 src/p2p/p2p_pd.c                   | 2 +-
 src/pae/ieee802_1x_kay.c           | 8 ++++----
 tests/hwsim/test_fst_config.py     | 2 +-
 tests/hwsim/test_wmediumd.py       | 2 +-
 tests/remote/run-tests.py          | 6 +++---
 wpa_supplicant/ctrl_iface.c        | 2 +-
 wpa_supplicant/p2p_supplicant_sd.c | 4 ++--
 9 files changed, 15 insertions(+), 17 deletions(-)

Comments

Jouni Malinen Oct. 11, 2021, 5:32 p.m. UTC | #1
On Sat, Sep 18, 2021 at 11:24:27PM -0700, Arowa Suliman wrote:
> Replaced the word Sanity with the inclusive word Validity.

>  src/ap/acs.c                       | 2 --
>  src/ap/wpa_auth_ft.c               | 4 ++--
>  src/p2p/p2p_pd.c                   | 2 +-
>  src/pae/ieee802_1x_kay.c           | 8 ++++----
>  tests/hwsim/test_fst_config.py     | 2 +-
>  tests/hwsim/test_wmediumd.py       | 2 +-
>  tests/remote/run-tests.py          | 6 +++---
>  wpa_supplicant/ctrl_iface.c        | 2 +-
>  wpa_supplicant/p2p_supplicant_sd.c | 4 ++--

Thanks, I'll apply the other ones, but the changes in
tests/remote/run-tests.py would potentially break external users, so I
cannot apply them without first understanding how this mechanism might
be used.

> diff --git a/tests/remote/run-tests.py b/tests/remote/run-tests.py
> @@ -33,7 +33,7 @@ from hwsim_wrapper import run_hwsim_test
>  def usage():
>      print("USAdGE: " + sys.argv[0] + " -t devices")
>      print("USAGE: " + sys.argv[0] + " -t check_devices")
> -    print("USAGE: " + sys.argv[0] + " -d <dut_name> -t <all|sanity|tests_to_run> [-r <ref_name>] [-c <cfg_file.py>] [-m <all|monitor_name>] [-h hwsim_tests] [-f hwsim_modules][-R][-T][-P][-S][-v]")
> +    print("USAGE: " + sys.argv[0] + " -d <dut_name> -t <all|validity|tests_to_run> [-r <ref_name>] [-c <cfg_file.py>] [-m <all|monitor_name>] [-h hwsim_tests] [-f hwsim_modules][-R][-T][-P][-S][-v]")

This would break external scripts using these tests.

> @@ -270,9 +270,9 @@ def main():
> -    elif requested_tests[0] == "sanity":
> +    elif requested_tests[0] == "validity":
>          for test in tests:
> -            if test.__name__.startswith("test_sanity_"):
> +            if test.__name__.startswith("test_validity_"):
>                  tests_to_run.append(test)

In addition to that command line change, this replacement of the test
case prefix would break any existing use of this functionality. That
said, I don't see this test functionality being used anywhere in
hostap.git, so this would need to depend on something completely
external and if no such things exists, it would be better to just remove
this command line argument completely.

As far as this replacement of "sanity" with "validity" is concerned, I
don't think "validity" would be clear for the purpose I think these were
originally added: a quick set of tests to verify basic functionality
("sanity check") which is different from "validity check". "basic" would
be a more accurate replacement should this functionality be needed, but
still, that would break externally used interface, so this would need to
more research on whether this functionality is really being used.
diff mbox series

Patch

diff --git a/src/ap/acs.c b/src/ap/acs.c
index 865a415c3..46429f265 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -309,8 +309,6 @@  acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf)
 	else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX)
 		busy = survey->channel_time_rx;
 	else {
-		/* This shouldn't really happen as survey data is checked in
-		 * acs_sanity_check() */
 		wpa_printf(MSG_ERROR, "ACS: Survey data missing");
 		return 0;
 	}
diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c
index e80086b93..f91a2d2d5 100644
--- a/src/ap/wpa_auth_ft.c
+++ b/src/ap/wpa_auth_ft.c
@@ -455,7 +455,7 @@  static int wpa_ft_rrb_lin(const struct tlv_list *tlvs1,
 	pos += wpa_ft_tlv_lin(tlvs2, pos, endpos);
 	pos += wpa_ft_vlan_lin(vlan, pos, endpos);
 
-	/* sanity check */
+	/* validity check */
 	if (pos != endpos) {
 		wpa_printf(MSG_ERROR, "FT: Length error building RRB");
 		goto err;
@@ -3590,7 +3590,7 @@  int wpa_ft_action_rx(struct wpa_state_machine *sm, const u8 *data, size_t len)
 	}
 
 	/*
-	 * Do some sanity checking on the target AP address (not own and not
+	 * Do some validity checking on the target AP address (not own and not
 	 * broadcast. This could be extended to filter based on a list of known
 	 * APs in the MD (if such a list were configured).
 	 */
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index 05fd59349..338b47e4e 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -1425,7 +1425,7 @@  void p2p_process_prov_disc_resp(struct p2p_data *p2p, const u8 *sa,
 		 * Save the reported channel list and operating frequency.
 		 * Note that the specification mandates that the responder
 		 * should include in the channel list only channels reported by
-		 * the initiator, so this is only a sanity check, and if this
+		 * the initiator, so this is only a validity check, and if this
 		 * fails the flow would continue, although it would probably
 		 * fail. Same is true for the operating channel.
 		 */
diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
index 2fe88ac0c..7688a00a1 100644
--- a/src/pae/ieee802_1x_kay.c
+++ b/src/pae/ieee802_1x_kay.c
@@ -3057,11 +3057,11 @@  int ieee802_1x_kay_enable_new_info(struct ieee802_1x_kay *kay)
 
 
 /**
- * ieee802_1x_kay_mkpdu_sanity_check -
- * Sanity checks specified in IEEE Std 802.1X-2010, 11.11.2 (Validation of
+ * ieee802_1x_kay_mkpdu_validity_check -
+ * Validity checks specified in IEEE Std 802.1X-2010, 11.11.2 (Validation of
  * MKPDUs)
  */
-static int ieee802_1x_kay_mkpdu_sanity_check(struct ieee802_1x_kay *kay,
+static int ieee802_1x_kay_mkpdu_validity_check(struct ieee802_1x_kay *kay,
 					     const u8 *buf, size_t len)
 {
 	struct ieee8023_hdr *eth_hdr;
@@ -3215,7 +3215,7 @@  static int ieee802_1x_kay_decode_mkpdu(struct ieee802_1x_kay *kay,
 
 	wpa_printf(MSG_DEBUG, "KaY: Decode received MKPDU (ifname=%s)",
 		   kay->if_name);
-	if (ieee802_1x_kay_mkpdu_sanity_check(kay, buf, len))
+	if (ieee802_1x_kay_mkpdu_validity_check(kay, buf, len))
 		return -1;
 
 	/* handle basic parameter set */
diff --git a/tests/hwsim/test_fst_config.py b/tests/hwsim/test_fst_config.py
index 5dc404282..c28786ded 100644
--- a/tests/hwsim/test_fst_config.py
+++ b/tests/hwsim/test_fst_config.py
@@ -272,7 +272,7 @@  def parse_ies(iehex, el=-1):
     iel = [iehex[i:i + 2] for i in range(0, len(iehex), 2)]
     for i in range(0, len(iel)):
          iel[i] = int(iel[i], 16)
-    # Sanity check
+    # Validity check
     i = 0
     res = []
     while i < len(iel):
diff --git a/tests/hwsim/test_wmediumd.py b/tests/hwsim/test_wmediumd.py
index ad38f03ce..8243e7ce3 100644
--- a/tests/hwsim/test_wmediumd.py
+++ b/tests/hwsim/test_wmediumd.py
@@ -1,4 +1,4 @@ 
-# wmediumd sanity checks
+# wmediumd validity checks
 # Copyright (c) 2015, Intel Deutschland GmbH
 #
 # This software may be distributed under the terms of the BSD license.
diff --git a/tests/remote/run-tests.py b/tests/remote/run-tests.py
index 67993a3c2..bae4262a0 100755
--- a/tests/remote/run-tests.py
+++ b/tests/remote/run-tests.py
@@ -33,7 +33,7 @@  from hwsim_wrapper import run_hwsim_test
 def usage():
     print("USAGE: " + sys.argv[0] + " -t devices")
     print("USAGE: " + sys.argv[0] + " -t check_devices")
-    print("USAGE: " + sys.argv[0] + " -d <dut_name> -t <all|sanity|tests_to_run> [-r <ref_name>] [-c <cfg_file.py>] [-m <all|monitor_name>] [-h hwsim_tests] [-f hwsim_modules][-R][-T][-P][-S][-v]")
+    print("USAGE: " + sys.argv[0] + " -d <dut_name> -t <all|validity|tests_to_run> [-r <ref_name>] [-c <cfg_file.py>] [-m <all|monitor_name>] [-h hwsim_tests] [-f hwsim_modules][-R][-T][-P][-S][-v]")
     print("USAGE: " + sys.argv[0])
 
 def get_devices(devices, duts, refs, monitors):
@@ -270,9 +270,9 @@  def main():
         tests_to_run = tests
     if requested_tests[0] == "help":
         pass
-    elif requested_tests[0] == "sanity":
+    elif requested_tests[0] == "validity":
         for test in tests:
-            if test.__name__.startswith("test_sanity_"):
+            if test.__name__.startswith("test_validity_"):
                 tests_to_run.append(test)
     else:
         for test in requested_tests:
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 15a7ba2b9..a72dca3e1 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -5922,7 +5922,7 @@  static struct p2ps_provision * p2p_parse_asp_provision_cmd(const char *cmd)
 	for (i = 0; p2ps_prov->cpt_priority[i]; i++)
 		p2ps_prov->cpt_mask |= p2ps_prov->cpt_priority[i];
 
-	/* force conncap with tstCap (no sanity checks) */
+	/* force conncap with tstCap (no validity checks) */
 	pos = os_strstr(cmd, "tstCap=");
 	if (pos) {
 		role = strtol(pos + 7, NULL, 16);
diff --git a/wpa_supplicant/p2p_supplicant_sd.c b/wpa_supplicant/p2p_supplicant_sd.c
index f8675e68b..b400cbaca 100644
--- a/wpa_supplicant/p2p_supplicant_sd.c
+++ b/wpa_supplicant/p2p_supplicant_sd.c
@@ -826,7 +826,7 @@  static void wpas_sd_p2ps_serv_response(struct wpa_supplicant *wpa_s,
 		size_t buf_len;
 		u8 svc_len;
 
-		/* Sanity check fixed length+svc_str */
+		/* Validity check fixed length+svc_str */
 		if (6 >= tlv_end - pos)
 			break;
 		svc_len = pos[6];
@@ -854,7 +854,7 @@  static void wpas_sd_p2ps_serv_response(struct wpa_supplicant *wpa_s,
 		buf_len = WPA_GET_LE16(pos);
 		pos += sizeof(u16);
 
-		/* Sanity check buffer length */
+		/* Validity check buffer length */
 		if (buf_len > (unsigned int) (tlv_end - pos))
 			break;