From: Benjamin Berg Date: Mon, 25 Dec 2023 10:20:58 +0000 (+0200) Subject: tests: Strip trailing space from ip output X-Git-Tag: hostap_2_11~533 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77f0b4087247b6ec122fe1618f955b3a40fd0224;p=thirdparty%2Fhostap.git tests: Strip trailing space from ip output 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 --- diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 1884bcb8d..afb54c5d5 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],