]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: eapol_test functionality
authorJouni Malinen <jouni.malinen@oss.qualcomm.com>
Mon, 1 Dec 2025 21:35:48 +0000 (23:35 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 1 Dec 2025 21:35:48 +0000 (23:35 +0200)
Signed-off-by: Jouni Malinen <jouni.malinen@oss.qualcomm.com>
tests/hwsim/build.sh
tests/hwsim/test_radius.py

index cb4700166f8231e311af85f994f5dad159637fb5..1d1493ad0755451b351ac57e3a57e8aab7092d7e 100755 (executable)
@@ -80,4 +80,4 @@ fi
 if [ -z $FIPSLD_CC ]; then
 export FIPSLD_CC=gcc
 fi
-make QUIET=1 -j$JOBS
+make QUIET=1 -j$JOBS wpa_supplicant wpa_cli eapol_test
index 335b269c6b90e1f5ba9c24333b45562e8c1ab843..de88b0b1825e0ef8078d1d0a81c5431e55d07e94 100644 (file)
@@ -1882,3 +1882,22 @@ def test_radius_tls_freeradius(dev, apdev, test_params):
             pid = int(f.read())
             if pid > 0:
                 os.kill(pid, signal.SIGTERM)
+
+def test_radius_eapol_test(dev, apdev, test_params):
+    """RADIUS testing with eapol_test"""
+    et_path = "../../wpa_supplicant/eapol_test"
+    if not os.path.exists(et_path):
+        raise HwsimSkip("eapol_test not available")
+
+    config = test_params['prefix'] + ".eapol_test.conf"
+    with open(config, "w") as f:
+        f.write("network={\n")
+        f.write("eap=PWD\n")
+        f.write('identity="pwd user"\n')
+        f.write('password="secret password"\n')
+        f.write("}\n")
+
+    res = subprocess.check_output([et_path, '-c', config])
+    logger.debug("eapol_test: " + res.decode().strip())
+    if "SUCCESS" not in res.decode().splitlines():
+        raise Exception("eapol_test did not report success")