From: Jouni Malinen Date: Fri, 16 Jan 2015 10:14:07 +0000 (+0200) Subject: tests: Fix radius_das_disconnect match + non-match case X-Git-Tag: hostap_2_4~404 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c2b48088f6c4131ebf2bc3e3226da5dcc57735bf;p=thirdparty%2Fhostap.git tests: Fix radius_das_disconnect match + non-match case If Calling-Station-Id matches, but CUI does not, NAS is expected to reject the request instead of accepting it. Verify that Disconnect-NAK is returned for this. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_radius.py b/tests/hwsim/test_radius.py index af42a84c6..8215f08f3 100644 --- a/tests/hwsim/test_radius.py +++ b/tests/hwsim/test_radius.py @@ -469,11 +469,12 @@ def test_radius_das_disconnect(dev, apdev): logger.debug("RADIUS response from hostapd") for i in reply.keys(): logger.debug("%s: %s" % (i, reply[i])) - if reply.code != pyrad.packet.DisconnectACK: + if reply.code != pyrad.packet.DisconnectNAK: raise Exception("Unexpected response code") - - dev[0].wait_disconnected(timeout=10) - dev[0].wait_connected(timeout=10, error="Re-connection timed out") + if 'Error-Cause' not in reply: + raise Exception("Missing Error-Cause") + if reply['Error-Cause'][0] != 503: + raise Exception("Unexpected Error-Cause: {}".format(reply['Error-Cause'])) logger.info("Disconnect-Request with matching CUI") dev[1].connect("radius-das", key_mgmt="WPA-EAP",