From 544b5a0d3949d33a3ac1e87ccca3eef3cfe08956 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 30 Dec 2018 17:35:54 +0200 Subject: [PATCH] tests: hostapd configuration reload from file when disabled Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_config.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/hwsim/test_ap_config.py b/tests/hwsim/test_ap_config.py index f83656be9..cede63cf7 100644 --- a/tests/hwsim/test_ap_config.py +++ b/tests/hwsim/test_ap_config.py @@ -116,6 +116,26 @@ def test_ap_config_reload_file(dev, apdev, params): dev[0].wait_disconnected() dev[0].request("DISCONNECT") +def test_ap_config_reload_file_while_disabled(dev, apdev, params): + """hostapd configuration reload from file when disabled""" + hapd = hostapd.add_iface(apdev[0], "bss-1.conf") + hapd.enable() + ev = hapd.wait_event(["AP-ENABLED"], timeout=3) + if ev is None: + raise Exception("AP-ENABLED event not reported") + hapd.set("ssid", "foobar") + with open(os.path.join(params['logdir'], 'hostapd-test.pid'), "r") as f: + pid = int(f.read()) + hapd.disable() + ev = hapd.wait_event(["AP-DISABLED"], timeout=3) + if ev is None: + raise Exception("AP-DISABLED event not reported") + hapd.dump_monitor() + os.kill(pid, signal.SIGHUP) + time.sleep(0.1) + hapd.enable() + dev[0].connect("foobar", key_mgmt="NONE", scan_freq="2412") + def write_hostapd_config(conffile, ifname, ssid, ht=True, bss2=False): with open(conffile, "w") as f: f.write("driver=nl80211\n")