]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Avoid hapd reference before assignment on error cases
authorJouni Malinen <j@w1.fi>
Sun, 17 May 2020 09:59:53 +0000 (12:59 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 17 May 2020 09:59:53 +0000 (12:59 +0300)
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 <j@w1.fi>
tests/hwsim/test_ap_vht.py

index dce0dfff9610c8d71e9eaaa35f233ea509c7da70..358e192de64f7329d354b8b5f65025a64123430d 100644 (file)
@@ -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",