From: Alan T. DeKok Date: Sat, 5 Apr 2025 13:23:28 +0000 (-0400) Subject: quote function parameters which are bare words X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a729e0aabae54474bffe50799a6fefd6d43e7bca;p=thirdparty%2Ffreeradius-server.git quote function parameters which are bare words --- diff --git a/src/tests/modules/redis/cluster_key.unlang b/src/tests/modules/redis/cluster_key.unlang index 4d29d4a0629..38630a573ff 100644 --- a/src/tests/modules/redis/cluster_key.unlang +++ b/src/tests/modules/redis/cluster_key.unlang @@ -26,14 +26,14 @@ if (%redis(SET, b, %{testdata1}) == 'OK') { } # Hashes to Redis cluster node master 3 (2) -if (%redis(SET, c, %{testdata2}) == 'OK') { +if (%redis('SET', 'c', %{testdata2}) == 'OK') { test_pass } else { test_fail } # Hashes to Redis cluster node master 2 (3) -if (%redis(SET, d, %{testdata3}) == 'OK') { +if (%redis('SET', 'd', %{testdata3}) == 'OK') { test_pass } else { test_fail @@ -42,19 +42,19 @@ if (%redis(SET, d, %{testdata3}) == 'OK') { # # Now check they are where we expect # -if (%redis(@%redis.node(b, 0), GET, b) == %{testdata1}) { +if (%redis("@%redis.node('b', 0)", 'GET', 'b') == %{testdata1}) { test_pass } else { test_fail } -if (%redis(@%redis.node(c, 0), GET, c) == %{testdata2}) { +if (%redis("@%redis.node('c', 0)", 'GET', 'c') == %{testdata2}) { test_pass } else { test_fail } -if (%redis(@%redis.node(d, 0), GET, d) == %{testdata3}) { +if (%redis("@%redis.node('d', 0)", 'GET', 'd') == %{testdata3}) { test_pass } else { test_fail diff --git a/src/tests/modules/redis/cluster_node_fail.unlang b/src/tests/modules/redis/cluster_node_fail.unlang index a7cd289f673..7008bd171e8 100644 --- a/src/tests/modules/redis/cluster_node_fail.unlang +++ b/src/tests/modules/redis/cluster_node_fail.unlang @@ -8,7 +8,7 @@ string takeoverresult $INCLUDE cluster_reset.inc # Hashes to Redis cluster node master 1 -if (!(%redis(SET, b, 'boom') == 'OK')) { +if (!(%redis('SET', 'b', 'boom') == 'OK')) { test_fail } @@ -16,13 +16,13 @@ if (!(%redis(SET, b, 'boom') == 'OK')) { %delay(0.5) # Note the current master -redismaster := %redis.node(b, 0) +redismaster := %redis.node('b', 0) # Note the current replica -redisreplica := %redis.node(b, 1) +redisreplica := %redis.node('b', 1) # Cause one of the redis cluster nodes to SEGV -if (%redis(@%redis.node(b, 0), DEBUG, SEGFAULT)) { +if (%redis("@%redis.node('b', 0)", 'DEBUG', 'SEGFAULT')) { test_fail } @@ -31,7 +31,7 @@ if (%redis(@%redis.node(b, 0), DEBUG, SEGFAULT)) { # which sometimes happens when running tests with sanitizers, due to # slowness introduced by the sanitizers. try { - takeoverresult = %redis(@%{redisreplica}, CLUSTER, FAILOVER, TAKEOVER) + takeoverresult = %redis("@%{redisreplica}", 'CLUSTER', 'FAILOVER', 'TAKEOVER') } catch fail { takeoverresult = 'OK' @@ -45,24 +45,24 @@ foreach i (%range(20)) { # Keep remapping the cluster %redis.remap(%{redisreplica}) - if (%redis.node(b, 0) == redisreplica) { + if (%redis.node('b', 0) == redisreplica) { break } %delay(0.5) } -if (!(%redis(GET, b) == 'boom')) { +if (!(%redis('GET', 'b') == 'boom')) { test_fail } # Kill that one too -if (%redis(@%redis.node(b), DEBUG, SEGFAULT)) { +if (%redis("@%redis.node('b')", 'DEBUG', 'SEGFAULT')) { test_fail } # No alternatives... %delay(0.5) -if (%redis(GET, b) == 'boom') { +if (%redis('GET', 'b') == 'boom') { test_fail } diff --git a/src/tests/modules/redis/cluster_reset.inc b/src/tests/modules/redis/cluster_reset.inc index 7a3cee6d062..b9b98083e7a 100644 --- a/src/tests/modules/redis/cluster_reset.inc +++ b/src/tests/modules/redis/cluster_reset.inc @@ -21,13 +21,13 @@ if ("$ENV{REDIS_CLUSTER_CONTROL}" == '') { # # Reset the cluster # -%exec(%{clusterctrl}, stop) -%exec(%{clusterctrl}, clean) -%exec(%{clusterctrl}, start) +%exec(%{clusterctrl}, 'stop') +%exec(%{clusterctrl}, 'clean') +%exec(%{clusterctrl}, 'start') # Sometimes redis just fails to start - without it we can't run # the tests - so just exit early. -cmdresult = %exec(%{clusterctrl}, create) +cmdresult = %exec(%{clusterctrl}, 'create') if (cmdresult == '') { test_pass handled @@ -55,17 +55,17 @@ foreach i (%range(20)) { # if (%redis.remap(%{redisserver}:30001) == 'success') { # Hashes to Redis cluster node master 0 (1) - if ((%redis(SET, b, %{data1}) == 'OK') && \ - (%redis(SET, c, %{data2}) == 'OK') && \ - (%redis(SET, d, %{data3}) == 'OK')) { + if ((%redis('SET', 'b', %{data1}) == 'OK') && \ + (%redis('SET', 'c', %{data2}) == 'OK') && \ + (%redis('SET', 'd', %{data3}) == 'OK')) { # # The actual node to keyslot mapping seems to be somewhat random # so we now need to figure out which slave each of those keys # ended up on. # - if ((%redis("-@%redis.node(b, 1)", GET, b) == %{data1}) && \ - (%redis("-@%redis.node(c, 1)", GET, c) == %{data2}) && \ - (%redis("-@%redis.node(d, 1)", GET, d) == %{data3})) { + if ((%redis("-@%redis.node(b, 1)", 'GET', 'b') == data1) && \ + (%redis("-@%redis.node(c, 1)", 'GET', 'c') == data2) && \ + (%redis("-@%redis.node(d, 1)", 'GET', 'd') == data3)) { break } }