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..3721ff16f4eb0 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/exec/async.unlang b/src/tests/modules/exec/async.unlang index 2bba7443623c7..7bf5977309ab2 100644 --- a/src/tests/modules/exec/async.unlang +++ b/src/tests/modules/exec/async.unlang @@ -2,7 +2,7 @@ # 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')" +&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')" +&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/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 }