[PATCH 01/12] hwsim: Strip trailing space from ip output

Andrei Otcheretianski andrei.otcheretianski at intel.com
Mon Dec 25 02:20:58 PST 2023


From: Benjamin Berg <benjamin.berg at intel.com>

It seems that the messages from ip may have a trailing space in some
cases, which may break matching in surrounding logic. Strip the output
to remove whitespace and avoid any issues this may cause.

Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
 tests/hwsim/test_ap_hs20.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py
index 1884bcb8dc..afb54c5d54 100644
--- a/tests/hwsim/test_ap_hs20.py
+++ b/tests/hwsim/test_ap_hs20.py
@@ -4766,7 +4766,7 @@ def get_permanent_neighbors(ifname):
     cmd = subprocess.Popen(['ip', 'nei'], stdout=subprocess.PIPE)
     res = cmd.stdout.read().decode()
     cmd.stdout.close()
-    return [line for line in res.splitlines() if "PERMANENT" in line and ifname in line]
+    return [line.strip() for line in res.splitlines() if "PERMANENT" in line and ifname in line]
 
 def get_bridge_macs(ifname):
     cmd = subprocess.Popen(['brctl', 'showmacs', ifname],
-- 
2.43.0




More information about the Hostap mailing list