From: Alan T. DeKok Date: Fri, 17 Nov 2023 15:09:32 +0000 (-0500) Subject: more move to new function syntax X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d0487e8458475873f4768529f817ea952233be2;p=thirdparty%2Ffreeradius-server.git more move to new function syntax --- diff --git a/src/tests/keywords/policy.conf b/src/tests/keywords/policy.conf index ca564df0ac1..4a6c9c844d2 100644 --- a/src/tests/keywords/policy.conf +++ b/src/tests/keywords/policy.conf @@ -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.[*]) } # diff --git a/src/tests/keywords/update-xlat.ignore b/src/tests/keywords/update-xlat.ignore index 8b246a08f0c..834e81cfc5f 100644 --- a/src/tests/keywords/update-xlat.ignore +++ b/src/tests/keywords/update-xlat.ignore @@ -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') { diff --git a/src/tests/keywords/xlat-alternation-with-func b/src/tests/keywords/xlat-alternation-with-func index 05f281e5852..3078a2f3f28 100644 --- a/src/tests/keywords/xlat-alternation-with-func +++ b/src/tests/keywords/xlat-alternation-with-func @@ -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 } diff --git a/src/tests/keywords/xlat-arg-escape b/src/tests/keywords/xlat-arg-escape index f85dd67a85a..876b8158a54 100644 --- a/src/tests/keywords/xlat-arg-escape +++ b/src/tests/keywords/xlat-arg-escape @@ -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 } diff --git a/src/tests/keywords/xlat-redundant b/src/tests/keywords/xlat-redundant index bffd7b32971..a042226f3ed 100644 --- a/src/tests/keywords/xlat-redundant +++ b/src/tests/keywords/xlat-redundant @@ -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 } diff --git a/src/tests/modules/json/eval.unlang b/src/tests/modules/json/eval.unlang index 9ea0018e786..856092ac341 100644 --- a/src/tests/modules/json/eval.unlang +++ b/src/tests/modules/json/eval.unlang @@ -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[*] diff --git a/src/tests/modules/unit_test_module.conf b/src/tests/modules/unit_test_module.conf index 71bbed543cf..6eba4ea57f9 100644 --- a/src/tests/modules/unit_test_module.conf +++ b/src/tests/modules/unit_test_module.conf @@ -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 } } diff --git a/src/tests/process/policy.conf b/src/tests/process/policy.conf index 8989e97fafd..7075af68849 100644 --- a/src/tests/process/policy.conf +++ b/src/tests/process/policy.conf @@ -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)]" } } } diff --git a/src/tests/unit/xlat/base.txt b/src/tests/unit/xlat/base.txt index bc63b10f60d..ced330e65e6 100644 --- a/src/tests/unit/xlat/base.txt +++ b/src/tests/unit/xlat/base.txt @@ -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\" diff --git a/src/tests/unit/xlat/expr.txt b/src/tests/unit/xlat/expr.txt index 1f18212a4a8..5e2656e0228 100644 --- a/src/tests/unit/xlat/expr.txt +++ b/src/tests/unit/xlat/expr.txt @@ -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)) # diff --git a/src/tests/unit/xlat/purify.txt b/src/tests/unit/xlat/purify.txt index 6e0114ecfc2..96d5170bca8 100644 --- a/src/tests/unit/xlat/purify.txt +++ b/src/tests/unit/xlat/purify.txt @@ -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 #