From: Alan T. DeKok Date: Wed, 19 Mar 2025 11:23:27 +0000 (+0700) Subject: remove old foreach, and use %range() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a3cfbab3ddf8b3e76b7253e7f67d3eeff7ef186;p=thirdparty%2Ffreeradius-server.git remove old foreach, and use %range() --- diff --git a/src/tests/modules/redis/cluster_node_fail.unlang b/src/tests/modules/redis/cluster_node_fail.unlang index 27cccb8b47e..a7cd289f673 100644 --- a/src/tests/modules/redis/cluster_node_fail.unlang +++ b/src/tests/modules/redis/cluster_node_fail.unlang @@ -41,7 +41,7 @@ if (takeoverresult != 'OK') { } # Allow time for the takeover to propagate to other nodes -foreach control.Filter-Id { +foreach i (%range(20)) { # Keep remapping the cluster %redis.remap(%{redisreplica}) diff --git a/src/tests/modules/redis/cluster_reset.inc b/src/tests/modules/redis/cluster_reset.inc index c7c8847ee1c..7a3cee6d062 100644 --- a/src/tests/modules/redis/cluster_reset.inc +++ b/src/tests/modules/redis/cluster_reset.inc @@ -8,9 +8,6 @@ string data2 string data3 string cmdresult -# Some values we need for startup -control.Filter-Id := { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 } - data1 := "1-%randstr('aaaaaaaa')" data2 := "2-%randstr('aaaaaaaa')" data3 := "3-%randstr('aaaaaaaa')" @@ -52,7 +49,7 @@ if (!redisserver || (redisserver == '')) { # - 127.0.0.1:30005 - slave # - 127.0.0.1:30003 - master [10923-16383] # - 127.0.0.1:30006 - slave -foreach result (control.Filter-Id[*]) { +foreach i (%range(20)) { # # Force a remap as the slaves don't show up in the cluster immediately # @@ -86,7 +83,7 @@ foreach result (control.Filter-Id[*]) { # If the cluster is still not behaving # abandon the test to avoid false negatives # - if (result == 20) { + if (i == 20) { test_fail return }