]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: hostapd error path on driver interface initialization failure
authorJouni Malinen <j@w1.fi>
Sat, 10 Aug 2024 07:30:07 +0000 (10:30 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 10 Aug 2024 08:12:07 +0000 (11:12 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_hostapd_error.py [new file with mode: 0644]

diff --git a/tests/hwsim/test_hostapd_error.py b/tests/hwsim/test_hostapd_error.py
new file mode 100644 (file)
index 0000000..0081b30
--- /dev/null
@@ -0,0 +1,16 @@
+# hostapd error paths
+# Copyright (c) 2024, Jouni Malinen <j@w1.fi>
+#
+# This software may be distributed under the terms of the BSD license.
+# See README for more details.
+
+import hostapd
+from utils import *
+
+def test_hostapd_error_drv_init(dev, apdev):
+    """hostapd error path on driver interface initialization failure"""
+    hapd = hostapd.add_ap(apdev[0], {"ssid": "ctrl"})
+    with fail_test(hapd, 1, "nl80211_setup_ap"):
+        hapd1 = hostapd.add_ap(apdev[1], {"ssid": "open"}, no_enable=True)
+        if "FAIL" not in hapd1.request("ENABLE"):
+            raise Exception("ENABLE succeeded unexpectedly")