From: Alan T. DeKok Date: Thu, 23 Nov 2023 12:42:30 +0000 (-0500) Subject: more convert to new function syntax X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57546b4e403a1827e295ba005c6023c8b4688acf;p=thirdparty%2Ffreeradius-server.git more convert to new function syntax --- diff --git a/src/tests/auth/chap b/src/tests/auth/chap index 9f53bed3fb4..f0b1f9c63ff 100644 --- a/src/tests/auth/chap +++ b/src/tests/auth/chap @@ -5,4 +5,4 @@ # # Set CHAP-Password # -&CHAP-Password := "%(chap.password:%{CHAP-Password})" +&CHAP-Password := %chap.password("%{CHAP-Password}") diff --git a/src/tests/auth/chap_header b/src/tests/auth/chap_header index ec3e4507bed..c8d5a0856a6 100644 --- a/src/tests/auth/chap_header +++ b/src/tests/auth/chap_header @@ -8,4 +8,4 @@ # # Set CHAP-Password # -&request.CHAP-Password := %(chap.password:%{request.CHAP-Password}) +&request.CHAP-Password := %chap.password("%{request.CHAP-Password}") diff --git a/src/tests/eapol_test/config/aka-prime/sites-enabled/aka-prime b/src/tests/eapol_test/config/aka-prime/sites-enabled/aka-prime index a7580d9f5ba..e4ccb177dc4 100644 --- a/src/tests/eapol_test/config/aka-prime/sites-enabled/aka-prime +++ b/src/tests/eapol_test/config/aka-prime/sites-enabled/aka-prime @@ -6,7 +6,7 @@ server eap-aka-prime { } recv Identity-Response { - "%(debug_attr:&session-state.)" +# %debug_attr(&session-state.) if (!&session-state.Tmp-String-0) { &reply.Any-ID-Req := yes &session-state.Tmp-String-0 := yes diff --git a/src/tests/eapol_test/config/aka/sites-enabled/aka b/src/tests/eapol_test/config/aka/sites-enabled/aka index c5d03e6202e..213b45c51b2 100644 --- a/src/tests/eapol_test/config/aka/sites-enabled/aka +++ b/src/tests/eapol_test/config/aka/sites-enabled/aka @@ -7,7 +7,7 @@ server eap-aka { } recv Identity-Response { - "%(debug_attr:&session-state.)" +# %debug_attr(&session-state.) if (!&session-state.Tmp-String-0) { &reply.Any-ID-Req := yes &session-state.Tmp-String-0 := yes diff --git a/src/tests/eapol_test/config/sim/sites-enabled/sim b/src/tests/eapol_test/config/sim/sites-enabled/sim index 8028affe7f3..9bcf302fa80 100644 --- a/src/tests/eapol_test/config/sim/sites-enabled/sim +++ b/src/tests/eapol_test/config/sim/sites-enabled/sim @@ -2,7 +2,7 @@ server eap-sim { namespace = eap-sim recv Identity-Response { - "%(debug_attr:&session-state.)" +# %debug_attr(&session-state.) if (!&session-state.Tmp-String-0) { &reply.Any-ID-Req := yes &session-state.Tmp-String-0 := yes diff --git a/src/tests/keywords/md5-error b/src/tests/keywords/md5-error index f04f980ea8b..309f4a7f575 100644 --- a/src/tests/keywords/md5-error +++ b/src/tests/keywords/md5-error @@ -7,6 +7,8 @@ # # MD5 HMAC with missing key should fail # -&Tmp-Octets-1 := "%(hmacmd5:%{Tmp-String-1} )" # ERROR - -test_fail +&Tmp-Octets-1 := %hmacmd5(%{Tmp-String-1}, ) +if &Tmp-Octets-1 { + test_fail +} +success diff --git a/src/tests/keywords/pap b/src/tests/keywords/pap index 205c25c0bd0..9e802bb1a94 100644 --- a/src/tests/keywords/pap +++ b/src/tests/keywords/pap @@ -24,7 +24,7 @@ if (reject) { # &Tmp-String-1 := "{clear}%{User-Password}" &control := { - &Password.With-Header = "%(base64.encode:%{Tmp-String-1})" + &Password.With-Header = %base64.encode(%{Tmp-String-1}) } pap.authorize diff --git a/src/tests/keywords/pap-ssha2 b/src/tests/keywords/pap-ssha2 index 74c3bf85069..0919ac7d467 100644 --- a/src/tests/keywords/pap-ssha2 +++ b/src/tests/keywords/pap-ssha2 @@ -68,7 +68,7 @@ if (reject) { &control.Tmp-Octets-0 := "%bin(%{control.Tmp-String-1})" # To Base64 -&control.Tmp-String-1 := "{ssha512}%(base64.encode:%{control.Tmp-Octets-0})" +&control.Tmp-String-1 := "{ssha512}%base64.encode(%{control.Tmp-Octets-0})" &control += { &Password.With-Header = "%base64.encode(%{control.Tmp-String-1})" diff --git a/src/tests/keywords/sha1-error b/src/tests/keywords/sha1-error index 828ffb5837c..ed54f99c377 100644 --- a/src/tests/keywords/sha1-error +++ b/src/tests/keywords/sha1-error @@ -3,7 +3,8 @@ # # SHA1 HMAC with missing key should fail # -&Tmp-Octets-1 := "%(hmacsha1:%{Tmp-String-1} )" # ERROR - - -test_fail +&Tmp-Octets-1 := %hmacsha1(%{Tmp-String-1}, ) # ERROR +if &Tmp-Octets-1 { + test_fail +} +success diff --git a/src/tests/keywords/timeout b/src/tests/keywords/timeout index 278860f1490..54b1e2d4b89 100644 --- a/src/tests/keywords/timeout +++ b/src/tests/keywords/timeout @@ -7,7 +7,7 @@ # redundant { timeout 0.01s { - &Tmp-Float-0 := "%(delay_10s:0.1)" + &Tmp-Float-0 := %delay_10s(0.1) test_fail } @@ -18,7 +18,7 @@ redundant { redundant { timeout "0.01" { - &Tmp-Float-0 := "%(delay_10s:0.1)" + &Tmp-Float-0 := %delay_10s(0.1) test_fail } diff --git a/src/tests/keywords/xlat-alternation-fail-then-func b/src/tests/keywords/xlat-alternation-fail-then-func index 4729389a05a..a4acb78f349 100644 --- a/src/tests/keywords/xlat-alternation-fail-then-func +++ b/src/tests/keywords/xlat-alternation-fail-then-func @@ -4,6 +4,6 @@ &request -= &Tmp-String-0[*] &request -= &Tmp-String-1[*] -&Tmp-String-2 := "%{&Tmp-String-0[0] || &Tmp-String-1[0]}%(delay_10s:)" +&Tmp-String-2 := "%{&Tmp-String-0[0] || &Tmp-String-1[0]}%delay_10s()" success diff --git a/src/tests/keywords/xlat-delay b/src/tests/keywords/xlat-delay index abeb73cbf1f..bd6ff59fdf4 100644 --- a/src/tests/keywords/xlat-delay +++ b/src/tests/keywords/xlat-delay @@ -4,9 +4,9 @@ # This is mainly a smoke test... i.e. if it crashes there's smoke -"%(delay_10s:)" # Should 'blip' the request +%delay_10s() # Should 'blip' the request -&Tmp-Float-0 := "%(delay_10s:0.1)" +&Tmp-Float-0 := %delay_10s(0.1) if (!&Tmp-Float-0) { fail } diff --git a/src/tests/modules/always/set_rcode.unlang b/src/tests/modules/always/set_rcode.unlang index 977157727d9..f6807490f44 100644 --- a/src/tests/modules/always/set_rcode.unlang +++ b/src/tests/modules/always/set_rcode.unlang @@ -1,9 +1,9 @@ # # Set status to "notfound". xlat should expand to previous status, "alive" # -if ("%(db_status:notfound)" != "alive") { +if (%db_status('notfound') != "alive") { &reply += { - &Reply-Message = "Failure in test at line %(interpreter:...line)" + &Reply-Message = "Failure in test at line %interpreter(...line)" } } @@ -13,7 +13,7 @@ if ("%(db_status:notfound)" != "alive") { db_status if (!notfound) { &reply += { - &Reply-Message = "Failure in test at line %(interpreter:...line)" + &Reply-Message = "Failure in test at line %interpreter(...line)" } } @@ -21,9 +21,9 @@ if (!notfound) { # # Fetch status using xlat without setting the status # -if ("%(db_status:)" != "notfound") { +if (%db_status() != "notfound") { &reply += { - &Reply-Message = "Failure in test at line %(interpreter:...line)" + &Reply-Message = "Failure in test at line %interpreter(...line)" } } diff --git a/src/tests/modules/always/set_status_dead.unlang b/src/tests/modules/always/set_status_dead.unlang index 99dbd5f450d..bf8a2392dc7 100644 --- a/src/tests/modules/always/set_status_dead.unlang +++ b/src/tests/modules/always/set_status_dead.unlang @@ -1,7 +1,7 @@ # # Set the module status to dead, call it and check that it fails # -%(db_status:fail) +%db_status('fail') db_status { fail = 1 diff --git a/src/tests/modules/always/set_status_revive.unlang b/src/tests/modules/always/set_status_revive.unlang index 03af845236f..a8ec38d5230 100644 --- a/src/tests/modules/always/set_status_revive.unlang +++ b/src/tests/modules/always/set_status_revive.unlang @@ -1,13 +1,13 @@ # # Fail a module... # -%(db_status:fail) +%db_status('fail') db_status { fail = 1 } if (!fail) { &reply += { - &Reply-Message = "Failure in test at line %(interpreter:...line)" + &Reply-Message = "Failure in test at line %interpreter(...line)" } } @@ -15,7 +15,7 @@ if (!fail) { # # ... Now revive it # -%(db_status:alive) +%db_status('alive') db_status if (ok) { &reply += {