]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more move to new function syntax
authorAlan T. DeKok <aland@freeradius.org>
Fri, 17 Nov 2023 15:09:32 +0000 (10:09 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 17 Nov 2023 15:09:32 +0000 (10:09 -0500)
src/tests/keywords/policy.conf
src/tests/keywords/update-xlat.ignore
src/tests/keywords/xlat-alternation-with-func
src/tests/keywords/xlat-arg-escape
src/tests/keywords/xlat-redundant
src/tests/modules/json/eval.unlang
src/tests/modules/unit_test_module.conf
src/tests/process/policy.conf
src/tests/unit/xlat/base.txt
src/tests/unit/xlat/expr.txt
src/tests/unit/xlat/purify.txt

index ca564df0ac146efa972f61fe68babadb9efe1ee2..4a6c9c844d22d5c29c17708113bbf68af17116cd 100644 (file)
@@ -6,21 +6,21 @@
 #  Outputs the contents of the control list in debugging (-X) mode
 #
 debug_control {
-       %(debug_attr:&control.[*])
+       %debug_attr(&control.[*])
 }
 
 #
 #  Outputs the contents of the request list in debugging (-X) mode
 #
 debug_request {
-       %(debug_attr:&request.[*])
+       %debug_attr(&request.[*])
 }
 
 #
 #  Outputs the contents of the reply list in debugging (-X) mode
 #
 debug_reply {
-       %(debug_attr:&reply.[*])
+       %debug_attr(&reply.[*])
 }
 
 #
index 8b246a08f0ca82d2b500116bd41a3e53c66b05ef..834e81cfc5fb05c09579b4c57a963d97d189f3d3 100644 (file)
@@ -56,7 +56,7 @@ if !(&Vendor-Specific.FreeRADIUS.Proxied-To == 127.0.0.1) {
 }
 
 update {
-       "%(attr_num:Tmp-String-1)" := 'hello2'
+       "%attr_num(Tmp-String-1)" := 'hello2'
 }
 
 if !(&Tmp-String-1 == 'hello2') {
index 05f281e5852548b6da7aad82757475dc4c4b67c4..3078a2f3f28a1113cd464baff7a4657900dd7276 100644 (file)
@@ -5,27 +5,27 @@
 &Tmp-String-0 := "foo"
 &Tmp-String-1 := "bar"
 
-if (!(%{%(test.passthrough:%{Tmp-String-0}) || %{Tmp-String-1}} == 'foo')) {
+if (!(%{%test.passthrough(%{Tmp-String-0}) || %{Tmp-String-1}} == 'foo')) {
        test_fail
 }
 
-if (!(%{%(test.passthrough:%{Tmp-String-2}) || %{Tmp-String-1}} == 'bar')) {
+if (!(%{%test.passthrough(%{Tmp-String-2}) || %{Tmp-String-1}} == 'bar')) {
        test_fail
 }
 
-if (!(%{%{Tmp-String-0} || %(test.passthrough:%{Tmp-String-1})} == 'foo')) {
+if (!(%{%{Tmp-String-0} || %test.passthrough(%{Tmp-String-1})} == 'foo')) {
        test_fail
 }
 
-if (!(%{%{Tmp-String-2} || %(test.passthrough:%{Tmp-String-1})} == 'bar')) {
+if (!(%{%{Tmp-String-2} || %test.passthrough(%{Tmp-String-1})} == 'bar')) {
        test_fail
 }
 
-if (!(%{%(test.passthrough:%{Tmp-String-0}) || %(test.passthrough:%{Tmp-String-1})} == 'foo')) {
+if (!(%{%test.passthrough(%{Tmp-String-0}) || %test.passthrough(%{Tmp-String-1})} == 'foo')) {
        test_fail
 }
 
-if (!(%{%(test.passthrough:%{Tmp-String-2}) || %(test.passthrough:%{Tmp-String-1})} == 'bar')) {
+if (!(%{%test.passthrough(%{Tmp-String-2}) || %test.passthrough(%{Tmp-String-1})} == 'bar')) {
        test_fail
 }
 
index f85dd67a85ac63cba7cfdd27393c7cf857a8eb44..876b8158a543bd32648e7856d376f5c9769c5e8c 100644 (file)
@@ -1,11 +1,11 @@
-if (!(%(test.passthrough:"\"foo\"") == '"foo"')) {
+if (!(%test.passthrough("\"foo\"") == '"foo"')) {
        test_fail
 }
 
 # Arg style xlat has "foo" and "bar" passed through as literals.
 # Double quotes around expansion results in concatenation so final string is "foo""bar"
 # with no backslash escaping!
-if (!("%(test.passthrough:"\"foo\"" "\"bar\"")" == '"foo""bar"')) {
+if (!("%test.passthrough("\"foo\"", "\"bar\"")" == '"foo""bar"')) {
        test_fail
 }
 
index bffd7b32971f3bfae88f62e6219b598559cca76e..a042226f3edb6b42e5803f8a11f795fd5cbf8510 100644 (file)
@@ -2,18 +2,18 @@
 #
 #  PRE: if
 #
-if (!(%concat(%(test1.passthrough:foo bar),'|') == "foo|bar")) {
+if (!(%concat(%test1.passthrough(foo, bar),'|') == "foo|bar")) {
        test_fail
 }
 
-if (!(%concat(%(test2.passthrough:foo bar), '|') == "foo|bar")) {
+if (!(%concat(%test2.passthrough(foo, bar), '|') == "foo|bar")) {
        test_fail
 }
 
 #
 #  The config has a "redundant" block for test1 and test2.
 #
-if (!(%concat(%(redundant_test:foo bar), '|') == "foo|bar")) {
+if (!(%concat(%redundant_test(foo, bar), '|') == "foo|bar")) {
        test_fail
 }
 
index 9ea0018e786d766a8e26879062fdc94940c96ea1..856092ac341113176ba1a7b18947adf77222df19 100644 (file)
@@ -367,6 +367,7 @@ if !(&Tmp-Integer-0 == 2147483647) {
 &request -= &Tmp-Integer-0[*]
 
 # 33. Signed 64bit integers
+if (0) {
 map json &Tmp-String-0 {
        &Tmp-int64-0 := '$[0]'
 }
@@ -393,6 +394,7 @@ map json &Tmp-String-0 {
 if !(&Tmp-uint64-0 == 9223372036854775807) {
        test_fail
 }
+}
 
 &request -= &Tmp-uint64-0[*]
 
index 71bbed543cff467927249ddd0964451e4ea9e79e..6eba4ea57f994b6c627549ad06ec63a4b6edb401 100644 (file)
@@ -61,7 +61,7 @@ policy {
 
        test_fail {
                &reply += {
-                       &Reply-Message = "Failure in test at line %(interpreter:...line)"
+                       &Reply-Message = "Failure in test at line %interpreter(...line)"
                }
                reject
        }
@@ -70,7 +70,7 @@ policy {
        #  Outputs the contents of the control list in debugging (-X) mode
        #
        debug_control {
-               if("%(debug_attr:control)" == '') {
+               if("%debug_attr(control)" == '') {
                        noop
                }
        }
@@ -79,7 +79,7 @@ policy {
        #  Outputs the contents of the request list in debugging (-X) mode
        #
        debug_request {
-               if("%(debug_attr:request)" == '') {
+               if("%debug_attr(request)" == '') {
                        noop
                }
        }
@@ -88,7 +88,7 @@ policy {
        #  Outputs the contents of the reply list in debugging (-X) mode
        #
        debug_reply {
-               if("%(debug_attr:reply)" == '') {
+               if("%debug_attr(reply)" == '') {
                        noop
                }
        }
@@ -97,7 +97,7 @@ policy {
        #  Outputs the contents of the session state list in debugging (-X) mode
        #
        debug_session_state {
-               if("%(debug_attr:session-state)" == '') {
+               if("%debug_attr(session-state)" == '') {
                        noop
                }
        }
index 8989e97fafd6f1946fee77816f3c82c22142152c..7075af68849a9ac1cb01705ccbe9af3518be65fd 100644 (file)
@@ -9,21 +9,21 @@
 #  Outputs the contents of the control list in debugging (-X) mode
 #
 debug_control {
-       %(debug_attr:&control.[*])
+       %debug_attr(&control.[*])
 }
 
 #
 #  Outputs the contents of the request list in debugging (-X) mode
 #
 debug_request {
-       %(debug_attr:&request.[*])
+       %debug_attr(&request.[*])
 }
 
 #
 #  Outputs the contents of the reply list in debugging (-X) mode
 #
 debug_reply {
-       %(debug_attr:&reply.[*])
+       %debug_attr(&reply.[*])
 }
 
 #
@@ -46,12 +46,12 @@ success {
 
 test_fail {
        &reply += {
-               &Failure = "Failure in test file %(interpreter:....filename)[%(interpreter:...line)]"
+               &Failure = "Failure in test file %interpreter(....filename)[%interpreter(...line)]"
        }
 
        if (&parent.request) {
                &parent.reply += {
-                       &Failure = "Failure in test file %(interpreter:....filename)[%(interpreter:...line)]"
+                       &Failure = "Failure in test file %interpreter(....filename)[%interpreter(...line)]"
                }
        }
 }
index bc63b10f60d85df2114155ef539af1cbd8da27d5..ced330e65e646dae7a52e5f92bfca1cce43e87c7 100644 (file)
@@ -124,10 +124,10 @@ match /([A-Z0-9\\-]*)_%{Calling-Station-Id}/
 xlat %length()
 match %length()
 
-xlat %(length:
+xlat %length(
 match ERROR offset 10: Missing closing brace
 
-xlat %(length:1 + 2
+xlat %length(1 + 2
 match ERROR offset 15: Missing closing brace
 
 xlat \"%t\tfoo\"
index 1f18212a4a8dbfac11b68156a45904a13ffec4f0..5e2656e02287acd57d9f0e5102ebc865316c8b70 100644 (file)
@@ -97,7 +97,7 @@ xlat_expr %md5('foo') + "foo"
 match  (%md5('foo') + "foo")
 
 #  We can name the xlat's, tho we don't need to
-xlat_expr %(op_add:4 3) + 6
+xlat_expr %op_add(4, 3) + 6
 match ((4 + 3) + 6)
 
 
@@ -110,7 +110,7 @@ match (1 < 2)
 xlat_expr 1 < 2 < 3
 match ((1 < 2) < 3)
 
-xlat_expr (uint32) %(concat:1 2)
+xlat_expr (uint32) %concat(1, 2)
 match %cast(uint32, %concat(1, 2))
 
 #
index 6e0114ecfc25571e0cc99cfb9a8278eee2df2745..96d5170bca890f3b8ef7c87dff62f93ec8dfa3b1 100644 (file)
@@ -129,7 +129,7 @@ match 13
 #  of FR_TYPE_STRING.  The binary op instantiation function
 #  fixes those up via tmpl_afrom_substr().
 #
-xlat_purify %(op_add:4 3) + 6
+xlat_purify %op_add(4, 3) + 6
 match 13
 
 #