From: Arran Cudbard-Bell Date: Thu, 7 Mar 2019 13:32:17 +0000 (+0800) Subject: Move set inside of cluster setup loop in case it takes a while for the cluster to... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5f17301ab7427bdcc24753aba2c8a56727ee549;p=thirdparty%2Ffreeradius-server.git Move set inside of cluster setup loop in case it takes a while for the cluster to come up --- diff --git a/src/tests/modules/redis/cluster_reset.inc b/src/tests/modules/redis/cluster_reset.inc index 1da8c143300..a1976df5897 100644 --- a/src/tests/modules/redis/cluster_reset.inc +++ b/src/tests/modules/redis/cluster_reset.inc @@ -44,15 +44,6 @@ update control { # Determine when initial synchronisation has been completed # -# Hashes to Redis cluster node master 0 (1) -if (("%{redis:SET b '%{control:Tmp-String-0}'}" != 'OK') || \ - ("%{redis:SET c '%{control:Tmp-String-1}'}" != 'OK') || \ - ("%{redis:SET d '%{control:Tmp-String-2}'}" != 'OK')) { - test_fail -} else { - test_pass -} - # Test nodes should be running on # - 127.0.0.1:30001 - master [0-5460] # - 127.0.0.1:30004 - slave @@ -68,13 +59,20 @@ foreach &control:Tmp-Integer-0 { # Force a remap as the slaves don't show up in the cluster immediately # if ("%{redis_remap:%{Tmp-String-0}:30001}" == 'success') { - # 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}" == "%{control:Tmp-String-0}") && \ - ("%{redis:-@%{redis_node:c 1} GET c}" == "%{control:Tmp-String-1}") && \ - ("%{redis:-@%{redis_node:d 1} GET d}" == "%{control:Tmp-String-2}")) { - break + # Hashes to Redis cluster node master 0 (1) + if (("%{redis:SET b '%{control:Tmp-String-0}'}" == 'OK') && \ + ("%{redis:SET c '%{control:Tmp-String-1}'}" == 'OK') && \ + ("%{redis:SET d '%{control:Tmp-String-2}'}" == '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}" == "%{control:Tmp-String-0}") && \ + ("%{redis:-@%{redis_node:c 1} GET c}" == "%{control:Tmp-String-1}") && \ + ("%{redis:-@%{redis_node:d 1} GET d}" == "%{control:Tmp-String-2}")) { + break + } } update request {