From: Alan T. DeKok Date: Thu, 12 Oct 2023 20:04:03 +0000 (-0400) Subject: just use %l or %c directly X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e94a323caaf2fd1e4b93df2c9dbf51da3d48034;p=thirdparty%2Ffreeradius-server.git just use %l or %c directly there's no need to convert them to dates, and then cast them to integers. Those expansions are already integers --- diff --git a/src/tests/modules/redis_ippool/release.unlang b/src/tests/modules/redis_ippool/release.unlang index 9f80498de79..97fc1204d60 100644 --- a/src/tests/modules/redis_ippool/release.unlang +++ b/src/tests/modules/redis_ippool/release.unlang @@ -59,13 +59,11 @@ if (!("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} rang } # Check the ZSCORE - releasing an address sets the ZSCORE to now - 1 -&Tmp-Date-0 := "%c" - -if (%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) > %(integer:%{Tmp-Date-0})) { +if (%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) > %c) { test_fail } -if (%(integer:%{Tmp-Date-0}) - %(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) > 10) { +if ((%c - %(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) > 10)) { test_fail } diff --git a/src/tests/modules/redis_ippool/static.unlang b/src/tests/modules/redis_ippool/static.unlang index 3b44b896e8e..a23a0a7f136 100644 --- a/src/tests/modules/redis_ippool/static.unlang +++ b/src/tests/modules/redis_ippool/static.unlang @@ -85,8 +85,7 @@ if ("%(redis:EXISTS {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address})" == } # Check the ZSCORE -&Tmp-Date-0 := "%l" -if ("%(redis:ZSCORE {%{control.IP-Pool.Name}%}:pool %{reply.Framed-IP-Address})" <= %(integer:%{Tmp-Date-0})) { +if ("%(redis:ZSCORE {%{control.IP-Pool.Name}%}:pool %{reply.Framed-IP-Address})" <= %l) { test_fail } diff --git a/src/tests/modules/redis_ippool/static_unassign.unlang b/src/tests/modules/redis_ippool/static_unassign.unlang index 078f6369d14..d511dcc262b 100644 --- a/src/tests/modules/redis_ippool/static_unassign.unlang +++ b/src/tests/modules/redis_ippool/static_unassign.unlang @@ -85,8 +85,7 @@ if ("%(redis:EXISTS {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID})" != } # Check the ZSCORE -&Tmp-Date-0 := "%l" -if ("%(redis:ZSCORE {%{control.IP-Pool.Name}%}:pool %{reply.Framed-IP-Address})" > %(integer:%{Tmp-Date-0})) { +if ("%(redis:ZSCORE {%{control.IP-Pool.Name}%}:pool %{reply.Framed-IP-Address})" > %l) { test_fail }