From 84680f100d3b9108b7ef864cbe23454a9537f271 Mon Sep 17 00:00:00 2001 From: Nick Porter Date: Thu, 29 Aug 2024 18:41:44 +0100 Subject: [PATCH] Use current time rather than packet time in redis_ippool tests 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 | 4 ++-- src/tests/modules/redis_ippool/update.unlang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/modules/redis_ippool/alloc.unlang b/src/tests/modules/redis_ippool/alloc.unlang index 5505546b49..cd1657d9d8 100644 --- a/src/tests/modules/redis_ippool/alloc.unlang +++ b/src/tests/modules/redis_ippool/alloc.unlang @@ -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 } diff --git a/src/tests/modules/redis_ippool/update.unlang b/src/tests/modules/redis_ippool/update.unlang index 428c6c6545..c1765542ef 100644 --- a/src/tests/modules/redis_ippool/update.unlang +++ b/src/tests/modules/redis_ippool/update.unlang @@ -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 } -- 2.47.2