From: Alan T. DeKok Date: Tue, 30 Aug 2022 19:20:11 +0000 (-0400) Subject: more "convert to update" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4864a2cf7dcd615a15476198f9215b49a7e5855b;p=thirdparty%2Ffreeradius-server.git more "convert to update" --- diff --git a/src/tests/keywords/xlat-attr-index b/src/tests/keywords/xlat-attr-index index c2cb4263694..fc6bfd02f84 100644 --- a/src/tests/keywords/xlat-attr-index +++ b/src/tests/keywords/xlat-attr-index @@ -16,9 +16,9 @@ if ("%{Tmp-IP-Address-0[*]}" != '192.0.2.1192.0.2.2') { # Try calling these xlats in mapping too, they may get optimised to VPTs which is a # different code path. -update request { - &Tmp-IP-Address-1 += "%{Tmp-IP-Address-0[1]}" - &Tmp-IP-Address-1 += "%{Tmp-IP-Address-0[0]}" +&request += { + &Tmp-IP-Address-1 = "%{Tmp-IP-Address-0[1]}" + &Tmp-IP-Address-1 = "%{Tmp-IP-Address-0[0]}" &Tmp-String-0 = "%(concat:%{Tmp-IP-Address-0[*]} ,)" &Tmp-Integer-0 = "%{Tmp-IP-Address-0[#]}" } diff --git a/src/tests/keywords/xlat-config b/src/tests/keywords/xlat-config index 01850ac230f..2fa7e4ed4cd 100644 --- a/src/tests/keywords/xlat-config +++ b/src/tests/keywords/xlat-config @@ -1,23 +1,14 @@ # -# PRE: update if +# PRE: if # -update request { - &Tmp-String-0 := "%(config:modules.test.boolean)" -} - +&Tmp-String-0 := "%(config:modules.test.boolean)" if (&Tmp-String-0 != "no") { test_fail } -update request { - &Tmp-String-0 := "test" -} - -update request { - &Tmp-Integer-0 := "%(config:modules.%{Tmp-String-0}.integer)" -} - +&Tmp-String-0 := "test" +&Tmp-Integer-0 := "%(config:modules.%{Tmp-String-0}.integer)" if (&Tmp-Integer-0 != 1) { test_fail } diff --git a/src/tests/keywords/xlat-delay b/src/tests/keywords/xlat-delay index 6fcffc72c3e..abeb73cbf1f 100644 --- a/src/tests/keywords/xlat-delay +++ b/src/tests/keywords/xlat-delay @@ -6,10 +6,7 @@ "%(delay_10s:)" # Should 'blip' the request -update 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/keywords/xlat-dhcpv4 b/src/tests/keywords/xlat-dhcpv4 index d81d0611758..79d173463ec 100644 --- a/src/tests/keywords/xlat-dhcpv4 +++ b/src/tests/keywords/xlat-dhcpv4 @@ -1,13 +1,9 @@ # -# PRE: update # PROTOCOL: dhcpv4 # -update control { - &Tmp-Octets-0 := 0x520d0103abcdef0206010203040506 -} - -if ("%(decode.dhcpv4:%{control.Tmp-Octets-0})" != 2) { +&Tmp-Octets-0 := 0x520d0103abcdef0206010203040506 +if ("%(decode.dhcpv4:%{Tmp-Octets-0})" != 2) { test_fail } @@ -21,11 +17,8 @@ if ( &Relay-Agent-Information.Remote-Id != 0x010203040506 ) { test_fail } -update control { - &Tmp-Octets-1 := "%(encode.dhcpv4:&request[*])" -} - -if ( &control.Tmp-Octets-1 != 0x520d0103abcdef0206010203040506 ) { +&Tmp-Octets-1 := "%(encode.dhcpv4:&request[*])" +if ( &Tmp-Octets-1 != 0x520d0103abcdef0206010203040506 ) { test_fail }