]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use current time rather than packet time in redis_ippool tests
authorNick Porter <nick@portercomputing.co.uk>
Thu, 29 Aug 2024 17:41:44 +0000 (18:41 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 29 Aug 2024 17:41:44 +0000 (18:41 +0100)
Sometimes, bringing the cluster up takes long enough to cause the test
to appear to fail.

Packet time starts before the cluster is reset, rather than when the
main test policy is run.

src/tests/modules/redis_ippool/alloc.unlang
src/tests/modules/redis_ippool/update.unlang

index 5505546b49f436ff3ecbb93710cb1c1c002fbd1d..cd1657d9d8ebf2062866f97faf6af98867f017f3 100644 (file)
@@ -25,12 +25,12 @@ if !(&reply.Framed-IP-Address == 192.168.0.1) {
 #
 #  Check ZSCORE
 #
-if ((%redis('ZSCORE', "{%{control.IP-Pool.Name}}:pool", "%{reply.Framed-IP-Address}") - %l) < 20) {
+if ((%redis('ZSCORE', "{%{control.IP-Pool.Name}}:pool", "%{reply.Framed-IP-Address}") - %c) < 20) {
        test_fail
 }
 
 # +2 - Some slop for macOS
-if ((%redis('ZSCORE', "{%{control.IP-Pool.Name}}:pool", "%{reply.Framed-IP-Address}") - %l) > 42) {
+if ((%redis('ZSCORE', "{%{control.IP-Pool.Name}}:pool", "%{reply.Framed-IP-Address}") - %c) > 42) {
        test_fail
 }
 
index 428c6c6545fdea6e43804facb78b15d3877aa54d..c1765542efecf897652a0a8dcb6825bc66e32454 100644 (file)
@@ -49,12 +49,12 @@ if !(&reply.Session-Timeout == 60) {
 }
 
 # 8. Check ZSCORE reflects that
-if !((%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) - %l) > 50) {
+if !((%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) - %c) > 50) {
        test_fail
 }
 
 # 9.
-if !((%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) - %l) < 70) {
+if !((%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) - %c) < 70) {
        test_fail
 }