]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more "convert to edit"
authorAlan T. DeKok <aland@freeradius.org>
Fri, 5 Aug 2022 14:12:12 +0000 (10:12 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 5 Aug 2022 14:19:21 +0000 (10:19 -0400)
21 files changed:
src/tests/keywords/pap
src/tests/keywords/pap-ssha2
src/tests/keywords/parallel-rcode
src/tests/keywords/parallel-yield
src/tests/keywords/rand
src/tests/keywords/randstr
src/tests/keywords/redundant
src/tests/keywords/redundant-load-balance
src/tests/keywords/redundant-redundant
src/tests/keywords/regex-escape
src/tests/keywords/regex-lhs
src/tests/keywords/retry-section
src/tests/keywords/return
src/tests/keywords/return-break-mix
src/tests/keywords/return-group
src/tests/keywords/return-section
src/tests/keywords/return-within-condition-dynamic
src/tests/keywords/return-within-condition-static
src/tests/keywords/return-within-foreach
src/tests/keywords/return-within-if-after-policy
src/tests/keywords/return-within-policy

index a00d9b177c37380a232536a84bd1da753d7c2133..84d8ac5efc3c003c15dfe62cc39579f6d88bf985 100644 (file)
@@ -1,17 +1,16 @@
 #
-# PRE: update update-remove-any if
+# PRE: edit-list-remove if
 #
-update {
-       &control !* ANY
-       &request.Tmp-String-0 := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK" # 60 byte salt
-}
+&control := {}
+&request.Tmp-String-0 := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK"        # 60 byte salt
 
 #
 #  Unencoded Password.Cleartext in password with header
 #
-update {
-       &control.Password.With-Header := "%{User-Password}"
+&control := {
+       &Password.With-Header = "%{User-Password}"
 }
+
 pap.authorize
 pap.authenticate {
        reject = 1
@@ -20,19 +19,14 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
-
 #
 #  Base64 encoded Password.Cleartext in password with header
 #
-update {
-       &Tmp-String-1 := "{clear}%{User-Password}"
-}
-update {
-       &control.Password.With-Header := "%{base64:%{Tmp-String-1}}"
+&Tmp-String-1 := "{clear}%{User-Password}"
+&control := {
+       &Password.With-Header = "%{base64:%{Tmp-String-1}}"
 }
+
 pap.authorize
 pap.authenticate {
        reject = 1
@@ -41,15 +35,11 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
-
 #
 #  Hex encoded SSHA password
 #
-update {
-       &control.Password.With-Header += "{ssha}%{hex:%{sha1:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
+&control := {
+       &Password.With-Header = "{ssha}%{hex:%{sha1:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
 }
 
 pap.authorize
@@ -60,30 +50,19 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
-
 #
 #  Base64 encoded SSHA password
 #
-update {
-       &control.Tmp-String-1 := "%{hex:%{sha1:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
+&control := {
+        &Tmp-String-1 = "%{hex:%{sha1:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
 }
 
 # To Binary
-update {
-       &control.Tmp-Octets-0 := "%{bin:%{control.Tmp-String-1}}"
-}
+&control.Tmp-Octets-0 := "%{bin:%{control.Tmp-String-1}}"
 
 # To Base64
-update {
-       &control.Tmp-String-1 := "%{base64:%{control.Tmp-Octets-0}}"
-}
-
-update {
-       &control.Password.With-Header += "{ssha}%{control.Tmp-String-1}"
-}
+&control.Tmp-String-1 := "%{base64:%{control.Tmp-Octets-0}}"
+&control.Password.With-Header := "{ssha}%{control.Tmp-String-1}"
 
 pap.authorize
 pap.authenticate {
@@ -93,30 +72,19 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
-
 #
 #  Base64 of Base64 encoded SSHA password
 #
-update {
-       &control.Tmp-String-1 := "%{hex:%{sha1:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
+&control := {
+       &Tmp-String-1 = "%{hex:%{sha1:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
 }
 
 # To Binary
-update {
-       &control.Tmp-Octets-0 := "%{bin:%{control.Tmp-String-1}}"
-}
+&control.Tmp-Octets-0 := "%{bin:%{control.Tmp-String-1}}"
 
 # To Base64
-update {
-       &control.Tmp-String-1 := "{ssha}%{base64:%{control.Tmp-Octets-0}}"
-}
-
-update {
-       &control.Password.With-Header += "%{base64:%{control.Tmp-String-1}}"
-}
+&control.Tmp-String-1 := "{ssha}%{base64:%{control.Tmp-Octets-0}}"
+&control.Password.With-Header := "%{base64:%{control.Tmp-String-1}}"
 
 pap.authorize
 pap.authenticate {
@@ -126,12 +94,9 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
 
-update control {
-       &Auth-Type := Accept
+&control := {
+       &Auth-Type = Accept
 }
 
 success
index 16b3f8f09a0994d68df4836773da72524fbaf953..b193a43b0a60280edb7e58810d8431ffb1225f8a 100644 (file)
@@ -1,27 +1,22 @@
 #
-# PRE: update if pap
+# PRE: pap
 #
 
 #
 #  Skip if the server wasn't built with openssl
 #
 if ('${feature.tls}' != 'yes') {
-       update reply {
-               &Packet-Type := Access-Accept
-       }
+       &reply.Packet-Type := Access-Accept
        handled
 }
 
-update {
-       &control !* ANY
-       &Tmp-String-0 := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK" # 60 byte salt
-}
+&Tmp-String-0 := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK"        # 60 byte salt
 
 #
 #  Hex encoded SSHA2-512 password
 #
-update {
-       &control.Password.With-Header += "{ssha512}%{hex:%{sha2_512:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
+&control := {
+       &Password.With-Header = "{ssha512}%{hex:%{sha2_512:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
 }
 
 pap.authorize
@@ -32,30 +27,20 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
-
 #
 #  Base64 encoded SSHA2-512 password
 #
-update {
-       &control.Tmp-String-1 := "%{hex:%{sha2_512:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
+&control := {
+       &Tmp-String-1 = "%{hex:%{sha2_512:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
 }
 
 # To Binary
-update {
-       &control.Tmp-Octets-0 := "%{bin:%{control.Tmp-String-1}}"
-}
+&control.Tmp-Octets-0 := "%{bin:%{control.Tmp-String-1}}"
 
 # To Base64
-update {
-       &control.Tmp-String-1 := "%{base64:%{control.Tmp-Octets-0}}"
-}
+&control.Tmp-String-1 := "%{base64:%{control.Tmp-Octets-0}}"
 
-update {
-       &control.Password.With-Header += "{ssha512}%{control.Tmp-String-1}"
-}
+&control.Password.With-Header += "{ssha512}%{control.Tmp-String-1}"
 
 pap.authorize
 pap.authenticate {
@@ -65,30 +50,21 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
 
 #
 #  Base64 of Base64 encoded SSHA2-512 password
 #
-update {
-       &control.Tmp-String-1 := "%{hex:%{sha2_512:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
+&control := {
+       &Tmp-String-1 = "%{hex:%{sha2_512:%{User-Password}%{Tmp-String-0}}}%{hex:%{Tmp-String-0}}"
 }
 
 # To Binary
-update {
-       &control.Tmp-Octets-0 := "%{bin:%{control.Tmp-String-1}}"
-}
+&control.Tmp-Octets-0 := "%{bin:%{control.Tmp-String-1}}"
 
 # To Base64
-update {
-       &control.Tmp-String-1 := "{ssha512}%{base64:%{control.Tmp-Octets-0}}"
-}
+&control.Tmp-String-1 := "{ssha512}%{base64:%{control.Tmp-Octets-0}}"
 
-update {
-       &control.Password.With-Header += "%{base64:%{control.Tmp-String-1}}"
-}
+&control.Password.With-Header += "%{base64:%{control.Tmp-String-1}}"
 
 pap.authorize
 pap.authenticate {
@@ -98,15 +74,11 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
-
 #
 #  Base64 of SHA2-384 password (in SHA2-Password)
 #
-update control {
-       &control.Password.SHA2 := "%{hex:%{sha2_384:%{User-Password}}}"
+&control := {
+       &Password.SHA2 = "%{hex:%{sha2_384:%{User-Password}}}"
 }
 
 pap.authorize
@@ -117,19 +89,11 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
-
-update control {
-       &Auth-Type := Accept
-}
-
 #
 #  Base64 of SHA2-256 password (in SHA2-256-Password)
 #
-update control {
-       &control.Password.SHA2-256 := "%{hex:%{sha2_256:%{User-Password}}}"
+&control := {
+       &Password.SHA2-256 = "%{hex:%{sha2_256:%{User-Password}}}"
 }
 
 pap.authorize
@@ -140,15 +104,11 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
-
 #
 #  Base64 of SHA2-224 password (in SHA2-224-Password - No hex armour)
 #
-update control {
-       &control.Password.SHA2-224 := "%{sha2_224:%{User-Password}}"
+&control := {
+       &Password.SHA2-224 = "%{sha2_224:%{User-Password}}"
 }
 
 pap.authorize
@@ -159,13 +119,8 @@ if (reject) {
        test_fail
 }
 
-update {
-       &control !* ANY
-}
-
-
-update control {
-       &Auth-Type := Accept
+&control := {
+       &Auth-Type = Accept
 }
 
 success
index d890eb9e09f3daff153a2f6fd378c579bc4b4080..e1e5f81ee1fb879f03cf9dce3315493c8f309653 100644 (file)
@@ -26,7 +26,7 @@ if (!fail) {
 group {
        parallel {
                fail
-               update request {        # This should *NOT* be dispatched
+               group { # This should *NOT* be dispatched
                        &Tmp-String-0 := 'foo'
                }
        }
@@ -50,8 +50,8 @@ group {
                fail {
                        fail = 10       # Higher priority than ok and no longer action return
                }
-               update parent.request { # This should now be dispatched
-                       &Tmp-String-0 := 'foo'
+               group { # This should now be dispatched
+                       &parent.request.Tmp-String-0 := 'foo'
                }
        }
        actions {
index cc23e089262c18d7c2b0892374dca0ca9f12c79c..2425cb10f6509a44d2f95509fd3d678371c1da4e 100644 (file)
@@ -5,8 +5,8 @@
 # Ensure if one module yields, the rest execute
 parallel {
        reschedule
-       update parent.request {
-               &Tmp-String-0 := 'foo'
+       group {
+               &parent.request.Tmp-String-0 := 'foo'
        }
 }
 
index eb6f65b21c33e0d9d2592ea2fe894b54b1d2dcb7..ef3070c2fafbb7e2acb53ad650f0322309569c0f 100644 (file)
@@ -1,32 +1,25 @@
-
-update request {
-        &Tmp-String-0           := "%{rand:-1}"
-}
+&Tmp-String-0 := "%{rand:-1}"
 
 #
-#  Negative limit should have failed
+#  Negative limit should have failed assignment
 #
-if (&Tmp-String-0 != '') {
+if (&Tmp-String-0) {
        test_fail
 }
 
-update request {
-        &Tmp-String-0           := "%{rand:hello world}"
-}
+&Tmp-String-0 := "%{rand:hello world}"
 
 #
-#  Invalid limit should have failed
+#  Invalid limit should have failed assignment
 #
-if (&Tmp-String-0 != '') {
+if (&Tmp-String-0) {
        test_fail
 }
 
-update request {
-        &Tmp-Integer-0           := "%{rand:123}"
-}
+&Tmp-Integer-0 := "%{rand:123}"
 
 #
-#  Make sure random number is whithin limit
+#  Make sure random number is within limit
 #
 if (&Tmp-Integer-0 < 0 || &Tmp-Integer-0 > 123) {
        test_fail
index 090bb15d819506e425ce6f2d7403dafbaca0610e..fe75538c886e4be58bdedb2d81de3b5bcc7c1e2a 100644 (file)
@@ -1,13 +1,18 @@
-
-update request {
-        &Tmp-String-0           := "%{randstr:%{Tmp-String-0}}"
-        &Tmp-String-1           := "%{randstr:nnn}"
-        &Tmp-String-2           := "%{randstr:24a}"
-        &Tmp-String-3           := "%{randstr:1030aa}"
-        &Tmp-String-4           := "%{randstr:G}"
-        &Tmp-String-5           := "%{randstr:10b}"
+&request += {
+       &Tmp-String-1 = "%{randstr:nnn}"
+       &Tmp-String-2 = "%{randstr:24a}"
+       &Tmp-String-3 = "%{randstr:1030aa}"
+       &Tmp-String-5 = "%{randstr:10b}"
 }
 
+#
+#  These next two assignments fail, so they can't go
+#  into the above list.  If they were there, then the
+#  entire list assignment would fail.
+#
+&Tmp-String-0 := "%{randstr:%{Tmp-String-0}}"
+&Tmp-String-4 := "%{randstr:G}"
+
 #
 #  Empty output on empty input
 #
@@ -35,7 +40,7 @@ if ("%{strlen:%{Tmp-String-3}}" != 1025) {
 #
 #  Check invalid character class
 #
-if (&Tmp-String-4 != "") {
+if (&Tmp-String-4) {
        test_fail
 }
 
index e338e72987078ce0e965bcec2b9642f192a49a7b..f858ad9a858c7ab511f87918c6949b55e7b89609 100644 (file)
@@ -1,21 +1,21 @@
-# PRE: update if foreach
+# PRE: if foreach
 #
 #  Redundant blocks.
 #
 #  The first one fails, so the second one is used
 #
-update request {
-       &Tmp-Integer-0 := 0
-       &Tmp-Integer-1 += 0
-       &Tmp-Integer-1 += 1
-       &Tmp-Integer-1 += 2
-       &Tmp-Integer-1 += 3
-       &Tmp-Integer-1 += 4
-       &Tmp-Integer-1 += 5
-       &Tmp-Integer-1 += 6
-       &Tmp-Integer-1 += 7
-       &Tmp-Integer-1 += 8
-       &Tmp-Integer-1 += 9
+&request += {
+       &Tmp-Integer-0 = 0
+       &Tmp-Integer-1 = 0
+       &Tmp-Integer-1 = 1
+       &Tmp-Integer-1 = 2
+       &Tmp-Integer-1 = 3
+       &Tmp-Integer-1 = 4
+       &Tmp-Integer-1 = 5
+       &Tmp-Integer-1 = 6
+       &Tmp-Integer-1 = 7
+       &Tmp-Integer-1 = 8
+       &Tmp-Integer-1 = 9
 }
 
 redundant {
@@ -43,9 +43,9 @@ foreach &Tmp-Integer-1 {
                                fail
                        }
                        else {
-                               update request {
-                                       &Tmp-Integer-0 := "%{expr:%{Tmp-Integer-0} + 1}"
-                                       &Filter-Id += "SUCCEED ODD %{Foreach-Variable-0} %{Tmp-Integer-0}"
+                               &Tmp-Integer-0 += 1
+                               &request += {
+                                       &Tmp-String-0 = "Succeed odd %{Foreach-Variable-0} %{Tmp-Integer-0}"
                                }
                                ok
                        }
@@ -56,9 +56,9 @@ foreach &Tmp-Integer-1 {
                                fail
                        }
                        else {
-                               update request {
-                                       &Tmp-Integer-0 := "%{expr:%{Tmp-Integer-0} + 1}"
-                                       &Filter-Id += "SUCCEED EVEN %{Foreach-Variable-0} %{Tmp-Integer-0}"
+                               &Tmp-Integer-0 += 1
+                               &request += {
+                                       &Tmp-String-0 = "Succeed even %{Foreach-Variable-0} %{Tmp-Integer-0}"
                                }
                                ok
                        }
@@ -69,6 +69,5 @@ foreach &Tmp-Integer-1 {
 if (&Tmp-Integer-0 != "%{Tmp-Integer-1[#]}") {
     test_fail
 }
-else {
-       success
-}
+
+success
index 74c6e18552b33cdc42826f9670225d61d180469e..35aa1f193994baa89af3645641ae1158e99a16bc 100644 (file)
@@ -1,21 +1,21 @@
-# PRE: update if foreach
+# PRE: if foreach
 #
 #  Redundant blocks.
 #
 #  The first one fails, so the second one is used
 #
-update request {
-       &Tmp-Integer-0 := 0
-       &Tmp-Integer-1 += 0
-       &Tmp-Integer-1 += 1
-       &Tmp-Integer-1 += 2
-       &Tmp-Integer-1 += 3
-       &Tmp-Integer-1 += 4
-       &Tmp-Integer-1 += 5
-       &Tmp-Integer-1 += 6
-       &Tmp-Integer-1 += 7
-       &Tmp-Integer-1 += 8
-       &Tmp-Integer-1 += 9
+&request += {
+       &Tmp-Integer-0 = 0
+       &Tmp-Integer-1 = 0
+       &Tmp-Integer-1 = 1
+       &Tmp-Integer-1 = 2
+       &Tmp-Integer-1 = 3
+       &Tmp-Integer-1 = 4
+       &Tmp-Integer-1 = 5
+       &Tmp-Integer-1 = 6
+       &Tmp-Integer-1 = 7
+       &Tmp-Integer-1 = 8
+       &Tmp-Integer-1 = 9
 }
 
 #
@@ -29,9 +29,9 @@ foreach &Tmp-Integer-1 {
                                fail
                        }
                        else {
-                               update request {
-                                       &Tmp-Integer-0 := "%{expr:%{Tmp-Integer-0} + 1}"
-                                       &Filter-Id += "SUCCEED ODD %{Foreach-Variable-0} %{Tmp-Integer-0}"
+                               &Tmp-Integer-0 += 1
+                               &request += {
+                                       &Tmp-String-0 = "Succeed odd %{Foreach-Variable-0} %{Tmp-Integer-0}"
                                }
                                ok
                        }
@@ -42,9 +42,9 @@ foreach &Tmp-Integer-1 {
                                fail
                        }
                        else {
-                               update request {
-                                       &Tmp-Integer-0 := "%{expr:%{Tmp-Integer-0} + 1}"
-                                       &Filter-Id += "SUCCEED EVEN %{Foreach-Variable-0} %{Tmp-Integer-0}"
+                               &Tmp-Integer-0 += 1
+                               &request += {
+                                       &Tmp-String-0 = "Succeed even %{Foreach-Variable-0} %{Tmp-Integer-0}"
                                }
                                ok
                        }
@@ -53,11 +53,7 @@ foreach &Tmp-Integer-1 {
 }
 
 if (&Tmp-Integer-0 != "%{Tmp-Integer-1[#]}") {
-   update reply {
-         &Filter-Id := "shit %{Tmp-Integer-0}"
-   }
        test_fail
 }
-else {
-       success
-}
+
+success
index 66c038f2bd53dd992bbd864935df08b85a397036..01f51c511d272b1535fb68918b1a36dbe3e27f2e 100644 (file)
@@ -1,55 +1,48 @@
-# PRE: update if foreach redundant redundant-load-balance
+# PRE: redundant redundant-load-balance
 #
 #  Nested redundant blocks.
 #
 #
-update request {
-       &Tmp-Integer-2 := 0
-       &Tmp-Integer-3 := 0
-       &Tmp-Integer-4 := 0
-       &Tmp-Integer-5 := 0
+&request += {
+       &Tmp-Integer-2 = 0
+       &Tmp-Integer-3 = 0
+       &Tmp-Integer-4 = 0
+       &Tmp-Integer-5 = 0
 }
 
 redundant {
        redundant-load-balance {
                group {
-                       update request {
-                               &Tmp-Integer-2 := "%{expr:&Tmp-Integer-2 + 1}"
-                       }
+                       &Tmp-Integer-2 += 1
                        fail
                }
                group {
-                       update request {
-                               &Tmp-Integer-3 := "%{expr:&Tmp-Integer-3 + 1}"
-                       }
+                       &Tmp-Integer-3 += 1
                        fail
                }
                group {
-                       update request {
-                               &Tmp-Integer-4 := "%{expr:&Tmp-Integer-4 + 1}"
-                       }
+                       &Tmp-Integer-4 += 1
                        fail
                }
                group {
-                       update request {
-                               &Tmp-Integer-5 := "%{expr:&Tmp-Integer-5 + 1}"
-                       }
+                       &Tmp-Integer-5 += 1
                        fail
                }
        }
+
+       #
+       #  All of the above fails, so we fail over to "ok".
+       #
        ok
 }
 
 if (!ok) {
-       update reply {
-               &Filter-Id := "did not return OK"
-       }
+       test_fail
        return
 }
 
 if (&Tmp-Integer-2 != 1) {
        test_fail
-       return
 }
 
 if (&Tmp-Integer-3 != 1) {
index 9100edacf4935175b028164fc2f7f33022a825df..ce9f1b72a76e145a4853948b526b594c740536de 100644 (file)
@@ -1,14 +1,14 @@
 #
-#  PRE: update if
+#  PRE: if
 #
 
 #
 #  Strings which are expanded in a regex have regex special
 #  characters escaped.  Because the input strings are unsafe.
 #
-update request {
-       &Tmp-String-0 := "%{taint:example.com}"
-       &Tmp-String-1 := "%{taint:exampleXcom}"
+&request += {
+       &Tmp-String-0 = "%{taint:example.com}"
+       &Tmp-String-1 = "%{taint:exampleXcom}"
 }
 
 if ("exampleXcom" =~ /%{Tmp-String-0}/) {
@@ -18,6 +18,5 @@ if ("exampleXcom" =~ /%{Tmp-String-0}/) {
 elsif (&Tmp-String-1 =~ /%{Tmp-String-0}/) {
        test_fail
 }
-else {
-       success
-}
+
+success
index 7e32e21f4e2ebdee4becedccbb0f0752d940fe1c..d5266a9079f357e4abc2e918f3107b70740a26c4 100644 (file)
@@ -1,14 +1,14 @@
 #
-#  PRE: update if regex-escape
+#  PRE: if regex-escape
 #
 
 #
 #  Strings which are expanded in a regex have regex special
 #  characters escaped.  Because the input strings are unsafe.
 #
-update request {
-       &Tmp-String-0 := "example.com"
-       &Tmp-String-1 := "^foo$bar"
+&request += {
+       &Tmp-String-0 = "example.com"
+       &Tmp-String-1 = "^foo$bar"
 }
 
 if (&Tmp-String-0 !~ /example\.com$/) {
@@ -16,6 +16,6 @@ if (&Tmp-String-0 !~ /example\.com$/) {
 }
 elsif (&Tmp-String-1 !~ /\^foo\$bar/) {
        test_fail
-} else {
-       success
 }
+
+success
index be7e8afa1b14843d078508c9ea3c3da7c4e503d5..5df9fcdf2e3e65abaee2e4ff8cc66cbb50455c95 100644 (file)
@@ -1,13 +1,9 @@
-# PRE: update if
+# PRE: if
 
-update request {
-       &Tmp-Integer-0 := 0
-}
+&Tmp-Integer-0 := 0
 
 group {
-       update request {
-               &Tmp-Integer-0 := "%{expr: &Tmp-Integer-0 + 1}"
-       }
+       &Tmp-Integer-0 += 1
 
        noop
        actions {
index b3c884db8da418463fed99d594113b595f25354d..a79b8545a17d4dc170543d2b7140dbf0a2c8ad74 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  PRE: update if
+#  PRE: if
 #
 if (&User-Name == "bob") {
        success
@@ -9,9 +9,7 @@ if (&User-Name == "bob") {
        #  will prevent the "pap" module from being run
        #  in the "authorize" section.
        #
-       update control {
-               &Auth-Type := PAP
-       }
+       &control.Auth-Type := PAP
 
        #
        #  Stop processing "authorize", and go to the next section.
index f0e809d49d56384fb3078f3884badc3b6b47ad6e..877edcfc87659f19fa38ceb37b4b058a847b8a4d 100644 (file)
@@ -1,11 +1,11 @@
 #
-#  PRE: update if return foreach
+#  PRE: if return foreach
 #
-update control {
-       &Tmp-Integer-0 += 0
-       &Tmp-Integer-0 += 1
-       &Tmp-Integer-0 += 2
-       &Tmp-Integer-0 += 3
+&control += {
+       &Tmp-Integer-0 = 0
+       &Tmp-Integer-0 = 1
+       &Tmp-Integer-0 = 2
+       &Tmp-Integer-0 = 3
 }
 
 foreach &control.Tmp-Integer-0 {
@@ -16,8 +16,8 @@ foreach &control.Tmp-Integer-0 {
                break
        }
 
-       update control {
-               &Tmp-Integer-0 -= "%{Foreach-Variable-0}"
+       &control -= {
+               &Tmp-Integer-0 == "%{Foreach-Variable-0}"
        }
 }
 
index b3254b9b73f300e36cfb9eae9b4149e007b7d12a..0813cdf4219eaf33d447d7bb9b42cf07cd4622be 100644 (file)
@@ -1,9 +1,7 @@
 #
-#  PRE: update if return
+#  PRE: return
 #
-update {
-       &control.Auth-Type = 'Accept'
-}
+&control.Auth-Type := 'Accept'
 
 group {
        # Section should exit after this statement
@@ -12,12 +10,8 @@ group {
        }
 
        # This entry should never be reached
-       update {
-               &reply.Reply-Message := 'fail'
-       }
+       &reply.Reply-Message := 'fail'
 }
 
 # We should continue processing after the previous group.
-update {
-       &reply.Reply-Message += 'pass'
-}
+&reply.Reply-Message := 'pass'
index 2f152589a98e96b9d8f19af60d87be52a2424a38..ee59647328a835b95f5493ce281a83cd2dcce7d9 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  PRE: update if return
+#  PRE: if return
 #
 if (&User-Name == "bob") {
        ok
@@ -9,9 +9,7 @@ if (&User-Name == "bob") {
        #  will prevent the "pap" module from being run
        #  in the "authorize" section.
        #
-       update control {
-               &Auth-Type := PAP
-       }
+       &control.Auth-Type := PAP
 
        #
        #  Stop processing "authorize", and go to the next section.
index 5d16635fe2911e39ab70fa0922191b9ef8cebc6e..97703b95ba944e9ad13d516085f901d8699f953c 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  PRE: update if
+#  PRE: if
 #
 if (&User-Name == 'bob') {
        accept
index 1fe227a0fcda6a4ffae9519cacb517941cdc2ee0..d211c63fc95de666230a0713fdad93d5a2f0b679 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  PRE: update if return
+#  PRE: if return
 #
 if ("no" == no) {
        accept
index e3f598792bbeebed2ea6b348d035995a8966bc7c..3c2abb418fd7d87fc460b8329c38754555d119e7 100644 (file)
@@ -1,11 +1,11 @@
 #
-#  PRE: update if return foreach
+#  PRE: if return foreach
 #
-update control {
-       &Tmp-Integer-0 += 0
-       &Tmp-Integer-0 += 1
-       &Tmp-Integer-0 += 2
-       &Tmp-Integer-0 += 3
+&control += {
+       &Tmp-Integer-0 = 0
+       &Tmp-Integer-0 = 1
+       &Tmp-Integer-0 = 2
+       &Tmp-Integer-0 = 3
 }
 
 group {
index 38cc0707e0363f608fc7f158f622a856dcfacbb9..b7015b16ae4c4159d9043f6578e6cd06f29407c8 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  PRE: update if return
+#  PRE: if return
 #
 
 # Defeats return check...
index 80c8ab68b3ecce313c6ee8eda989982b70a37899..ac4e9e74676ce33aa1b74b8895f675a09bdba232 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  PRE: update if return
+#  PRE: if return
 #
 group {
        # Return must stop after the policy, otherwise we don't setup the test for success