]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove old foreach, and use %range()
authorAlan T. DeKok <aland@freeradius.org>
Wed, 19 Mar 2025 11:23:27 +0000 (18:23 +0700)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 19 Mar 2025 11:35:45 +0000 (18:35 +0700)
src/tests/modules/redis/cluster_node_fail.unlang
src/tests/modules/redis/cluster_reset.inc

index 27cccb8b47e959aac3809eb75dcfe84039634a48..a7cd289f67301a977a5d65e2874003833a3bba81 100644 (file)
@@ -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})
 
index c7c8847ee1ce888faaad9ac1727404b36d0627ba..7a3cee6d0627df359d0751c16903bc3a6bca996b 100644 (file)
@@ -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
        }