From f382af2c1e5ec3a5d09dceb3cc183b99f78a764a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 17 May 2020 12:59:53 +0300 Subject: [PATCH] tests: Avoid hapd reference before assignment on error cases Couple of VHT test cases missed explicit setting of hapd to None before trying to start hostapd. Add those to avoid unexpected exceptions in case hostapd start fails. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_vht.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/hwsim/test_ap_vht.py b/tests/hwsim/test_ap_vht.py index dce0dfff9..358e192de 100644 --- a/tests/hwsim/test_ap_vht.py +++ b/tests/hwsim/test_ap_vht.py @@ -330,6 +330,7 @@ def test_ap_vht_40(devs, apdevs): def test_ap_vht_capab_not_supported(dev, apdev): """VHT configuration with driver not supporting all vht_capab entries""" try: + hapd = None params = {"ssid": "vht", "country_code": "FI", "hw_mode": "a", @@ -1004,6 +1005,7 @@ def test_ap_vht_on_24ghz_2(dev, apdev): def test_prefer_vht40(dev, apdev): """Preference on VHT40 over HT40""" try: + hapd = None hapd2 = None params = {"ssid": "test",