From 9a19cc0807fc248a36904b4fefa8d2786788c9ef Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 9 Mar 2014 00:29:07 +0200 Subject: [PATCH] tests: RADIUS interim accounting update Signed-off-by: Jouni Malinen --- tests/hwsim/test_radius.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/hwsim/test_radius.py b/tests/hwsim/test_radius.py index cb7fc03e8..b6315302d 100644 --- a/tests/hwsim/test_radius.py +++ b/tests/hwsim/test_radius.py @@ -92,6 +92,26 @@ def test_radius_acct(dev, apdev): if acc_e < acc_s + 1: raise Exception("Unexpected RADIUS server auth MIB value") +def test_radius_acct_interim(dev, apdev): + """RADIUS Accounting interim update""" + as_hapd = hostapd.Hostapd("as") + params = hostapd.wpa2_eap_params(ssid="radius-acct") + params['acct_server_addr'] = "127.0.0.1" + params['acct_server_port'] = "1813" + params['acct_server_shared_secret'] = "radius" + params['radius_acct_interim_interval'] = "1" + hostapd.add_ap(apdev[0]['ifname'], params) + hapd = hostapd.Hostapd(apdev[0]['ifname']) + connect(dev[0], "radius-acct") + logger.info("Checking for RADIUS counters") + as_mib_start = as_hapd.get_mib(param="radius_server") + time.sleep(3.1) + as_mib_end = as_hapd.get_mib(param="radius_server") + req_s = int(as_mib_start['radiusAccServTotalRequests']) + req_e = int(as_mib_end['radiusAccServTotalRequests']) + if req_e < req_s + 3: + raise Exception("Unexpected RADIUS server acct MIB value") + def test_radius_das_disconnect(dev, apdev): """RADIUS Dynamic Authorization Extensions - Disconnect""" try: