From 54c154d2c908a484fbb53bbdead0b70683501805 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 30 Dec 2019 19:12:33 +0200 Subject: [PATCH] tests: radius_acct_unreachable2 to detect retransmissions earlier It looks like this test case can start showing failures with a change in the retransmission limit behavior for a server change. Check for retransmissions every second instead of only at the end of the four second wait to avoid this. Signed-off-by: Jouni Malinen --- tests/hwsim/test_radius.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/hwsim/test_radius.py b/tests/hwsim/test_radius.py index dbefaf551..fde5650de 100644 --- a/tests/hwsim/test_radius.py +++ b/tests/hwsim/test_radius.py @@ -114,11 +114,16 @@ def test_radius_acct_unreachable2(dev, apdev): subprocess.call(['ip', 'ro', 'del', '192.168.213.17', 'dev', 'lo']) connect(dev[0], "radius-acct") logger.info("Checking for RADIUS retries") - time.sleep(4) - mib = hapd.get_mib() - if "radiusAccClientRetransmissions" not in mib: - raise Exception("Missing MIB fields") - if int(mib["radiusAccClientRetransmissions"]) < 1 and int(mib["radiusAccClientPendingRequests"]) < 1: + found = False + for i in range(4): + time.sleep(1) + mib = hapd.get_mib() + if "radiusAccClientRetransmissions" not in mib: + raise Exception("Missing MIB fields") + if int(mib["radiusAccClientRetransmissions"]) > 0 or \ + int(mib["radiusAccClientPendingRequests"]) > 0: + found = True + if not found: raise Exception("Missing pending or retransmitted RADIUS Accounting requests") def test_radius_acct_unreachable3(dev, apdev):