]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more "convert to update"
authorAlan T. DeKok <aland@freeradius.org>
Tue, 30 Aug 2022 19:20:11 +0000 (15:20 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 30 Aug 2022 19:20:11 +0000 (15:20 -0400)
src/tests/keywords/xlat-attr-index
src/tests/keywords/xlat-config
src/tests/keywords/xlat-delay
src/tests/keywords/xlat-dhcpv4

index c2cb4263694b0690fc9a454b8eb49903267f11f0..fc6bfd02f849f52b01e95f4443ae6db418d1d4bc 100644 (file)
@@ -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[#]}"
 }
index 01850ac230fd4add32a2fad33319bd5b91e7cc48..2fa7e4ed4cdc3da3e0d0649f0653859bfe73f81d 100644 (file)
@@ -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
 }
index 6fcffc72c3e6cba92c699951df304486c07b5459..abeb73cbf1fe2f4e2586e66b844f7f7c993b758e 100644 (file)
@@ -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
 }
index d81d0611758d453913be3feb16dc1c95814271e8..79d173463ecf812435dd8e7eb09a008589a3167e 100644 (file)
@@ -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
 }