diff --git a/src/tests/modules/cache_rbtree/cache-bin.unlang b/src/tests/modules/cache_rbtree/cache-bin.unlang index 889531f07ac8e..a3dde4f089e62 100644 --- a/src/tests/modules/cache_rbtree/cache-bin.unlang +++ b/src/tests/modules/cache_rbtree/cache-bin.unlang @@ -41,7 +41,7 @@ if (!updated) { test_fail } -if ("%(length:%{Tmp-String-1})" != 11) { +if (%length(%{Tmp-String-1}) != 11) { test_fail } @@ -59,7 +59,7 @@ if (!updated) { test_fail } -if ("%(length:%{Tmp-String-1})" != 7) { +if (%length(%{Tmp-String-1}) != 7) { test_fail } @@ -100,7 +100,7 @@ if (!updated) { test_fail } -if ("%(length:%{Tmp-String-1})" != 11) { +if (%length(%{Tmp-String-1}) != 11) { test_fail } @@ -118,7 +118,7 @@ if (!updated) { test_fail } -if ("%(length:%{Tmp-String-1})" != 7) { +if (%length(%{Tmp-String-1}) != 7) { test_fail } diff --git a/src/tests/modules/cache_rbtree/cache-method-bin.unlang b/src/tests/modules/cache_rbtree/cache-method-bin.unlang index d4cc485797dbb..dc1208fcb91ae 100644 --- a/src/tests/modules/cache_rbtree/cache-method-bin.unlang +++ b/src/tests/modules/cache_rbtree/cache-method-bin.unlang @@ -41,7 +41,7 @@ if (!updated) { test_fail } -if ("%(length:%{Tmp-String-1})" != 11) { +if (%length(%{Tmp-String-1}) != 11) { test_fail } @@ -59,7 +59,7 @@ if (!updated) { test_fail } -if ("%(length:%{Tmp-String-1})" != 7) { +if (%length(%{Tmp-String-1}) != 7) { test_fail } @@ -100,7 +100,7 @@ if (!updated) { test_fail } -if ("%(length:%{Tmp-String-1})" != 11) { +if (%length(%{Tmp-String-1}) != 11) { test_fail } @@ -118,7 +118,7 @@ if (!updated) { test_fail } -if ("%(length:%{Tmp-String-1})" != 7) { +if (%length(%{Tmp-String-1}) != 7) { test_fail } diff --git a/src/tests/modules/cache_rbtree/cache-xlat.unlang b/src/tests/modules/cache_rbtree/cache-xlat.unlang index 95b3f1c551351..45e4ff11535de 100644 --- a/src/tests/modules/cache_rbtree/cache-xlat.unlang +++ b/src/tests/modules/cache_rbtree/cache-xlat.unlang @@ -9,14 +9,13 @@ if (!ok) { test_fail } -&request.Tmp-String-2 := "%(cache:request.Tmp-String-1)" +&request.Tmp-String-2 := %cache(request.Tmp-String-1) if (&Tmp-String-2 != &control.Tmp-String-1) { test_fail } -&Tmp-String-3 := "%(cache:request.Tmp-String-4)" - +&Tmp-String-3 := "%cache(request.Tmp-String-4)" if (&Tmp-String-3 != "") { test_fail } @@ -24,9 +23,9 @@ if (&Tmp-String-3 != "") { # Regression test for deadlock on notfound &Tmp-String-0 := 'testkey0' -&Tmp-String-3 := "%(cache:request.Tmp-String-4)" +&Tmp-String-3 := %cache(request.Tmp-String-4) # Would previously deadlock -&Tmp-String-4 := "%(cache:request.Tmp-String-4)" +&Tmp-String-4 := %cache(request.Tmp-String-4) test_pass diff --git a/src/tests/modules/chap/chap_password.unlang b/src/tests/modules/chap/chap_password.unlang index ac2f35bc7538f..e898feb1296dc 100644 --- a/src/tests/modules/chap/chap_password.unlang +++ b/src/tests/modules/chap/chap_password.unlang @@ -2,7 +2,7 @@ &CHAP-Challenge := 0x0102030405060708090a0b0c0d0e0f10 &control.Password.Cleartext := "supersecret" -&CHAP-Password := "%(chap.password:%{control.Password.Cleartext})" +&CHAP-Password := "%chap.password(%{control.Password.Cleartext})" chap.authenticate if (ok) { diff --git a/src/tests/modules/cipher/fingerprint.unlang b/src/tests/modules/cipher/fingerprint.unlang index 83ae8deda3c30..d751ee44dcf07 100644 --- a/src/tests/modules/cipher/fingerprint.unlang +++ b/src/tests/modules/cipher/fingerprint.unlang @@ -2,17 +2,17 @@ # We can't really check the values here as the certs change periodically # but we can test the digest length, and for smoke... # -&Tmp-Octets-0 := "%(cipher_rsa.certificate:fingerprint sha1)" +&Tmp-Octets-0 := %cipher_rsa.certificate('fingerprint','sha1') -if ("%(length:%{Tmp-Octets-0})" != 20) { +if (%length(%{Tmp-Octets-0}) != 20) { test_fail } else { test_pass } -&Tmp-Octets-0 := "%(cipher_rsa.certificate:fingerprint sha256)" +&Tmp-Octets-0 := %cipher_rsa.certificate('fingerprint','sha256') -if ("%(length:%{Tmp-Octets-0})" != 32) { +if (%length(%{Tmp-Octets-0}) != 32) { test_fail } else { test_pass diff --git a/src/tests/modules/cipher/serial.unlang b/src/tests/modules/cipher/serial.unlang index 01a168a562263..c70b069f9f016 100644 --- a/src/tests/modules/cipher/serial.unlang +++ b/src/tests/modules/cipher/serial.unlang @@ -1,6 +1,6 @@ &Tmp-Octets-0 := "%(cipher_rsa.certificate:serial)" -if ("%(length:%{Tmp-Octets-0})" != 1) { +if (%length(%{Tmp-Octets-0}) != 1) { test_fail } else { test_pass diff --git a/src/tests/modules/client/xlat.unlang b/src/tests/modules/client/xlat.unlang index 508147987ae1b..5663b3127ccf0 100644 --- a/src/tests/modules/client/xlat.unlang +++ b/src/tests/modules/client/xlat.unlang @@ -1,22 +1,22 @@ -&Tmp-String-0 := "%(client:nas_type)" +&Tmp-String-0 := "%client('nas_type')" if (&Tmp-String-0 != 'a_type') { test_fail } -&Tmp-String-0 := "%(client:nas_type 127.0.0.1)" +&Tmp-String-0 := "%client('nas_type',127.0.0.1)" if (&Tmp-String-0 != 'a_type') { test_fail } -&Tmp-String-0 := "%(client:nas_type 127.0.0.2)" +&Tmp-String-0 := "%client('nas_type',127.0.0.2)" if (&Tmp-String-0 != 'b_type') { test_fail } -&Tmp-String-0 := "%(client:nas_type 127.0.0.5)" +&Tmp-String-0 := "%client('nas_type',127.0.0.5)" if (&Tmp-String-0 != 'b_type') { test_fail @@ -25,8 +25,8 @@ if (&Tmp-String-0 != 'b_type') { # # Test non-existent client properties # -&Tmp-String-3 := "%(client:non-existent-attr)" -&Tmp-String-4 := "%(client:non-existing-attr2)" +&Tmp-String-3 := "%client('non-existent-attr')" +&Tmp-String-4 := "%client('non-existing-attr2')" if !(&Tmp-String-3 == "") { test_fail @@ -40,4 +40,4 @@ if !(&Tmp-String-4 == "") { # Tests for multi-valued keys to be added when update takes multiple values # -test_pass \ No newline at end of file +test_pass diff --git a/src/tests/modules/eap_sim/sim_xlat_id_aka.unlang b/src/tests/modules/eap_sim/sim_xlat_id_aka.unlang index bcbfeda8d6fc3..569b7526cb56a 100644 --- a/src/tests/modules/eap_sim/sim_xlat_id_aka.unlang +++ b/src/tests/modules/eap_sim/sim_xlat_id_aka.unlang @@ -1,8 +1,8 @@ -if ("%(aka_sim_id_method:%{User-Name})" != 'AKA') { +if (%aka_sim_id_method("%{User-Name}") != 'AKA') { test_fail } -if ("%(aka_sim_id_type:%{User-Name})" != 'permanent') { +if (%aka_sim_id_type("%{User-Name}") != 'permanent') { test_fail } @@ -10,33 +10,33 @@ if ("%(aka_sim_id_type:%{User-Name})" != 'permanent') { # Encrypt the permanent ID # &control.Tmp-String-0 := '1420032219455258' -&control.User-Name := "%(3gpp_temporary_id_encrypt:%{User-Name} %{control.Tmp-String-0} 6)" +&control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{control.Tmp-String-0},6) # # 0.2 - Can we get the EAP method from the encrypted blob correctly? # -if ("%(aka_sim_id_method:%{control.User-Name})" != 'AKA') { +if (%aka_sim_id_method("%{control.User-Name}") != 'AKA') { test_fail } # # 0.3 - Can we identify the encrypted blob correctly? # -if ("%(aka_sim_id_type:%{control.User-Name})" != 'pseudonym') { +if (%aka_sim_id_type("%{control.User-Name}") != 'pseudonym') { test_fail } # # 0.4 - We should refuse to re-encrypt an encrypted NAI # -if ("%(3gpp_temporary_id_encrypt:%{control.User-Name} %{control.Tmp-String-0} 6)" != '') { +if ("%3gpp_temporary_id_encrypt(%{control.User-Name},%{control.Tmp-String-0},6)" != '') { test_fail } # # 0.5 - Get the original IMSI back again # -&control.Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name} %{control.Tmp-String-0})" +&control.Tmp-String-1 := %3gpp_temporary_id_decrypt(%{control.User-Name},%{control.Tmp-String-0}) if (&control.Tmp-String-1 != &User-Name) { test_fail @@ -57,27 +57,27 @@ if (&User-Name =~ /^[0-9](.*)/) { # &control.Tmp-String-0 := '1420032219455259' &control += { - &User-Name = "%(3gpp_temporary_id_encrypt:%{User-Name[1]} %{control.Tmp-String-0} 6)" + &User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{control.Tmp-String-0},6) } # # 1.2 - Can we identify the encrypted blob correctly? # -if ("%(aka_sim_id_type:%{control.User-Name[1]})" != 'pseudonym') { +if (%aka_sim_id_type("%{control.User-Name[1]}") != 'pseudonym') { test_fail } # # 1.3 - We should refuse to re-encrypt an encrypted NAI # -if ("%(3gpp_temporary_id_encrypt:%{control.User-Name[1]} %{control.Tmp-String-0} 6)" != '') { +if ("%3gpp_temporary_id_encrypt(%{control.User-Name[1]},%{control.Tmp-String-0},6)" != '') { test_fail } # # 1.4 - Get the original IMSI back again # -&control.Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name[1]} %{control.Tmp-String-0})" +&control.Tmp-String-1 := %3gpp_temporary_id_decrypt(%{control.User-Name[1]},%{control.Tmp-String-0}) if (&control.Tmp-String-1 != "0%{User-Name[1]}") { test_fail @@ -88,27 +88,27 @@ if (&control.Tmp-String-1 != "0%{User-Name[1]}") { # &control.Tmp-String-0 := '1420032219455259' &control += { - &User-Name = "%(3gpp_temporary_id_encrypt:%{User-Name[1]} %{control.Tmp-String-0} 6 fastauth)" + &User-Name = %3gpp_temporary_id_encrypt(%{User-Name[1]},%{control.Tmp-String-0},6,fastauth) } # # 2.2 - Can we identify the encrypted blob correctly? # -if ("%(aka_sim_id_type:%{control.User-Name[2]})" != 'fastauth') { +if (%aka_sim_id_type("%{control.User-Name[2]}") != 'fastauth') { test_fail } # # 2.3 - We should refuse to re-encrypt an encrypted NAI # -if ("%(3gpp_temporary_id_encrypt:%{control.User-Name[2]} %{control.Tmp-String-0} 6 fastauth)" != '') { +if ("%3gpp_temporary_id_encrypt(%{control.User-Name[2]},%{control.Tmp-String-0},6,fastauth)" != '') { test_fail } # # 2.4 - Get the original IMSI back again # -&control.Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name[2]} %{control.Tmp-String-0})" +&control.Tmp-String-1 := %3gpp_temporary_id_decrypt(%{control.User-Name[2]},%{control.Tmp-String-0}) if (&control.Tmp-String-1 != "0%{User-Name[1]}") { test_fail diff --git a/src/tests/modules/eap_sim/sim_xlat_id_aka_decrypt_no_tag.unlang b/src/tests/modules/eap_sim/sim_xlat_id_aka_decrypt_no_tag.unlang index 7a56409ca89ef..db4dd87803c8f 100644 --- a/src/tests/modules/eap_sim/sim_xlat_id_aka_decrypt_no_tag.unlang +++ b/src/tests/modules/eap_sim/sim_xlat_id_aka_decrypt_no_tag.unlang @@ -1,8 +1,8 @@ -if ("%(aka_sim_id_method:%{User-Name})" != 'AKA') { +if (%aka_sim_id_method(%{User-Name}) != 'AKA') { test_fail } -if ("%(aka_sim_id_type:%{User-Name})" != 'permanent') { +if (%aka_sim_id_type(%{User-Name}) != 'permanent') { test_fail } @@ -10,7 +10,7 @@ if ("%(aka_sim_id_type:%{User-Name})" != 'permanent') { # 1.1 - Encrypt the permanent ID # &control.Tmp-String-0 := '1420032219455259' -&control.User-Name := "%(3gpp_temporary_id_encrypt:%{User-Name} %{control.Tmp-String-0} 6)" +&control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{control.Tmp-String-0},6) # # 1.2 - Get the original IMSI back again sans tag diff --git a/src/tests/modules/eap_sim/sim_xlat_id_error.unlang b/src/tests/modules/eap_sim/sim_xlat_id_error.unlang index d74feb4979d76..6aef1631f753f 100644 --- a/src/tests/modules/eap_sim/sim_xlat_id_error.unlang +++ b/src/tests/modules/eap_sim/sim_xlat_id_error.unlang @@ -3,7 +3,7 @@ # &User-Name := '14200322194552581' -if ("%(aka_sim_id_method:%{User-Name})" != '') { +if ("%aka_sim_id_method(%{User-Name})" != '') { test_fail } @@ -12,7 +12,7 @@ if ("%(aka_sim_id_method:%{User-Name})" != '') { # &User-Name := '' -if ("%(aka_sim_id_method:%{User-Name})" != '') { +if ("%aka_sim_id_method(%{User-Name})" != '') { test_fail } diff --git a/src/tests/modules/eap_sim/sim_xlat_id_sim.unlang b/src/tests/modules/eap_sim/sim_xlat_id_sim.unlang index fc56e372d64ad..4c99d918a43b7 100644 --- a/src/tests/modules/eap_sim/sim_xlat_id_sim.unlang +++ b/src/tests/modules/eap_sim/sim_xlat_id_sim.unlang @@ -1,8 +1,8 @@ -if ("%(aka_sim_id_method:%{User-Name})" != 'SIM') { +if (%aka_sim_id_method(%{User-Name}) != 'SIM') { test_fail } -if ("%(aka_sim_id_type:%{User-Name})" != 'permanent') { +if (%aka_sim_id_type(%{User-Name}) != 'permanent') { test_fail } @@ -10,26 +10,26 @@ if ("%(aka_sim_id_type:%{User-Name})" != 'permanent') { # Encrypt the permanent ID # &control.Tmp-String-0 := '1234567812345678' -&control.User-Name := "%(3gpp_temporary_id_encrypt:%{User-Name} %{control.Tmp-String-0} 6)" +&control.User-Name := %3gpp_temporary_id_encrypt(%{User-Name},%{control.Tmp-String-0},6) # # Can we get the EAP method from the encrypted blob correctly? # -if ("%(aka_sim_id_method:%{control.User-Name})" != 'SIM') { +if (%aka_sim_id_method(%{control.User-Name}) != 'SIM') { test_fail } # # Can we identify the encrypted blob correctly? # -if ("%(aka_sim_id_type:%{control.User-Name})" != 'pseudonym') { +if (%aka_sim_id_type(%{control.User-Name}) != 'pseudonym') { test_fail } # # We should refuse to re-encrypt an encrypted NAI # -if ("%(3gpp_temporary_id_encrypt:%{control.User-Name} %{control.Tmp-String-0} 6)" != '') { +if %3gpp_temporary_id_encrypt(%{control.User-Name},%{control.Tmp-String-0},6) { test_fail } diff --git a/src/tests/modules/exec/async.unlang b/src/tests/modules/exec/async.unlang index 2bba7443623c7..72d248aa7add2 100644 --- a/src/tests/modules/exec/async.unlang +++ b/src/tests/modules/exec/async.unlang @@ -2,8 +2,8 @@ # Async calls should always return a zero length string # because we don't wait for the response. # -&Tmp-String-0 := "%(exec_async:/bin/sh -c 'echo -n hello')" -if !(&Tmp-String-0 == "") { +&Tmp-String-0 := %exec_async('/bin/sh','-c',"'echo -n hello'") +if &Tmp-String-0 { test_fail } @@ -25,7 +25,7 @@ if (&reply.Reply-Message == 'hello') { # Smoke test - Setup an async process that'll keep running after # after the test exits. # -&Tmp-String-0 := "%(exec_async:/bin/sh -c 'sleep 1')" -if !(&Tmp-String-0 == "") { +&Tmp-String-0 := %exec_async('/bin/sh','-c',"'sleep 1'") +if &Tmp-String-0 { test_fail } diff --git a/src/tests/modules/icmp/ping.unlang b/src/tests/modules/icmp/ping.unlang index 547d8b85d65f4..93050d280d98f 100644 --- a/src/tests/modules/icmp/ping.unlang +++ b/src/tests/modules/icmp/ping.unlang @@ -1,11 +1,11 @@ -&control.Tmp-String-0 := "%(ping:127.0.0.1)" +&control.Tmp-String-0 := %ping(127.0.0.1) # # @todo - conditions do not yet support YIELD # if (&control.Tmp-String-0 == "yes") { &control.Password.Cleartext := "hello" - + &reply += { &Reply-Message = "success" } diff --git a/src/tests/modules/json/json_quote.unlang b/src/tests/modules/json/json_quote.unlang index 2b140e66b69f3..2ab0f9a1b07c8 100644 --- a/src/tests/modules/json/json_quote.unlang +++ b/src/tests/modules/json/json_quote.unlang @@ -1,39 +1,39 @@ &Tmp-String-0 := "Hello\n" -if (!(%(json_quote:%{Tmp-String-0}) == "\"Hello\\n\"")) { +if (!(%json_quote(%{Tmp-String-0}) == "\"Hello\\n\"")) { test_fail } &Tmp-String-0 := "Hello\nbob" -if (!(%(json_quote:%{Tmp-String-0}) == "\"Hello\\nbob\"")) { +if (!(%json_quote(%{Tmp-String-0}) == "\"Hello\\nbob\"")) { test_fail } &Tmp-String-0 := "\nHello\nbob" -if (!(%(json_quote:%{Tmp-String-0}) == "\"\\nHello\\nbob\"")) { +if (!(%json_quote(%{Tmp-String-0}) == "\"\\nHello\\nbob\"")) { test_fail } &Tmp-String-0 := "Hello!" -if (!(%(json_quote:%{Tmp-String-0}) == '"Hello!"')) { +if (!(%json_quote(%{Tmp-String-0}) == '"Hello!"')) { test_fail } &Tmp-Integer-0 := 123456 -if (!(%(json_quote:%{Tmp-Integer-0}) == '123456')) { +if (!(%json_quote(%{Tmp-Integer-0}) == '123456')) { test_fail } &Tmp-IP-Address-0 := 127.0.0.1 -if (!(%(json_quote:%{Tmp-IP-Address-0}) == '"127.0.0.1"')) { +if (!(%json_quote(%{Tmp-IP-Address-0}) == '"127.0.0.1"')) { test_fail } -if (!(%(json_quote:%{Tmp-String-1}) == 'null')) { +if (!(%json_quote(%{Tmp-String-1}) == 'null')) { test_fail } # Test calls in arguments as would be passed to REST module -if (!(%(test.passthrough:"{\"messages\":[{\"attributes\":{\"acct_status_type\":%(json_quote:%{Acct-Status-Type})}}]}") == '{"messages":[{"attributes":{"acct_status_type":null}}]}')) { +if (!(%test.passthrough("{\"messages\":[{\"attributes\":{\"acct_status_type\":%json_quote(%{Acct-Status-Type})}}]}") == '{"messages":[{"attributes":{"acct_status_type":null}}]}')) { test_fail } diff --git a/src/tests/modules/json/regression03.unlang b/src/tests/modules/json/regression03.unlang index 6aa4cb61d3d66..04676ad227634 100644 --- a/src/tests/modules/json/regression03.unlang +++ b/src/tests/modules/json/regression03.unlang @@ -1,5 +1,5 @@ # Verify parsing works correctly with an unquoted xlat -map json %(test.passthrough:"{ \"foo\":\"bar\" }" {}) { +map json %test.passthrough("{ \"foo\":\"bar\" }",{}) { &Tmp-String-0 := '$.foo' } diff --git a/src/tests/modules/ldap/xlat_profile.unlang b/src/tests/modules/ldap/xlat_profile.unlang index 3471ea63d3c80..593ad373157d6 100644 --- a/src/tests/modules/ldap/xlat_profile.unlang +++ b/src/tests/modules/ldap/xlat_profile.unlang @@ -1,4 +1,4 @@ -if (!%(ldap.profile:ldap:///cn=profile2,ou=profiles,dc=example,dc=com)) { +if (!%ldap.profile(ldap:///cn=profile2,ou=profiles,dc=example,dc=com)) { test_fail } diff --git a/src/tests/modules/redis/cluster_key.unlang b/src/tests/modules/redis/cluster_key.unlang index f811644a7c8b6..a445db6579a52 100644 --- a/src/tests/modules/redis/cluster_key.unlang +++ b/src/tests/modules/redis/cluster_key.unlang @@ -15,21 +15,21 @@ $INCLUDE cluster_reset.inc &control.Tmp-String-2 := "3-%randstr('aaaaaaaa')" # Hashes to Redis cluster node master 1 (1) -if ("%(redis:SET b "%{control.Tmp-String-0}")" == 'OK') { +if (%redis('SET','b',"%{control.Tmp-String-0}") == 'OK') { test_pass } else { test_fail } # Hashes to Redis cluster node master 3 (2) -if ("%(redis:SET c "%{control.Tmp-String-1}")" == 'OK') { +if (%redis('SET','c',"%{control.Tmp-String-1}") == 'OK') { test_pass } else { test_fail } # Hashes to Redis cluster node master 2 (3) -if ("%(redis:SET d "%{control.Tmp-String-2}")" == 'OK') { +if (%redis('SET','d',"%{control.Tmp-String-2}") == 'OK') { test_pass } else { test_fail @@ -38,19 +38,19 @@ if ("%(redis:SET d "%{control.Tmp-String-2}")" == 'OK') { # # Now check they are where we expect # -if ("%(redis:@%(redis.node:b 0) GET b)" == "%{control.Tmp-String-0}") { +if (%redis(@%redis.node('b','0'),'GET','b') == "%{control.Tmp-String-0}") { test_pass } else { test_fail } -if ("%(redis:@%(redis.node:c 0) GET c)" == "%{control.Tmp-String-1}") { +if (%redis(@%redis.node('c','0'),'GET','c') == "%{control.Tmp-String-1}") { test_pass } else { test_fail } -if ("%(redis:@%(redis.node:d 0) GET d)" == "%{control.Tmp-String-2}") { +if (%redis(@%redis.node('d','0'),'GET','d') == "%{control.Tmp-String-2}") { 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 d4cab510c2fdc..eca8378fe053a 100644 --- a/src/tests/modules/redis/cluster_node_fail.unlang +++ b/src/tests/modules/redis/cluster_node_fail.unlang @@ -4,52 +4,52 @@ $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 } # Leave some time (500ms) for the synchronisation -%(delay:0.5) +%delay(0.5) # Note the current master -&Tmp-String-1 := %(redis.node:b 0) +&Tmp-String-1 := %redis.node('b',0) # Note the current replica -&Tmp-String-2 := %(redis.node:b 1) +&Tmp-String-2 := %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 } # Forcefully failover the slave for that node -if (!("%(redis:@%{Tmp-String-2} CLUSTER FAILOVER TAKEOVER)" == 'OK')) { +if (!(%redis(@%{Tmp-String-2},'CLUSTER','FAILOVER','TAKEOVER') == 'OK')) { test_fail } # Allow time for the takeover to propagate to other nodes foreach &control.Tmp-Integer-0 { # Keep remapping the cluster - %(redis.remap:%{Tmp-String-2}) + %redis.remap(%{Tmp-String-2}) - if (%(redis.node:b 0) == &Tmp-String-2) { + if (%redis.node('b',0) == &Tmp-String-2) { break } - %(delay:0.5) + %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') { +%delay(0.5) +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 808d3f1cee6aa..3fb308e0e4987 100644 --- a/src/tests/modules/redis/cluster_reset.inc +++ b/src/tests/modules/redis/cluster_reset.inc @@ -66,19 +66,19 @@ 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') { + if (%redis.remap(%{Tmp-String-0}:30001) == 'success') { # 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')) { + 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}")) { + 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 } } diff --git a/src/tests/modules/redis/functions.unlang b/src/tests/modules/redis/functions.unlang index 5f53e7dae426f..9a2f5ef143a0d 100644 --- a/src/tests/modules/redis/functions.unlang +++ b/src/tests/modules/redis/functions.unlang @@ -3,12 +3,12 @@ # $INCLUDE cluster_reset.inc -if (!("%(redis.hello_world:0)" == 'hello world')) { +if (!("%redis.hello_world(0)" == 'hello world')) { test_fail } # ...and again, now hopefully using the cached function -if (!(%(redis.hello_world:0) == 'hello world')) { +if (!(%redis.hello_world(0) == 'hello world')) { test_fail } @@ -19,20 +19,20 @@ if (!(%(redis.hello_world:0 %{Tmp-String-9}) == 'hello world')) { test_fail } -if (!(%(redis.concat_args_keys:1 foo bar baz) == 'foo,bar,baz')) { +if (!(%redis.concat_args_keys(1,'foo','bar','baz') == 'foo,bar,baz')) { test_fail } # Concat with an empty argument. This is a regression test -if (!(%(redis.concat_args_keys:1 foo %{Tmp-String-9} baz) == 'foo,,baz')) { +if (!(%redis.concat_args_keys(1,'foo',%{Tmp-String-9},'baz') == 'foo,,baz')) { test_fail } -if (!(%(redis.multiline:0 0) == 0)) { +if (!(%redis.multiline(0,0) == 0)) { test_fail } -if (!(%(redis.multiline:0 1) == 1)) { +if (!(%redis.multiline(0,1) == 1)) { test_fail } diff --git a/src/tests/modules/redis_ippool/pool_tool_delete.unlang b/src/tests/modules/redis_ippool/pool_tool_delete.unlang index ebc65fd63519f..65e57734cf341 100644 --- a/src/tests/modules/redis_ippool/pool_tool_delete.unlang +++ b/src/tests/modules/redis_ippool/pool_tool_delete.unlang @@ -32,19 +32,19 @@ if !(&reply.Framed-IP-Address == 192.168.0.1) { # # Verify the association with the device has been removed # -if !("%(redis:EXISTS {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID})" == '0') { +if !(%redis('EXISTS',{%{control.IP-Pool.Name}}:device:%{Calling-Station-ID}) == '0') { test_fail } # # Verify the hash information is removed # -if !("%(redis:EXISTS {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address})" == '0') { +if !(%redis('EXISTS',{%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}) == '0') { test_fail } # Check the ZSCORE -if !("%(redis:ZCOUNT {%{control.IP-Pool.Name}%}:pool -inf +inf)" == 0) { +if !(%(redis('ZCOUNT',{%{control.IP-Pool.Name}%}:pool -inf +inf) == 0) { test_fail } diff --git a/src/tests/modules/test/trigger.unlang b/src/tests/modules/test/trigger.unlang index 77c029e0e5210..e065cdc77ffe4 100644 --- a/src/tests/modules/test/trigger.unlang +++ b/src/tests/modules/test/trigger.unlang @@ -1,4 +1,4 @@ -if ("%(test_trigger:test)" == false) { +if (%test_trigger(test) == false) { test_fail } diff --git a/src/tests/modules/unbound/dns.unlang b/src/tests/modules/unbound/dns.unlang index 16fd3112d64e9..a91f20af033b7 100644 --- a/src/tests/modules/unbound/dns.unlang +++ b/src/tests/modules/unbound/dns.unlang @@ -1,5 +1,5 @@ # Use builtin "local" zone -&Tmp-IP-Address-0 := "%(dns:localhost A)" +&Tmp-IP-Address-0 := %dns('localhost','A') if (&Tmp-IP-Address-0 != 127.0.0.1) { test_fail @@ -11,20 +11,20 @@ if (&Tmp-String-0 != "::1") { test_fail } -&Tmp-String-1 := "%(dns:1.0.0.127.in-addr.arpa PTR)" +&Tmp-String-1 := %dns(1.0.0.127.in-addr.arpa,PTR) if (&Tmp-String-1 != "localhost") { test_fail } # Use local data in module config to allow for dotted names -&Tmp-IP-Address-0 := "%(dns:www.example.com A)" +&Tmp-IP-Address-0 := %dns(www.example.com,A) if (&Tmp-IP-Address-0 != 192.168.1.1) { test_fail } -&Tmp-String-0 := "%(dns:1.1.168.192.in-addr.arpa PTR)" +&Tmp-String-0 := %dns(1.1.168.192.in-addr.arpa,PTR) if (&Tmp-String-0 != "www.example.com") { test_fail @@ -32,27 +32,27 @@ if (&Tmp-String-0 != "www.example.com") { # Try a real, known, network response # Temporarily disabled while there is a bug in unbound -#&Tmp-String-0 := "%(dns:8.8.8.8.in-addr.arpa PTR)" +#&Tmp-String-0 := %dns(8.8.8.8.in-addr.arpa,PTR) #if (&Tmp-String-0 != "dns.google") { # test_fail #} # Invalid query -&Tmp-String-0 := "%(dns:www.example.com ABC)" +&Tmp-String-0 := %dns(www.example.com,ABC) if (&Module-Failure-Message != "Invalid / unsupported DNS query type") { test_fail } &Tmp-String-0 := "" -&Tmp-String-1 := "%(dns:%{Tmp-String-0} A)" +&Tmp-String-1 := %dns(%{Tmp-String-0},A) if (&Module-Failure-Message != "Can't resolve zero length host") { test_fail } -&Tmp-String-1 := "%(dns:example.com MX)" +&Tmp-String-1 := "%dns(example.com,MX)" # Until we can handle multiple boxes in xlat expansion, the results # are concatenated into a single string @@ -63,13 +63,13 @@ if ((&Tmp-String-1 != '10mail.example.com20mail2.example.com') && (&Tmp-String-1 # Just return a single record # As results are not in a specified order, it could be either. -&Tmp-String-1 := "%(dns:example.com MX 1)" +&Tmp-String-1 := "%dns(example.com,MX,1)" if ((&Tmp-String-1 != '10mail.example.com') && (&Tmp-String-1 != '20mail2.example.com')) { test_fail } -&Tmp-String-1 := "%(dns:n0nex1stent.d0ma1n A)" +&Tmp-String-1 := %dns(n0nex1stent.d0ma1n,A) # Running this on macOS produces a timeout due to the nonexistent TLD if ((&Module-Failure-Message != "dns - Nonexistent domain name") && (&Module-Failure-Message != "Timeout waiting for DNS resolution")) {