tests: Initialize wlantest with passphrase for ap_wpa2_ptk_rekey

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-02-28 23:19:52 +02:00
parent f5f7286ba5
commit 9551930f1e

View file

@ -23,7 +23,7 @@ from utils import HwsimSkip, fail_test, skip_with_fips, start_monitor, stop_moni
import hwsim_utils import hwsim_utils
from wpasupplicant import WpaSupplicant from wpasupplicant import WpaSupplicant
from tshark import run_tshark from tshark import run_tshark
from wlantest import WlantestCapture from wlantest import WlantestCapture, Wlantest
def check_mib(dev, vals): def check_mib(dev, vals):
mib = dev.get_mib() mib = dev.get_mib()
@ -210,6 +210,12 @@ def test_ap_wpa2_ptk_rekey(dev, apdev):
passphrase = 'qwertyuiop' passphrase = 'qwertyuiop'
params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase) params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
hapd = hostapd.add_ap(apdev[0], params) hapd = hostapd.add_ap(apdev[0], params)
Wlantest.setup(hapd)
wt = Wlantest()
wt.flush()
wt.add_passphrase(passphrase)
dev[0].connect(ssid, psk=passphrase, wpa_ptk_rekey="1", scan_freq="2412") dev[0].connect(ssid, psk=passphrase, wpa_ptk_rekey="1", scan_freq="2412")
ev = dev[0].wait_event(["WPA: Key negotiation completed", ev = dev[0].wait_event(["WPA: Key negotiation completed",
"CTRL-EVENT-DISCONNECTED"]) "CTRL-EVENT-DISCONNECTED"])