]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
More "update {....}" to edit against src/tests/modules/* (#4735)
authorJorge Pereira <jpereira@users.noreply.github.com>
Mon, 3 Oct 2022 13:04:32 +0000 (15:04 +0200)
committerGitHub <noreply@github.com>
Mon, 3 Oct 2022 13:04:32 +0000 (09:04 -0400)
110 files changed:
src/tests/modules/always/set_rcode.unlang
src/tests/modules/always/set_status_dead.unlang
src/tests/modules/always/set_status_revive.unlang
src/tests/modules/attr_filter/bob.unlang
src/tests/modules/attr_filter/operators.unlang
src/tests/modules/cache_rbtree/cache-bin.unlang
src/tests/modules/cache_rbtree/cache-logic.unlang
src/tests/modules/cache_rbtree/cache-method-bin.unlang
src/tests/modules/cache_rbtree/cache-method-logic.unlang
src/tests/modules/cache_rbtree/cache-method-update.unlang
src/tests/modules/cache_rbtree/cache-update.unlang
src/tests/modules/cache_rbtree/module.conf
src/tests/modules/cache_redis/module.conf
src/tests/modules/chap/chap_password.unlang
src/tests/modules/cipher/fingerprint.unlang
src/tests/modules/cipher/rsa_encrypt_decrypt.unlang
src/tests/modules/cipher/rsa_sign_verify.unlang
src/tests/modules/cipher/serial.unlang
src/tests/modules/cipher/valid.unlang
src/tests/modules/client/xlat.unlang
src/tests/modules/dict/map.unlang
src/tests/modules/eap_sim/sim_xlat_id_aka.unlang
src/tests/modules/eap_sim/sim_xlat_id_aka_decrypt_no_tag.unlang
src/tests/modules/eap_sim/sim_xlat_id_error.unlang
src/tests/modules/eap_sim/sim_xlat_id_sim.unlang
src/tests/modules/exec/async.unlang
src/tests/modules/exec/backticks_list.unlang
src/tests/modules/exec/sync.unlang
src/tests/modules/files/authorize
src/tests/modules/files/prefix.unlang
src/tests/modules/files/subnet2.unlang
src/tests/modules/icmp/ping.unlang
src/tests/modules/idn/idn.unlang
src/tests/modules/imap/auth_bad_pw.unlang
src/tests/modules/imap/auth_bad_usr.unlang
src/tests/modules/imap/auth_plaintext.unlang
src/tests/modules/imap/imap_bad_tls/auth_bad_tls.unlang
src/tests/modules/imap/imap_opt_tls/auth_try_tls.unlang
src/tests/modules/imap/imap_tls/auth_tls.unlang
src/tests/modules/json/encode.unlang
src/tests/modules/json/encode_error.unlang
src/tests/modules/json/eval.unlang
src/tests/modules/json/quote.unlang
src/tests/modules/ldap/acct.unlang
src/tests/modules/ldap/auth.unlang
src/tests/modules/ldap/auth_ssl.unlang
src/tests/modules/ldap/auth_starttls.unlang
src/tests/modules/ldap/map.unlang
src/tests/modules/ldap/xlat.unlang
src/tests/modules/linelog/linelog-delim.unlang
src/tests/modules/linelog/linelog-escapes.unlang
src/tests/modules/linelog/linelog-multi.unlang
src/tests/modules/linelog/linelog.unlang
src/tests/modules/lua/mod2.lua
src/tests/modules/lua/mod3.lua
src/tests/modules/lua/mod4.lua
src/tests/modules/lua/mod8.lua
src/tests/modules/pap/bin_random.unlang
src/tests/modules/pap/pbkfd2_dig_big.unlang
src/tests/modules/pap/pbkfd2_dig_small.unlang
src/tests/modules/pap/pbkfd2_iter0.unlang
src/tests/modules/pap/pbkfd2_iter1.unlang
src/tests/modules/pap/pbkfd2_iter1000.unlang
src/tests/modules/pap/pbkfd2_iter100000.unlang
src/tests/modules/pap/pbkfd2_iter_big.unlang
src/tests/modules/pap/pbkfd2_iter_miss.unlang
src/tests/modules/pap/pbkfd2_iter_small.unlang
src/tests/modules/pap/pbkfd2_passlib.unlang
src/tests/modules/pap/pbkfd2_salt0.unlang
src/tests/modules/pap/pbkfd2_salt1.unlang
src/tests/modules/pap/pbkfd2_salt1024.unlang
src/tests/modules/pap/pbkfd2_salt64.unlang
src/tests/modules/pap/pbkfd2_salt_big.unlang
src/tests/modules/pap/pbkfd2_salt_small.unlang
src/tests/modules/pap/pbkfd2_sha1.unlang
src/tests/modules/pap/pbkfd2_sha2_224.unlang
src/tests/modules/pap/pbkfd2_sha2_256.unlang
src/tests/modules/pap/pbkfd2_sha2_384.unlang
src/tests/modules/pap/pbkfd2_sha2_512.unlang
src/tests/modules/pap/plaintext_with_dollar_0.unlang
src/tests/modules/pap/plaintext_with_dollar_1.unlang
src/tests/modules/pap/plaintext_with_dollar_2.unlang
src/tests/modules/pap/plaintext_with_dollar_3.unlang
src/tests/modules/perl/auth.unlang
src/tests/modules/perl/xlat.unlang
src/tests/modules/redis/cluster_key.unlang
src/tests/modules/redis/cluster_node_fail.unlang
src/tests/modules/redis/cluster_reset.inc
src/tests/modules/redis_ippool/alloc.unlang
src/tests/modules/redis_ippool/pool_tool_delete.unlang
src/tests/modules/redis_ippool/pool_tool_modify.unlang
src/tests/modules/redis_ippool/pool_tool_release.unlang
src/tests/modules/redis_ippool/release.unlang
src/tests/modules/redis_ippool/update.unlang
src/tests/modules/redis_ippool/update_alloc.unlang
src/tests/modules/rest/rest_module.unlang
src/tests/modules/rest/rest_xlat.unlang
src/tests/modules/smtp/smtp_attachment/tls_attachment.unlang
src/tests/modules/smtp/smtp_authenticate/tls_authenticate.unlang
src/tests/modules/smtp/smtp_crln/tls_crln.unlang
src/tests/modules/smtp/smtp_stringparse/tls_stringparse.unlang
src/tests/modules/smtp/tls_delivery.unlang
src/tests/modules/sql/acct_start_conflict.unlang
src/tests/modules/sql/groups.unlang
src/tests/modules/sql/map.unlang
src/tests/modules/test/dollar_expansions.unlang
src/tests/modules/test/policy.conf
src/tests/modules/unbound/dns.unlang
src/tests/modules/unit_test_module.conf
src/tests/modules/yubikey/yubikey_xlat.unlang

index 8c5818dc99327e084656855a7381178db0d9a299..977157727d98a68a8fb70747f518b4ac2879e7ad 100644 (file)
@@ -2,19 +2,18 @@
 #  Set status to "notfound". xlat should expand to previous status, "alive"
 #
 if ("%(db_status:notfound)" != "alive") {
-       update reply {
-               &Reply-Message += "failed"
+       &reply += {
+               &Reply-Message = "Failure in test at line %(interpreter:...line)"
        }
 }
 
-
 #
 #  Verify that the status was changed
 #
 db_status
 if (!notfound) {
-       update reply {
-               &Reply-Message += "failed"
+       &reply += {
+               &Reply-Message = "Failure in test at line %(interpreter:...line)"
        }
 }
 
@@ -23,8 +22,8 @@ if (!notfound) {
 #  Fetch status using xlat without setting the status
 #
 if ("%(db_status:)" != "notfound") {
-       update reply {
-               &Reply-Message += "failed"
+       &reply += {
+               &Reply-Message = "Failure in test at line %(interpreter:...line)"
        }
 }
 
@@ -34,11 +33,9 @@ if ("%(db_status:)" != "notfound") {
 #
 db_status
 if (notfound) {
-       update reply {
-               &Reply-Message += "success"
+       &reply += {
+               &Reply-Message = "success"
        }
 }
 
-update control {
-       &Password.Cleartext := "hello"
-}
+&control.Password.Cleartext := "hello"
index 6f70e50356135691cd5095401e95072ee313ddc6..99dbd5f450dd53c18adf1485f53d6f32f9073748 100644 (file)
@@ -8,11 +8,7 @@ db_status {
 }
 
 if (fail) {
-       update reply {
-               &Reply-Message := "success"
-       }
+       &reply.Reply-Message := "success"
 }
 
-update control {
-       &Password.Cleartext := "hello"
-}
+&control.Password.Cleartext := "hello"
index 1d19542ebf4ae70e32e55de4c3de66d92ff81295..03af845236fdb67aeb152fdfd994a398e757f000 100644 (file)
@@ -6,8 +6,8 @@ db_status {
        fail = 1
 }
 if (!fail) {
-       update reply {
-               &Reply-Message += "failed"
+       &reply += {
+               &Reply-Message = "Failure in test at line %(interpreter:...line)"
        }
 }
 
@@ -18,11 +18,9 @@ if (!fail) {
 %(db_status:alive)
 db_status
 if (ok) {
-       update reply {
-               &Reply-Message += "success"
+       &reply += {
+               &Reply-Message = "success"
        }
 }
 
-update control {
-       &Password.Cleartext := "hello"
-}
+&control.Password.Cleartext := "hello"
index c092c8d2af9c67ec385a290807268ed21bcdf7d4..f4c4728caf86162c5893dfe39c3551abfc048c50 100644 (file)
@@ -1,9 +1,7 @@
 attr_filter
 
-update control {
-       &Password.Cleartext := "goodbye"
-}
+&control.Password.Cleartext := "goodbye"
 
-update reply {
-        &Reply-Message := "success"
+&reply += {
+        &Reply-Message = "success"
 }
index cd636c0093d08988dae928408f8131e9e01bf077..80176ca5334c96c79f4c78f2622e21e33e8926cc 100644 (file)
@@ -24,10 +24,5 @@ if ((&Calling-Station-Id != "bob") || (&Calling-Station-Id[1] != "jim") || (&Cal
         test_fail
 }
 
-update control {
-       &Password.Cleartext := "goodbye"
-}
-
-update reply {
-        &Reply-Message := &request.Reply-Message
-}
+&control.Password.Cleartext := "goodbye"
+&reply.Reply-Message := &Reply-Message
index 1d7a64fa8331d030dd4559e50593ca113bb3500b..889531f07ac8e8df1dc08e928a86f0de45dc9217 100644 (file)
@@ -6,10 +6,8 @@
 #  Series of tests to check for binary safe operation of the cache module
 #  both keys and values should be binary safe.
 #
-update {
-       &Tmp-Octets-0 := 0xaa00bb00cc00dd00
-       &Tmp-String-1 := "foo\000bar\000baz"
-}
+&Tmp-Octets-0 := 0xaa00bb00cc00dd00
+&Tmp-String-1 := "foo\000bar\000baz"
 
 # 0. Sanity check
 if (&Tmp-String-1 != "foo\000bar\000baz") {
@@ -23,10 +21,8 @@ if (!updated) {
 }
 
 # Now add a second entry, with the value diverging after the first null byte
-update {
-       &Tmp-Octets-0 := 0xaa00bb00cc00ee00
-       &Tmp-String-1 := "bar\000baz"
-}
+&Tmp-Octets-0 := 0xaa00bb00cc00ee00
+&Tmp-String-1 := "bar\000baz"
 
 # 2. Should create a *new* entry and not update the existing one
 cache_bin_key_octets.store
@@ -34,15 +30,11 @@ if (!updated) {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # If the key is binary safe, we should now be able to retrieve the first entry
 # if it's not, the above test will likely fail, or we'll get the second entry.
-update {
-       &Tmp-Octets-0 := 0xaa00bb00cc00dd00
-}
+&Tmp-Octets-0 := 0xaa00bb00cc00dd00
 
 cache_bin_key_octets
 if (!updated) {
@@ -57,14 +49,10 @@ if (&Tmp-String-1 != "foo\000bar\000baz") {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # Now try and get the second entry
-update {
-       &Tmp-Octets-0 := 0xaa00bb00cc00ee00
-}
+&Tmp-Octets-0 := 0xaa00bb00cc00ee00
 
 cache_bin_key_octets
 if (!updated) {
@@ -79,45 +67,33 @@ if (&Tmp-String-1 != "bar\000baz") {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
-
+&request -= &Tmp-String-1[*]
 
 #
 #  We should also be able to use any fixed length data type as a key
 #  though there are no guarantees this will be portable.
 #
-update {
-       &Tmp-IP-Address-0 := 192.168.0.1
-       &Tmp-String-1 := "foo\000bar\000baz"
-}
+&Tmp-IP-Address-0 := 192.168.0.1
+&Tmp-String-1 := "foo\000bar\000baz"
 
 cache_bin_key_ipaddr
 if (!ok) {
        test_fail
 }
 
-
 # Now add a second entry
-update {
-       &Tmp-IP-Address-0:= 192.168.0.2
-       &Tmp-String-1 := "bar\000baz"
-}
+&Tmp-IP-Address-0:= 192.168.0.2
+&Tmp-String-1 := "bar\000baz"
 
 cache_bin_key_ipaddr
 if (!ok) {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # Now retrieve the first entry
-update {
-       &Tmp-IP-Address-0 := 192.168.0.1
-}
+&Tmp-IP-Address-0 := 192.168.0.1
 
 cache_bin_key_ipaddr
 if (!updated) {
@@ -132,14 +108,10 @@ if (&Tmp-String-1 != "foo\000bar\000baz") {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # Now try and get the second entry
-update {
-       &Tmp-IP-Address-0 := 192.168.0.2
-}
+&Tmp-IP-Address-0 := 192.168.0.2
 
 cache_bin_key_ipaddr
 if (!updated) {
@@ -154,8 +126,6 @@ if (&Tmp-String-1 != "bar\000baz") {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 test_pass
index 49aa41724c07244c84db10b137651e3c80c3c2ba..25a6f6b0e47469c47ca681635f1a81b2ed81108d 100644 (file)
@@ -1,17 +1,12 @@
 #
 #  PRE:
 #
-update {
-       &request.Tmp-String-0 := 'testkey'
-}
-
+&Tmp-String-0 := 'testkey'
 
 #
 # 0.  Basic store and retrieve
 #
-update control {
-       &control.Tmp-String-1 := 'cache me'
-}
+&control.Tmp-String-1 := 'cache me'
 
 cache
 if (!ok) {
@@ -19,14 +14,13 @@ if (!ok) {
 }
 
 # 1. Check the module didn't perform a merge
-if (&request.Tmp-String-1) {
+if (&Tmp-String-1) {
        test_fail
 }
 
 # 2. Check status-only works correctly (should return ok and consume attribute)
-update control {
-       &Cache-Status-Only := 'yes'
-}
+&control.Cache-Status-Only := 'yes'
+
 cache
 if (!ok) {
        test_fail
@@ -44,14 +38,12 @@ if (!updated) {
 }
 
 # 5.
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 
 # 6. Retrieving the entry should not expire it
-update request {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 cache
 if (!updated) {
@@ -59,7 +51,7 @@ if (!updated) {
 }
 
 # 7.
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 else {
@@ -67,20 +59,18 @@ else {
 }
 
 # 8. Force expiry of the entry
-update control {
-       &Cache-Allow-Merge := no
-       &Cache-Allow-Insert := no
-       &Cache-TTL := 0
-}
+&control.Cache-Allow-Merge := no
+&control.Cache-Allow-Insert := no
+&control.Cache-TTL := 0
+
 cache
 if (!ok) {
        test_fail
 }
 
 # 9. Check status-only works correctly (should return notfound and consume attribute)
-update control {
-       &Cache-Status-Only := 'yes'
-}
+&control.Cache-Status-Only := 'yes'
+
 cache
 if (!notfound) {
        test_fail
@@ -92,10 +82,9 @@ if (&control.Cache-Status-Only) {
 }
 
 # 11. Check merge-only works correctly (should return notfound and consume attribute)
-update control {
-       &Cache-Allow-Merge := 'yes'
-       &Cache-Allow-Insert := 'no'
-}
+&control.Cache-Allow-Merge := 'yes'
+&control.Cache-Allow-Insert := 'no'
+
 cache
 if (!notfound) {
        test_fail
@@ -107,18 +96,16 @@ if (&control.Cache-Allow-Merge) {
 }
 
 # 13. ...and check the entry wasn't recreated
-update control {
-       &Cache-Status-Only := 'yes'
-}
+&control.Cache-Status-Only := 'yes'
+
 cache
 if (!notfound) {
        test_fail
 }
 
 # 14. This should still allow the creation of a new entry
-update control {
-       &Cache-TTL := -1
-}
+&control.Cache-TTL := -1
+
 cache
 if (!ok) {
        test_fail
@@ -131,44 +118,40 @@ if (!updated) {
 }
 
 # 16.
-if (&Cache-TTL) {
+if (&control.Cache-TTL) {
        test_fail
 }
 
 # 17.
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 
-update control {
-       &Tmp-String-1 := 'cache me2'
-}
+&control.Tmp-String-1 := 'cache me2'
 
 # 18. Updating the Cache-TTL shouldn't make things go boom (we can't really check if it works)
-update control {
-       &Cache-TTL := 30
-}
+&control.Cache-TTL := 30
+
 cache
 if (!updated) {
        test_fail
 }
 
 # 19. Request Tmp-String-1 shouldn't have been updated yet
-if (&request.Tmp-String-1 == &control.Tmp-String-1) {
+if (&Tmp-String-1 == &control.Tmp-String-1) {
        test_fail
 }
 
 # 20. Check that a new entry is created
-update control {
-       &Cache-TTL := -1
-}
+&control.Cache-TTL := -1
+
 cache
 if (!updated) {
        test_fail
 }
 
 # 21. Request Tmp-String-1 still shouldn't have been updated yet
-if (&request.Tmp-String-1 == &control.Tmp-String-1) {
+if (&Tmp-String-1 == &control.Tmp-String-1) {
        test_fail
 }
 
@@ -179,33 +162,32 @@ if (!updated) {
 }
 
 # 23. Request Tmp-String-1 should now have been updated
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 
 # 24. Check Cache-Merge = yes works as expected (should update current request)
-update control {
-       &Tmp-String-1 := 'cache me3'
-       &Cache-TTL := -1
-       &Cache-Merge-New := yes
-}
+&control.Tmp-String-1 := 'cache me3'
+&control.Cache-TTL := -1
+&control.Cache-Merge-New := yes
+
 cache
 if (!updated) {
        test_fail
 }
 
 # 25. Request Tmp-String-1 should now have been updated
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 
 # 26. Check Cache-Entry-Hits is updated as we expect
-if (&request.Cache-Entry-Hits != 0) {
+if (&Cache-Entry-Hits != 0) {
        test_fail
 }
 
 cache
-if (&request.Cache-Entry-Hits != 1) {
+if (&Cache-Entry-Hits != 1) {
        test_fail
 }
 
index 3ffc913ee661fea8782be1ff0a8bcf56ef10e95b..56e0600c4dd5a89686ccba277bb2438117580221 100644 (file)
@@ -6,10 +6,8 @@
 #  Series of tests to check for binary safe operation of the cache module
 #  both keys and values should be binary safe.
 #
-update {
-       &Tmp-Octets-0 := 0xaa00bb00cc00dd00
-       &Tmp-String-1 := "foo\000bar\000baz"
-}
+&Tmp-Octets-0 := 0xaa00bb00cc00dd00
+&Tmp-String-1 := "foo\000bar\000baz"
 
 # 0. Sanity check
 if (&Tmp-String-1 != "foo\000bar\000baz") {
@@ -23,10 +21,8 @@ if (!updated) {
 }
 
 # Now add a second entry, with the value diverging after the first null byte
-update {
-       &Tmp-Octets-0 := 0xaa00bb00cc00ee00
-       &Tmp-String-1 := "bar\000baz"
-}
+&Tmp-Octets-0 := 0xaa00bb00cc00ee00
+&Tmp-String-1 := "bar\000baz"
 
 # 2. Should create a *new* entry and not update the existing one
 cache_bin_key_octets.store
@@ -34,15 +30,11 @@ if (!updated) {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # If the key is binary safe, we should now be able to retrieve the first entry
 # if it's not, the above test will likely fail, or we'll get the second entry.
-update {
-       &Tmp-Octets-0 := 0xaa00bb00cc00dd00
-}
+&Tmp-Octets-0 := 0xaa00bb00cc00dd00
 
 cache_bin_key_octets.load
 if (!updated) {
@@ -57,14 +49,10 @@ if (&Tmp-String-1 != "foo\000bar\000baz") {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # Now try and get the second entry
-update {
-       &Tmp-Octets-0 := 0xaa00bb00cc00ee00
-}
+&Tmp-Octets-0 := 0xaa00bb00cc00ee00
 
 cache_bin_key_octets.load
 if (!updated) {
@@ -79,44 +67,33 @@ if (&Tmp-String-1 != "bar\000baz") {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 #
 #  We should also be able to use any fixed length data type as a key
 #  though there are no guarantees this will be portable.
 #
-update {
-       &Tmp-IP-Address-0 := 192.168.0.1
-       &Tmp-String-1 := "foo\000bar\000baz"
-}
+&Tmp-IP-Address-0 := 192.168.0.1
+&Tmp-String-1 := "foo\000bar\000baz"
 
 cache_bin_key_ipaddr.store
 if (!updated) {
        test_fail
 }
 
-
 # Now add a second entry
-update {
-       &Tmp-IP-Address-0:= 192.168.0.2
-       &Tmp-String-1 := "bar\000baz"
-}
+&Tmp-IP-Address-0:= 192.168.0.2
+&Tmp-String-1 := "bar\000baz"
 
 cache_bin_key_ipaddr.store
 if (!updated) {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # Now retrieve the first entry
-update {
-       &Tmp-IP-Address-0 := 192.168.0.1
-}
+&Tmp-IP-Address-0 := 192.168.0.1
 
 cache_bin_key_ipaddr.load
 if (!updated) {
@@ -131,14 +108,10 @@ if (&Tmp-String-1 != "foo\000bar\000baz") {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # Now try and get the second entry
-update {
-       &Tmp-IP-Address-0 := 192.168.0.2
-}
+&Tmp-IP-Address-0 := 192.168.0.2
 
 cache_bin_key_ipaddr.load
 if (!updated) {
@@ -153,8 +126,6 @@ if (&Tmp-String-1 != "bar\000baz") {
        test_fail
 }
 
-update {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 test_pass
index d95ff75fceeb12ffa5332186bbd9a833a8c4dc9f..91e8f9a0491bbc209165221e51e27a40a749853e 100644 (file)
@@ -1,16 +1,12 @@
 #
 #  PRE:
 #
-update {
-       &request.Tmp-String-0 := 'testkey'
-}
+&Tmp-String-0 := 'testkey'
 
 #
 # 0.  Basic store and retrieve
 #
-update control {
-       &control.Tmp-String-1 := 'cache me'
-}
+&control.Tmp-String-1 := 'cache me'
 
 cache.store
 if (!updated) {
@@ -18,7 +14,7 @@ if (!updated) {
 }
 
 # 1. Check the module didn't perform a merge
-if (&request.Tmp-String-1) {
+if (&Tmp-String-1) {
        test_fail
 }
 
@@ -35,14 +31,12 @@ if (!updated) {
 }
 
 # 4.
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 
 # 5. Retrieving the entry should not expire it
-update request {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 cache.load
 if (!updated) {
@@ -50,7 +44,7 @@ if (!updated) {
 }
 
 # 6.
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 
@@ -67,9 +61,8 @@ if (!notfound) {
 }
 
 # 14. This should still allow the creation of a new entry
-update control {
-       &Cache-TTL := -1
-}
+&control.Cache-TTL := -1
+
 cache.store
 if (!updated) {
        test_fail
@@ -87,39 +80,35 @@ if (&Cache-TTL) {
 }
 
 # 14.
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 
-update control {
-       &Tmp-String-1 := 'cache me2'
-}
+&control.Tmp-String-1 := 'cache me2'
 
 # 18. Updating the Cache-TTL shouldn't make things go boom (we can't really check if it works)
-update control {
-       &Cache-TTL := 666
-}
+&control.Cache-TTL := 666
+
 cache.ttl
 if (!updated) {
        test_fail
 }
 
 # 19. Request Tmp-String-1 shouldn't have been updated yet
-if (&request.Tmp-String-1 == &control.Tmp-String-1) {
+if (&Tmp-String-1 == &control.Tmp-String-1) {
        test_fail
 }
 
 # 20. Check that a new entry is created
-update control {
-       &Cache-TTL := -1
-}
+&control.Cache-TTL := -1
+
 cache.store
 if (!updated) {
        test_fail
 }
 
 # 21. Request Tmp-String-1 still shouldn't have been updated yet
-if (&request.Tmp-String-1 == &control.Tmp-String-1) {
+if (&Tmp-String-1 == &control.Tmp-String-1) {
        test_fail
 }
 
@@ -130,33 +119,32 @@ if (!updated) {
 }
 
 # 23. Request Tmp-String-1 should now have been updated
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 
 # 24. Check Cache-Merge = yes works as expected (should update current request)
-update control {
-       &Tmp-String-1 := 'cache me3'
-       &Cache-TTL := -1
-       &Cache-Merge-New := yes
-}
+&control.Tmp-String-1 := 'cache me3'
+&control.Cache-TTL := -1
+&control.Cache-Merge-New := yes
+
 cache.store
 if (!updated) {
        test_fail
 }
 
 # 25. Request Tmp-String-1 should now have been updated
-if (&request.Tmp-String-1 != &control.Tmp-String-1) {
+if (&Tmp-String-1 != &control.Tmp-String-1) {
        test_fail
 }
 
 # 26. Check Cache-Entry-Hits is updated as we expect
-if (&request.Cache-Entry-Hits != 0) {
+if (&Cache-Entry-Hits != 0) {
        test_fail
 }
 
 cache.load
-if (&request.Cache-Entry-Hits != 1) {
+if (&Cache-Entry-Hits != 1) {
        test_fail
 }
 
index 57f8d315502f196984b7f622c06d8e26297ade1a..26c4731178d06a1f40ead5cbe524caa8cf3b6fb9 100644 (file)
@@ -1,25 +1,25 @@
 #
 #  PRE: cache-logic
 #
-update {
-       &request.Tmp-String-0 := 'testkey'
+&Tmp-String-0 := 'testkey'
 
-       # Reply attributes
-       &reply.Reply-Message := 'hello'
-       &reply.Reply-Message += 'goodbye'
+# Reply attributes
+&reply.Reply-Message := 'hello'
+&reply += {
+       &Reply-Message = 'goodbye'
+}
 
-       # Request attributes
-       &Tmp-Integer-0 += 10
-       &Tmp-Integer-0 += 20
-       &Tmp-Integer-0 += 30
+# Request attributes
+&request += {
+       &Tmp-Integer-0 = 10
+       &Tmp-Integer-0 = 20
+       &Tmp-Integer-0 = 30
 }
 
 #
 #  Basic store and retrieve
 #
-update control {
-       &control.Tmp-String-1 := 'cache me'
-}
+&control.Tmp-String-1 := 'cache me'
 
 cache_update.store
 if (!updated) {
@@ -76,8 +76,6 @@ if (&Tmp-String-2[2] != 'baz') {
 }
 
 # Clear out the reply list
-update {
-    &reply !* ANY
-}
+&reply := {}
 
 test_pass
index 3adbfa97f022f8ab76b3545401e97b2d171a6d7f..3153504bab4a0ee12c9de4d43221d07eded2c08e 100644 (file)
@@ -1,25 +1,25 @@
 #
 #  PRE: cache-logic
 #
-update {
-       &request.Tmp-String-0 := 'testkey'
+&Tmp-String-0 := 'testkey'
 
-       # Reply attributes
-       &reply.Reply-Message := 'hello'
-       &reply.Reply-Message += 'goodbye'
+# Reply attributes
+&reply.Reply-Message := 'hello'
+&reply += {
+       &Reply-Message = 'goodbye'
+}
 
-       # Request attributes
-       &Tmp-Integer-0 += 10
-       &Tmp-Integer-0 += 20
-       &Tmp-Integer-0 += 30
+# Request attributes
+&request += {
+       &Tmp-Integer-0 = 10
+       &Tmp-Integer-0 = 20
+       &Tmp-Integer-0 = 30
 }
 
 #
 #  Basic store and retrieve
 #
-update control {
-       &control.Tmp-String-1 := 'cache me'
-}
+&control.Tmp-String-1 := 'cache me'
 
 cache_update
 if (!ok) {
@@ -70,8 +70,6 @@ if (&Tmp-String-2[2] != 'baz') {
 }
 
 # Clear out the reply list
-update {
-    &reply !* ANY
-}
+&reply := {}
 
 test_pass
index 7265c49d6ec9c82038433562d8c624f3c9194a25..00fa59fde9558b34bcab3aa4996a7eb809d911f8 100644 (file)
@@ -6,8 +6,8 @@ cache {
        ttl = 2
 
        update {
-               &request.Tmp-String-1 := &control.Tmp-String-1[0]
-               &request.Tmp-Integer-0 := &control.Tmp-Integer-0[0]
+               &Tmp-String-1 := &control.Tmp-String-1[0]
+               &Tmp-Integer-0 := &control.Tmp-Integer-0[0]
                &control += &reply
        }
 
index d4b0d37ec602a46df35afeaf2364cfd8648a6331..bb9f0991e5e0301b3378a77c5e5cab2ffee71285 100644 (file)
@@ -15,8 +15,8 @@ cache {
        ttl = 2
 
        update {
-               &request.Tmp-String-1 := &control.Tmp-String-1[0]
-               &request.Tmp-Integer-0 := &control.Tmp-Integer-0[0]
+               &Tmp-String-1 := &control.Tmp-String-1[0]
+               &Tmp-Integer-0 := &control.Tmp-Integer-0[0]
                &control += &reply
        }
 
index 15f0bf15225d49d24313bf500b7330be15cbbc78..ec943811385fee45ab92f689132a5e9a30321c41 100644 (file)
@@ -1,15 +1,10 @@
-update request {
-       &CHAP-Challenge := 0x0102030405060708090a0b0c0d0e0f10
-       &control.Password.Cleartext := "supersecret"
-}
 
-update request {
-       &CHAP-Password := "%(chap_password:%{control.Password.Cleartext})"
-}
+&CHAP-Challenge := 0x0102030405060708090a0b0c0d0e0f10
+&control.Password.Cleartext := "supersecret"
+
+&CHAP-Password := "%(chap_password:%{control.Password.Cleartext})"
 
 chap.authenticate
 if (ok) {
-       update control {
-               &Auth-Type := Accept
-       }
+       &control.Auth-Type := Accept
 }
index 1c55906b3df67a6dbe9b869ca65760b051c9de67..ce1b69a61b3d181f8b1d984bef8da2089d9b1dd6 100644 (file)
@@ -2,9 +2,7 @@
 #  We can't really check the values here as the certs change periodically
 #  but we can test the digest length, and for smoke...
 #
-update request {
-       &Tmp-Octets-0 := "%(cipher_rsa_certificate:fingerprint sha1)"
-}
+&Tmp-Octets-0 := "%(cipher_rsa_certificate:fingerprint sha1)"
 
 if ("%(length:%{Tmp-Octets-0})" != 20) {
        test_fail
@@ -12,9 +10,7 @@ if ("%(length:%{Tmp-Octets-0})" != 20) {
        test_pass
 }
 
-update request {
-       &Tmp-Octets-0 := "%(cipher_rsa_certificate:fingerprint sha256)"
-}
+&Tmp-Octets-0 := "%(cipher_rsa_certificate:fingerprint sha256)"
 
 if ("%(length:%{Tmp-Octets-0})" != 32) {
        test_fail
index 668cdd98b155e1dab035927965a66639662ab64a..d7c5942d8d562599f454b93e9904b613f956bef1 100644 (file)
@@ -1,10 +1,5 @@
-update request {
-       &Tmp-String-0 := "Hello world!"
-}
-
-update request {
-       &Tmp-Octets-0 := "%{cipher_rsa_encrypt:%{Tmp-String-0}}"
-}
+&Tmp-String-0 := "Hello world!"
+&Tmp-Octets-0 := "%{cipher_rsa_encrypt:%{Tmp-String-0}}"
 
 if (!&Tmp-Octets-0) {
        test_fail
@@ -20,9 +15,7 @@ else {
        test_pass
 }
 
-update request {
-       &Tmp-String-1 := "%{cipher_rsa_decrypt:%{Tmp-Octets-0}}"
-}
+&Tmp-String-1 := "%{cipher_rsa_decrypt:%{Tmp-Octets-0}}"
 
 if (&Tmp-String-0 != &Tmp-String-1) {
        test_fail
@@ -34,9 +27,7 @@ else {
 #
 #  Padding scheme should ensure ciphertext is not consistent
 #
-update request {
-       &Tmp-Octets-1 := "%{cipher_rsa_encrypt:%{Tmp-String-0}}"
-}
+&Tmp-Octets-1 := "%{cipher_rsa_encrypt:%{Tmp-String-0}}"
 
 if (&Tmp-Octets-0 == &Tmp-Octets-1) {
        test_fail
@@ -48,13 +39,8 @@ else {
 #
 #  Repeat tests to ensure there are no issues with EVP_PKEY_CTX reuse
 #
-update request {
-       &Tmp-String-0 := "Goodbye world!"
-}
-
-update request {
-       &Tmp-Octets-0 := "%{cipher_rsa_encrypt:%{Tmp-String-0}}"
-}
+&Tmp-String-0 := "Goodbye world!"
+&Tmp-Octets-0 := "%{cipher_rsa_encrypt:%{Tmp-String-0}}"
 
 if (!&Tmp-Octets-0) {
        test_fail
@@ -70,9 +56,7 @@ else {
        test_pass
 }
 
-update request {
-       &Tmp-String-1 := "%{cipher_rsa_decrypt:%{Tmp-Octets-0}}"
-}
+&Tmp-String-1 := "%{cipher_rsa_decrypt:%{Tmp-Octets-0}}"
 
 if (&Tmp-String-0 != &Tmp-String-1) {
        test_fail
index fe93d8da4285d410bfce15d59a73e13bcd5f3517..3c19bb850ba4866e2f7a3c49b4cf20ed4239d77c 100644 (file)
@@ -1,10 +1,5 @@
-update request {
-       &Tmp-String-0 := "Hello world!"
-}
-
-update request {
-       &Tmp-Octets-0 := "%{cipher_rsa_sign:%{Tmp-String-0}}"
-}
+&Tmp-String-0 := "Hello world!"
+&Tmp-Octets-0 := "%{cipher_rsa_sign:%{Tmp-String-0}}"
 
 if (!&Tmp-Octets-0) {
        test_fail
@@ -23,9 +18,7 @@ else {
 #
 #  Pass the signature and the original message to the verification function
 #
-update request {
-       &Tmp-String-0 := "%(cipher_rsa_verify:%{Tmp-Octets-0} %{Tmp-String-0})"
-}
+&Tmp-String-0 := "%(cipher_rsa_verify:%{Tmp-Octets-0} %{Tmp-String-0})"
 
 if (&Tmp-String-0 != 'yes') {
        test_fail
@@ -37,12 +30,8 @@ else {
 #
 #  Verification should now fail
 #
-update request {
-       &Tmp-String-0 := "Goodbye world!"
-}
-update request {
-       &Tmp-String-0 := "%(cipher_rsa_verify:%{Tmp-Octets-0} %{Tmp-String-0})"
-}
+&Tmp-String-0 := "Goodbye world!"
+&Tmp-String-0 := "%(cipher_rsa_verify:%{Tmp-Octets-0} %{Tmp-String-0})"
 
 if (&Tmp-String-0 != 'no') {
        test_fail
@@ -54,13 +43,8 @@ else {
 #
 #  Repeat tests to ensure there are no issues with EVP_PKEY_CTX reuse
 #
-update request {
-       &Tmp-String-0 := "Hello nurse!"
-}
-
-update request {
-       &Tmp-Octets-0 := "%{cipher_rsa_sign:%{Tmp-String-0}}"
-}
+&Tmp-String-0 := "Hello nurse!"
+&Tmp-Octets-0 := "%{cipher_rsa_sign:%{Tmp-String-0}}"
 
 if (!&Tmp-Octets-0) {
        test_fail
@@ -79,9 +63,7 @@ else {
 #
 #  Pass the signature and the original message to the verification function
 #
-update request {
-       &Tmp-String-0 := "%(cipher_rsa_verify:%{Tmp-Octets-0} %{Tmp-String-0})"
-}
+&Tmp-String-0 := "%(cipher_rsa_verify:%{Tmp-Octets-0} %{Tmp-String-0})"
 
 if (&Tmp-String-0 != 'yes') {
        test_fail
@@ -93,12 +75,8 @@ else {
 #
 #  Verification should now fail
 #
-update request {
-       &Tmp-String-0 := "Goodbye nurse!"
-}
-update request {
-       &Tmp-String-0 := "%(cipher_rsa_verify:%{Tmp-Octets-0} %{Tmp-String-0})"
-}
+&Tmp-String-0 := "Goodbye nurse!"
+&Tmp-String-0 := "%(cipher_rsa_verify:%{Tmp-Octets-0} %{Tmp-String-0})"
 
 if (&Tmp-String-0 != 'no') {
        test_fail
index 4e496eb143cdf6e81166d550e37170c955c7c1ab..3e85aa5d092fa206023ab6a6507ff386a4576b86 100644 (file)
@@ -1,6 +1,4 @@
-update request {
-       &Tmp-Octets-0 := "%(cipher_rsa_certificate:serial)"
-}
+&Tmp-Octets-0 := "%(cipher_rsa_certificate:serial)"
 
 if ("%(length:%{Tmp-Octets-0})" != 1) {
        test_fail
index be7e34071ebfc3e8c5da9a4317e27406d5f8d7b0..d8aac72735de83399da08dd2e27e38a64eae6c59 100644 (file)
@@ -1,7 +1,5 @@
-update request {
-       &Tmp-Date-0 := "%(cipher_rsa_certificate:notBefore)"
-       &Tmp-Date-1 := "%(cipher_rsa_certificate:notAfter)"
-}
+&Tmp-Date-0 := "%(cipher_rsa_certificate:notBefore)"
+&Tmp-Date-1 := "%(cipher_rsa_certificate:notAfter)"
 
 # Check the cert validity period is 30 days
 if (<uint32>"%{expr:%(integer:%{Tmp-Date-1}) - %(integer:%{Tmp-Date-0})}" != <uint32>"%{expr:86400 * 60}") {
index d705c4ab8016ffbcb904f18127cb96898e6bb639..1cfaaadf695ec83bb24a136be8300022c18271ae 100644 (file)
@@ -1,30 +1,22 @@
-update request {
-        &Tmp-String-0 := "%(client:nas_type)"
-}
+&Tmp-String-0 := "%(client:nas_type)"
 
 if (&Tmp-String-0 != 'a_type') {
         test_fail
 }
 
-update request {
-        &Tmp-String-0 := "%(client:nas_type 127.0.0.1)"
-}
+&Tmp-String-0 := "%(client:nas_type 127.0.0.1)"
 
 if (&Tmp-String-0 != 'a_type') {
         test_fail
 }
 
-update request {
-        &Tmp-String-0 := "%(client:nas_type 127.0.0.2)"
-}
+&Tmp-String-0 := "%(client:nas_type 127.0.0.2)"
 
 if (&Tmp-String-0 != 'b_type') {
         test_fail
 }
 
-update request {
-       &Tmp-String-0 := "%(client:nas_type 127.0.0.5)"
-}
+&Tmp-String-0 := "%(client:nas_type 127.0.0.5)"
 
 if (&Tmp-String-0 != 'b_type') {
        test_fail
@@ -33,16 +25,14 @@ if (&Tmp-String-0 != 'b_type') {
 #
 #  Test non-existent client properties
 #
-update request {
-       &Tmp-String-3 := "%(client:non-existent-attr)"
-       &Tmp-String-4 += "%(client:non-existing-attr2)"
-}
+&Tmp-String-3 := "%(client:non-existent-attr)"
+&Tmp-String-4 += "%(client:non-existing-attr2)"
 
-if (&Tmp-String-3 != "") {
+if (&Tmp-String-3) {
        test_fail
 }
 
-if (&Tmp-String-4 != "") {
+if (&Tmp-String-4) {
        test_fail
 }
 
index f00c8e2b88361e41de7e0d9e6538e5118a95d611..a51728b148472c422fec79faf421c8d61326b621 100644 (file)
@@ -1,7 +1,7 @@
 update request {
        &Vendor-Specific.FreeRADIUS.Proxied-To := 127.0.0.1
-       &Reply-Message := 'foo'
 }
+&Reply-Message := 'foo'
 
 if ("%(attr_by_num:1)" != 'User-Name') {
        test_fail
index c289fd5c92005d318bdeac2444594d81fe64a20e..bcbfeda8d6fc38fde2beaf649b3e1faf00c721b3 100644 (file)
@@ -9,12 +9,8 @@ if ("%(aka_sim_id_type:%{User-Name})" != 'permanent') {
 #
 #  Encrypt the permanent ID
 #
-update control {
-       &Tmp-String-0 := '1420032219455258'
-}
-update control {
-       &User-Name := "%(3gpp_temporary_id_encrypt:%{User-Name} %{control.Tmp-String-0} 6)"
-}
+&control.Tmp-String-0 := '1420032219455258'
+&control.User-Name := "%(3gpp_temporary_id_encrypt:%{User-Name} %{control.Tmp-String-0} 6)"
 
 #
 #  0.2 - Can we get the EAP method from the encrypted blob correctly?
@@ -40,9 +36,7 @@ if ("%(3gpp_temporary_id_encrypt:%{control.User-Name} %{control.Tmp-String-0} 6)
 #
 #  0.5 - Get the original IMSI back again
 #
-update control {
-       &Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name} %{control.Tmp-String-0})"
-}
+&control.Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name} %{control.Tmp-String-0})"
 
 if (&control.Tmp-String-1 != &User-Name) {
        test_fail
@@ -52,22 +46,18 @@ if (&control.Tmp-String-1 != &User-Name) {
 #  1.0 Now try with the hint coming from &request.EAP-Type
 #
 if (&User-Name =~ /^[0-9](.*)/) {
-       update request {
-               &User-Name[1] := "%{1}"
-       }
-       update request {
-               &EAP-Type := AKA
+       &request += {
+               &User-Name = "%{1}"
+               &EAP-Type = AKA
        }
 }
 
 #
 #  1.1 - Encrypt the permanent ID
 #
-update control {
-       &Tmp-String-0 := '1420032219455259'
-}
-update control {
-       &User-Name[1] := "%(3gpp_temporary_id_encrypt:%{User-Name[1]} %{control.Tmp-String-0} 6)"
+&control.Tmp-String-0 := '1420032219455259'
+&control += {
+       &User-Name = "%(3gpp_temporary_id_encrypt:%{User-Name[1]} %{control.Tmp-String-0} 6)"
 }
 
 #
@@ -87,9 +77,7 @@ if ("%(3gpp_temporary_id_encrypt:%{control.User-Name[1]} %{control.Tmp-String-0}
 #
 #  1.4 - Get the original IMSI back again
 #
-update control {
-       &Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name[1]} %{control.Tmp-String-0})"
-}
+&control.Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name[1]} %{control.Tmp-String-0})"
 
 if (&control.Tmp-String-1 != "0%{User-Name[1]}") {
        test_fail
@@ -98,33 +86,29 @@ if (&control.Tmp-String-1 != "0%{User-Name[1]}") {
 #
 #  2.1 - Encrypt the permanent ID for fastauth
 #
-update control {
-       &Tmp-String-0 := '1420032219455259'
-}
-update control {
-       &User-Name[1] := "%(3gpp_temporary_id_encrypt:%{User-Name[1]} %{control.Tmp-String-0} 6 fastauth)"
+&control.Tmp-String-0 := '1420032219455259'
+&control += {
+       &User-Name = "%(3gpp_temporary_id_encrypt:%{User-Name[1]} %{control.Tmp-String-0} 6 fastauth)"
 }
 
 #
 #  2.2 - Can we identify the encrypted blob correctly?
 #
-if ("%(aka_sim_id_type:%{control.User-Name[1]})" != 'fastauth') {
+if ("%(aka_sim_id_type:%{control.User-Name[2]})" != 'fastauth') {
        test_fail
 }
 
 #
 #  2.3 - We should refuse to re-encrypt an encrypted NAI
 #
-if ("%(3gpp_temporary_id_encrypt:%{control.User-Name[1]} %{control.Tmp-String-0} 6 fastauth)" != '') {
+if ("%(3gpp_temporary_id_encrypt:%{control.User-Name[2]} %{control.Tmp-String-0} 6 fastauth)" != '') {
        test_fail
 }
 
 #
 #  2.4 - Get the original IMSI back again
 #
-update control {
-       &Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name[1]} %{control.Tmp-String-0})"
-}
+&control.Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name[2]} %{control.Tmp-String-0})"
 
 if (&control.Tmp-String-1 != "0%{User-Name[1]}") {
        test_fail
index 19f5fcc7752722c05a1d71c5df8a8188b5f8c60e..7a56409ca89efc1b19cf0083fef28e42170c51a4 100644 (file)
@@ -9,19 +9,13 @@ if ("%(aka_sim_id_type:%{User-Name})" != 'permanent') {
 #
 #  1.1 - Encrypt the permanent ID
 #
-update control {
-       &Tmp-String-0 := '1420032219455259'
-}
-update control {
-       &User-Name := "%(3gpp_temporary_id_encrypt:%{User-Name} %{control.Tmp-String-0} 6)"
-}
+&control.Tmp-String-0 := '1420032219455259'
+&control.User-Name := "%(3gpp_temporary_id_encrypt:%{User-Name} %{control.Tmp-String-0} 6)"
 
 #
 #  1.2 - Get the original IMSI back again sans tag
 #
-update control {
-       &Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name} %{control.Tmp-String-0} false)"
-}
+&control.Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name} %{control.Tmp-String-0} false)"
 
 if ("%{User-Name}" =~ /^0(.*)/) {
        if (!&control.Tmp-String-1 || (&control.Tmp-String-1 == '') || (%{control.Tmp-String-1} != "%{1}")) {
index e010ae90bab47c6d3cfaebb8ea109b7b1a4a46e3..d74feb4979d76e6ede5a2e58a53e7add30f39414 100644 (file)
@@ -1,9 +1,7 @@
 #
 #  No domain separator
 #
-update request {
-       &User-Name := '14200322194552581'
-}
+&User-Name := '14200322194552581'
 
 if ("%(aka_sim_id_method:%{User-Name})" != '') {
        test_fail
@@ -12,9 +10,7 @@ if ("%(aka_sim_id_method:%{User-Name})" != '') {
 #
 #  Zero length ID
 #
-update request {
-       &User-Name := ''
-}
+&User-Name := ''
 
 if ("%(aka_sim_id_method:%{User-Name})" != '') {
        test_fail
index f3c62af69c330fbb9e8acd52e2755ee0abca7670..fc56e372d64ad01726d5a6cf968f88f82acbc7ab 100644 (file)
@@ -9,12 +9,8 @@ if ("%(aka_sim_id_type:%{User-Name})" != 'permanent') {
 #
 #  Encrypt the permanent ID
 #
-update control {
-       &Tmp-String-0 := '1234567812345678'
-}
-update control {
-       &User-Name := "%(3gpp_temporary_id_encrypt:%{User-Name} %{control.Tmp-String-0} 6)"
-}
+&control.Tmp-String-0 := '1234567812345678'
+&control.User-Name := "%(3gpp_temporary_id_encrypt:%{User-Name} %{control.Tmp-String-0} 6)"
 
 #
 #  Can we get the EAP method from the encrypted blob correctly?
index 6f959af6d8f7213cb0947776c89d384188b4a019..80ebf21c13e0a9f47befb4ed430e2ea1e477b71b 100644 (file)
@@ -2,10 +2,8 @@
 #  Async calls should always return a zero length string
 #  because we don't wait for the response.
 #
-update request {
-       &Tmp-String-0 := "%(exec_async:/bin/sh -c 'echo -n hello')"
-}
-if (&Tmp-String-0 != '') {
+&Tmp-String-0 := "%(exec_async:/bin/sh -c 'echo -n hello')"
+if (&Tmp-String-0) {
        test_fail
 }
 
@@ -27,9 +25,7 @@ if (&reply.Reply-Message == 'hello') {
 #  Smoke test - Setup an async process that'll keep running after
 #  after the test exits.
 #
-update request {
-       &Tmp-String-0 := "%(exec_async:/bin/sh -c 'sleep 1')"
-}
-if (&Tmp-String-0 != '') {
+&Tmp-String-0 := "%(exec_async:/bin/sh -c 'sleep 1')"
+if (&Tmp-String-0) {
        test_fail
 }
index 15e5b91a66f318254856801960624b9b5715d84f..6fd098c9b830308fc7ae617585a7b2192d4d359b 100644 (file)
@@ -2,9 +2,7 @@
 #  Sync calls should always return a zero length string
 #  because we don't wait for the response.
 #
-update request {
-       &Tmp-String-0 := `/bin/sh -c 'echo hello'`
-}
+&Tmp-String-0 := `/bin/sh -c 'echo hello'`
 if (&Tmp-String-0 != 'hello') {
        test_fail
 } else {
index 3fe37ec733966f7bc19beaf382fb4b1dc594f6fc..51f8b3a01cc53b993d13fdcfbca77ed104f53472 100644 (file)
@@ -1,9 +1,7 @@
 #
 #  Sync calls return the response
 #
-update request {
-       &Tmp-String-0 := "%(exec_sync:/bin/sh -c 'echo hello')"
-}
+&Tmp-String-0 := "%(exec_sync:/bin/sh -c 'echo hello')"
 if (&Tmp-String-0 != 'hello') {
        test_fail
 }
@@ -11,27 +9,25 @@ if (&Tmp-String-0 != 'hello') {
 #
 #  Call something which will take longer than the timeout
 #
-update request {
-       &Tmp-String-0 := "%(exec_sync:/bin/sleep 10)"
-}
+&request -= &Tmp-String-0
+&Tmp-String-0 := "%(exec_sync:/bin/sleep 10)"
 
 if (&Module-Failure-Message[*] != "Timeout running program - killing it and failing the request") {
        test_fail
 }
 
-if (&Tmp-String-0 != "") {
+if (&Tmp-String-0) {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := "%(exec_sync:/bin/sh $ENV{MODULE_TEST_DIR}/fail.sh)"
-}
+&request -= &Tmp-String-0
+&Tmp-String-0 := "%(exec_sync:/bin/sh $ENV{MODULE_TEST_DIR}/fail.sh)"
 
-if (&Tmp-String-0 != "") {
+if (&Tmp-String-0) {
        test_fail
 }
 
-if (&request.Module-Failure-Message != "Execution of external program returned 7") {
+if (&Module-Failure-Message != "Execution of external program returned 7") {
        test_fail
 }
 
index de4b1cece8a7c179040450162e0284ab0ff4498e..733f8a7114ed0c0eff3d5c63ef5f35741d5b7638 100644 (file)
@@ -107,6 +107,7 @@ greaterthanreply  Password.Cleartext := "testing123"
 #  Note: Filtering "!*" does not apply to control items as this would overload
 #        the operator syntax since "!*" checks that no such attribute in the
 #        request.
+#        
 
 addcontrol  Password.Cleartext := "testing123", Reply-Message := "success1"
             Fall-Through = yes
index 89f5eaf87abf2b2034e9e5c99f976c6e576dd4c9..4347806f8d34b5a2a669ce815634a9ae19effe1b 100644 (file)
@@ -1,6 +1,4 @@
-update request {
-       &FreeRADIUS-Client-IP-Prefix := 10.1.2.3/32
-}
+&FreeRADIUS-Client-IP-Prefix := 10.1.2.3/32
 
 subnet
 
@@ -17,13 +15,9 @@ if (&reply.Reply-Message[1] != "2nd 10.1/16 subnet") {
 }
 
 
-update request {
-       &FreeRADIUS-Client-IP-Prefix := 10.2.3.4/32
-}
+&FreeRADIUS-Client-IP-Prefix := 10.2.3.4/32
 
-update reply {
-       &Reply-Message !* ALL
-}
+&reply -= &Reply-Message[*]
 
 subnet
 
@@ -33,23 +27,15 @@ if (&reply.Reply-Message != "10/8 subnet") {
        test_pass
 }
 
-update request {
-       &FreeRADIUS-Client-IP-Prefix := 10.1.2.3/32
-       &Password.Cleartext := "hello"
-}
+&FreeRADIUS-Client-IP-Prefix := 10.1.2.3/32
+&Password.Cleartext := "hello"
 
-update reply {
-       &Reply-Message !* ALL
-}
+&reply -= &Reply-Message[*]
 
 subnet
 
-update request {
-       &FreeRADIUS-Client-IP-Prefix := 192.168.1.1/32
-}
+&FreeRADIUS-Client-IP-Prefix := 192.168.1.1/32
 
-update reply {
-       &Reply-Message !* ALL
-}
+&reply -= &Reply-Message[*]
 
 subnet
index 9b9da37f30a884c7002aa15ecf7840772002ff4b..68366542b96f16059b97de479d271046b531e391 100644 (file)
@@ -1,6 +1,4 @@
-update request {
-       &FreeRADIUS-Client-IP-Prefix := 10.1.2.3/32
-}
+&FreeRADIUS-Client-IP-Prefix := 10.1.2.3/32
 
 subnet2
 
@@ -17,13 +15,9 @@ if (&reply.Reply-Message[2] != "10/8 subnet") {
 }
 
 #  Delete previous reply messages
-update reply {
-       &Reply-Message !* ANY
-}
+&reply -= &Reply-Message[*]
 
-update request {
-       &FreeRADIUS-Client-IP-Prefix := 10.2.2.3/15
-}
+&FreeRADIUS-Client-IP-Prefix := 10.2.2.3/15
 
 subnet2
 
index 0bd0c439dedadd8a89af0117ad7c65cd2bf93b17..547d8b85d65f4b0e853280d8d2776438bb89b8bb 100644 (file)
@@ -1,18 +1,17 @@
-update control {
-       &Tmp-String-0 := "%(ping:127.0.0.1)"
-}
+&control.Tmp-String-0 := "%(ping:127.0.0.1)"
 
 #
 #  @todo - conditions do not yet support YIELD
 #
 if (&control.Tmp-String-0 == "yes") {
-       update {
-               &control.Password.Cleartext := "hello"
-               &reply.Reply-Message += "success"
+       &control.Password.Cleartext := "hello"
+       
+       &reply += {
+               &Reply-Message = "success"
        }
 }
 else {
-       update reply {
-               &Reply-Message += "failed"
+       &reply += {
+               &Reply-Message = "failed"
        }
 }
index 3614f98271df840cf8e1dc3b6c6ede2538d5e036..4fa52e5ccddb113ed0e9bb33cc72014da46f3ce1 100644 (file)
@@ -2,14 +2,11 @@
 #  PRE: update if
 #
 
-update request {
-        &Tmp-String-0 := "%{idn:example.com}"
-        &Tmp-String-1 := "%{idn:èxâmpłé.com}"
-        &Tmp-String-2 := "%{idn:пример.com}"
-        &Tmp-String-3 := "%{idn:παράδειγμα.com}"
-        &Tmp-String-4 := "%{idn:ตัวอย่าง.com}"
-}
-
+&Tmp-String-0 := "%{idn:example.com}"
+&Tmp-String-1 := "%{idn:èxâmpłé.com}"
+&Tmp-String-2 := "%{idn:пример.com}"
+&Tmp-String-3 := "%{idn:παράδειγμα.com}"
+&Tmp-String-4 := "%{idn:ตัวอย่าง.com}"
 
 if (&Tmp-String-0 != "example.com") {
         test_fail
@@ -31,11 +28,9 @@ if (&Tmp-String-4 != "xn--72c1a1bt4awk9o.com") {
         test_fail
 }
 
-update request {
-        &Tmp-String-0 := "%{idn:invalid_example.com}"
-}
+&Tmp-String-0 := "%{idn:invalid_example.com}"
 
-if (&Tmp-String-0 != "") {
+if (&Module-Failure-Message != "Non-digit/letter/hyphen in input") {
         test_fail
 }
 
@@ -43,17 +38,9 @@ if (&Module-Failure-Message == "") {
         test_fail
 }
 
-update request {
-        &Module-Failure-Message !* ANY
-}
-
-update request {
-        &Tmp-String-0 := "%{idn:a.véry.löng.ņàme.whîch.when.expânded.exceedş.ţhe.dns.stanđard.fór.string.łength.of.twø.hündred.ând.fifty.threé.charáctèrs.and.therefore.is.invalid.for.idn.conversion}"
-}
+&request -= &Module-Failure-Message[*]
 
-if (&Tmp-String-0 != "") {
-        test_fail
-}
+&Tmp-String-0 := "%{idn:a.véry.löng.ņàme.whîch.when.expânded.exceedş.ţhe.dns.stanđard.fór.string.łength.of.twø.hündred.ând.fifty.threé.charáctèrs.and.therefore.is.invalid.for.idn.conversion}"
 
 if (&Module-Failure-Message != "Conversion was truncated") {
         test_fail
index 6c5ddfadb8af645edd295d43be13552d97458e12..eefd0c36f90e00f9c4fb21028d07b378183559da 100644 (file)
@@ -1,8 +1,6 @@
 imap.authenticate
 if (reject) {
-    update control {
-        &Auth-Type := Accept
-    }
+    &control.Auth-Type := Accept
 }
 else {
     reject
index 6c5ddfadb8af645edd295d43be13552d97458e12..eefd0c36f90e00f9c4fb21028d07b378183559da 100644 (file)
@@ -1,8 +1,6 @@
 imap.authenticate
 if (reject) {
-    update control {
-        &Auth-Type := Accept
-    }
+    &control.Auth-Type := Accept
 }
 else {
     reject
index a400bbb945530d2f3a0e412c63640d17bee0895c..14cb9c837f09f674279688cbb46563a973bdd525 100644 (file)
@@ -1,8 +1,6 @@
 imap.authenticate
 if (ok) {
-    update control {
-        &Auth-Type := Accept
-    }
+    &control.Auth-Type := Accept
 }
 else {
     reject
index 055617a4bf7b5bed49c453be808e539ec5f9c11c..916c0c6866211915b3935a80136c2e679955edd9 100644 (file)
@@ -1,8 +1,6 @@
 imap_bad_tls.authenticate
 if (ok) {
-    update control {
-        &Auth-Type := Accept
-    }
+    &control.Auth-Type := Accept
 }
 else {
     reject
index 86ebff8999adb49cb54bc832af5bf3c62ef2dcb1..4ddd79c182988893b79d93cbc4b9349718c6af24 100644 (file)
@@ -1,6 +1,6 @@
 imap_try_tls.authenticate
 
-# if (&request.cert-attrs.Issuer) {
+# if (&cert-attrs.Issuer) {
 #        test_fail
 #}
 # else {
@@ -9,15 +9,13 @@ imap_try_tls.authenticate
 
 
 if (ok) {
-    update control {
-        &Auth-Type := Accept
-    }
+    &control.Auth-Type := Accept
 }
 else {
     reject
 }
 
-if (&request.TLS-Certificate.Issuer =~ /@example\.org/) {
+if (&TLS-Certificate.Issuer =~ /@example\.org/) {
         test_pass
 } else {
        test_fail
index eef0f5895b31f0f33d504468bc8d85d8cd085d00..2202e5cf120dee219a838cda28b474663bd52d50 100644 (file)
@@ -1,17 +1,15 @@
 imap_tls.authenticate
 
 if (ok) {
-    update control {
-        &Auth-Type := Accept
-    }
+    &control.Auth-Type := Accept
 }
 else {
     reject
 }
 
-if (&request.TLS-Certificate.Issuer =~ /@example\.org/) {
-        test_pass
+if (&TLS-Certificate.Issuer =~ /@example\.org/) {
+    test_pass
 } else {
-       test_fail
+    test_fail
 }
 
index 0d1633244fb1fd87089ce34e5270ea12561b3471..791692267c0e38df352ef22e618ba966911d8ae8 100644 (file)
 #
 #      json_encode tests
 #
-update {
-        &request.Packet-Type !* ANY
-}
+&request -= &Packet-Type[*]
 
 # 0. Check basic xlat parsing
-
-update request {
-       &Tmp-String-1 := "%{json_encode:&request[*]}"
-       &Tmp-String-2 := "%{json_encode:&request[*] }"
-       &Tmp-String-3 := "%{json_encode: &request[*]}"
-       &Tmp-String-4 := "%{json_encode:         &request[*]    }"
-       &Tmp-String-5 := "%{json_encode: &request[*]    !&Filter-Id }"
-       &Tmp-String-6 := "%{json_encode:&request[*] ! }"
+&control.Tmp-String-1 := "%{json_encode:&request[*]}"
+&control.Tmp-String-2 := "%{json_encode:&request[*] }"
+&control.Tmp-String-3 := "%{json_encode: &request[*]}"
+&control.Tmp-String-4 := "%{json_encode:        &request[*]    }"
+&control.Tmp-String-5 := "%{json_encode: &request[*]    !&Filter-Id }"
+&control.Tmp-String-6 := "%{json_encode:&request[*] ! }"
 #  Check defaults are the same as output_mode "object":
-       &Tmp-String-7 := "%{json_object_encode:&request[*]}"
-       &Tmp-String-8 := "%{json_object_no_encode:&request[*]}"
-}
+&control.Tmp-String-7 := "%{json_object_encode:&request[*]}"
+&control.Tmp-String-8 := "%{json_object_no_encode:&request[*]}"
 
-
-if (&Tmp-String-1 != '{"User-Name":{"type":"string","value":"john"},"Filter-Id":{"type":"string","value":["f1","f2"]},"NAS-Port":{"type":"uint32","value":999},"Service-Type":{"type":"uint32","value":"Login-User"}}') {
+if (&control.Tmp-String-1 != '{"User-Name":{"type":"string","value":"john"},"Filter-Id":{"type":"string","value":["f1","f2"]},"NAS-Port":{"type":"uint32","value":999},"Service-Type":{"type":"uint32","value":"Login-User"}}') {
        test_fail
 }
 
 #  Check xlat input formats
-if (&Tmp-String-1 != &Tmp-String-2 ||
-    &Tmp-String-1 != &Tmp-String-3 ||
-    &Tmp-String-1 != &Tmp-String-4) {
+if (&control.Tmp-String-1 != &control.Tmp-String-2 ||
+    &control.Tmp-String-1 != &control.Tmp-String-3 ||
+    &control.Tmp-String-1 != &control.Tmp-String-4) {
        test_fail
 }
 
 #  Check defaults
-if (&Tmp-String-1 != &Tmp-String-7 ||
-    &Tmp-String-1 != &Tmp-String-8) {
+if (&control.Tmp-String-1 != &control.Tmp-String-7 ||
+    &control.Tmp-String-1 != &control.Tmp-String-8) {
        test_fail
 }
 
-if (&Tmp-String-5 != '{"User-Name":{"type":"string","value":"john"},"NAS-Port":{"type":"uint32","value":999},"Service-Type":{"type":"uint32","value":"Login-User"}}') {
+if (&control.Tmp-String-5 != '{"User-Name":{"type":"string","value":"john"},"NAS-Port":{"type":"uint32","value":999},"Service-Type":{"type":"uint32","value":"Login-User"}}') {
        test_fail
 }
 
-if (&Tmp-String-6 != '') {
+if (&control.Tmp-String-6) {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 !* ANY
-       &Tmp-String-2 !* ANY
-       &Tmp-String-3 !* ANY
-       &Tmp-String-4 !* ANY
-       &Tmp-String-5 !* ANY
-       &Tmp-String-6 !* ANY
-       &Tmp-String-7 !* ANY
-       &Tmp-String-8 !* ANY
-}
-
-
 # 1a. Output mode "object" tests
 
 # These are unsorted dictionaries. Hopefully json-c doesn't suddenly
 # decide that it's going to use a different ordering of the keys...
+&control.Tmp-String-1 := "%{json_object_encode:&request[*]}"
+&control.Tmp-String-2 := "%{json_object_ex_encode:&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_object_encode:&request[*]}"
-       &Tmp-String-2 := "%{json_object_ex_encode:&request[*]}"
-}
-
-if (&Tmp-String-1 != '{"User-Name":{"type":"string","value":"john"},"Filter-Id":{"type":"string","value":["f1","f2"]},"NAS-Port":{"type":"uint32","value":999},"Service-Type":{"type":"uint32","value":"Login-User"}}') {
+if (&control.Tmp-String-1 != '{"User-Name":{"type":"string","value":"john"},"Filter-Id":{"type":"string","value":["f1","f2"]},"NAS-Port":{"type":"uint32","value":999},"Service-Type":{"type":"uint32","value":"Login-User"}}') {
        test_fail
 }
 
-if (&Tmp-String-2 != '{"pf:User-Name":{"type":"string","value":["john"]},"pf:Filter-Id":{"type":"string","value":["f1","f2"]},"pf:NAS-Port":{"type":"uint32","value":["999"]},"pf:Service-Type":{"type":"uint32","value":["1"]}}') {
+"%{control.Tmp-String-2}"
+if (&control.Tmp-String-2 != '{"pf:User-Name":{"type":"string","value":["john"]},"pf:Filter-Id":{"type":"string","value":["f1","f2"]},"pf:NAS-Port":{"type":"uint32","value":["999"]},"pf:Service-Type":{"type":"uint32","value":["1"]}}') {
        test_fail
 }
 
 # 1b. "object" empty inputs
+&control.Tmp-String-1 := "%{json_object_encode:!&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_object_encode:!&request[*]}"
-}
-
-if (&Tmp-String-1 != '{}') {
+if (&control.Tmp-String-1 != '{}') {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 !* ANY
-       &Tmp-String-2 !* ANY
-       &Module-Failure-Message !* ANY
-}
-
-
 # 2a. Output mode "object_simple" tests
+&control.Tmp-String-1 := "%{json_object_simple_encode:&request[*]}"
+&control.Tmp-String-2 := "%{json_object_simple_ex_encode:&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_object_simple_encode:&request[*]}"
-       &Tmp-String-2 := "%{json_object_simple_ex_encode:&request[*]}"
-}
-
-if (&Tmp-String-1 != '{"User-Name":"john","Filter-Id":["f1","f2"],"NAS-Port":999,"Service-Type":"Login-User"}') {
+if (&control.Tmp-String-1 != '{"User-Name":"john","Filter-Id":["f1","f2"],"NAS-Port":999,"Service-Type":"Login-User"}') {
        test_fail
 }
 
-if (&Tmp-String-2 != '{"pf:User-Name":["john"],"pf:Filter-Id":["f1","f2"],"pf:NAS-Port":["999"],"pf:Service-Type":["1"]}') {
+if (&control.Tmp-String-2 != '{"pf:User-Name":["john"],"pf:Filter-Id":["f1","f2"],"pf:NAS-Port":["999"],"pf:Service-Type":["1"]}') {
        test_fail
 }
 
 # 2b. "object_simple" empty inputs
+&control.Tmp-String-1 := "%{json_object_simple_encode:!&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_object_simple_encode:!&request[*]}"
-}
-
-if (&Tmp-String-1 != '{}') {
+if (&control.Tmp-String-1 != '{}') {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 !* ANY
-       &Tmp-String-2 !* ANY
-       &Module-Failure-Message !* ANY
-}
-
-
 # 3a. Output mode "array" tests
+&control.Tmp-String-1 := "%{json_array_encode:&request[*]}"
+&control.Tmp-String-2 := "%{json_array_ex_encode:&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_array_encode:&request[*]}"
-       &Tmp-String-2 := "%{json_array_ex_encode:&request[*]}"
-}
-
-if (&Tmp-String-1 != '[{"name":"User-Name","type":"string","value":"john"},{"name":"Filter-Id","type":"string","value":"f1"},{"name":"Filter-Id","type":"string","value":"f2"},{"name":"NAS-Port","type":"uint32","value":999},{"name":"Service-Type","type":"uint32","value":"Login-User"}]') {
+if (&control.Tmp-String-1 != '[{"name":"User-Name","type":"string","value":"john"},{"name":"Filter-Id","type":"string","value":"f1"},{"name":"Filter-Id","type":"string","value":"f2"},{"name":"NAS-Port","type":"uint32","value":999},{"name":"Service-Type","type":"uint32","value":"Login-User"}]') {
        test_fail
 }
 
-if (&Tmp-String-2 != '[{"name":"pf:User-Name","type":"string","value":["john"]},{"name":"pf:Filter-Id","type":"string","value":["f1","f2"]},{"name":"pf:NAS-Port","type":"uint32","value":["999"]},{"name":"pf:Service-Type","type":"uint32","value":["1"]}]') {
+if (&control.Tmp-String-2 != '[{"name":"pf:User-Name","type":"string","value":["john"]},{"name":"pf:Filter-Id","type":"string","value":["f1","f2"]},{"name":"pf:NAS-Port","type":"uint32","value":["999"]},{"name":"pf:Service-Type","type":"uint32","value":["1"]}]') {
        test_fail
 }
 
 # 3b. "array" empty inputs
+&control.Tmp-String-1 := "%{json_array_encode:!&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_array_encode:!&request[*]}"
-}
-
-if (&Tmp-String-1 != '[]') {
+if (&control.Tmp-String-1 != '[]') {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 !* ANY
-       &Tmp-String-2 !* ANY
-       &Module-Failure-Message !* ANY
-}
-
-
 # 4a. Output mode "array_of_names" tests
+&control.Tmp-String-1 := "%{json_array_names_encode:&request[*]}"
+&control.Tmp-String-2 := "%{json_array_names_ex_encode:&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_array_names_encode:&request[*]}"
-       &Tmp-String-2 := "%{json_array_names_ex_encode:&request[*]}"
-}
-
-if (&Tmp-String-1 != '["User-Name","Filter-Id","Filter-Id","NAS-Port","Service-Type"]') {
+if (&control.Tmp-String-1 != '["User-Name","Filter-Id","Filter-Id","NAS-Port","Service-Type"]') {
        test_fail
 }
 
-if (&Tmp-String-2 != '["pf:User-Name","pf:Filter-Id","pf:Filter-Id","pf:NAS-Port","pf:Service-Type"]') {
+if (&control.Tmp-String-2 != '["pf:User-Name","pf:Filter-Id","pf:Filter-Id","pf:NAS-Port","pf:Service-Type"]') {
        test_fail
 }
 
 # 4b. "array_of_names" empty inputs
+&control.Tmp-String-1 := "%{json_array_names_encode:!&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_array_names_encode:!&request[*]}"
-}
-
-if (&Tmp-String-1 != '[]') {
+if (&control.Tmp-String-1 != '[]') {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 !* ANY
-       &Tmp-String-2 !* ANY
-       &Module-Failure-Message !* ANY
-}
-
-
 # 5a. Output mode "array_of_values" tests
+&control.Tmp-String-1 := "%{json_array_values_encode:&request[*]}"
+&control.Tmp-String-2 := "%{json_array_values_ex_encode:&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_array_values_encode:&request[*]}"
-       &Tmp-String-2 := "%{json_array_values_ex_encode:&request[*]}"
-}
-
-if (&Tmp-String-1 != '["john","f1","f2",999,"Login-User"]') {
+if (&control.Tmp-String-1 != '["john","f1","f2",999,"Login-User"]') {
        test_fail
 }
 
-if (&Tmp-String-2 != '["john","f1","f2","999","1"]') {
+if (&control.Tmp-String-2 != '["john","f1","f2","999","1"]') {
        test_fail
 }
 
 # 5b. "array_of_values" empty inputs
+&control.Tmp-String-1 := "%{json_array_values_encode:!&request[*]}"
 
-update request {
-       &Tmp-String-1 := "%{json_array_values_encode:!&request[*]}"
-}
-
-if (&Tmp-String-1 != '[]') {
+if (&control.Tmp-String-1 != '[]') {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 !* ANY
-       &Tmp-String-2 !* ANY
-       &Module-Failure-Message !* ANY
-}
-
-
 # Convert `make json.test` unlang update output to tests, for when
 # things need updating.
 #  
index 33abfb3993fdc2a69bd3f4b47f669fcbd7451b16..6356f0ad5c7ca85f516f66fdf7f670dce85d1eb5 100644 (file)
@@ -2,6 +2,4 @@
 #       json xlat input parsing test - error with no input
 #
 
-update request {
-       &Tmp-String-1 := "%{json_object_ex_encode:}"  # ERROR
-}
+&Tmp-String-1 := "%{json_object_ex_encode:}"  # ERROR
index faedb8c1f07e7cd24cf79824f7d428fe5e8edf4a..c09dfd3a0b51569458b495650f1b005f546a3ab8 100644 (file)
@@ -2,9 +2,7 @@
 #      Evaluation tests
 #
 
-update request {
-       &Tmp-String-0 := "{\"foo\":\"bar\"}"
-}
+&Tmp-String-0 := "{\"foo\":\"bar\"}"
 
 # 0. Simple field access
 map json &Tmp-String-0 {
@@ -15,25 +13,21 @@ if (&Tmp-String-1 != 'bar') {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := "\
-       {\
-               \"my_array\": [0, 1, 2, 3, 4, 5], \
-               \"my_object\": { \
-                       \"foo\": \"bar\", \
-                       \"num\" : 42 \
-               }, \
-               \"num\": 99, \
-               \"double\": 5.9, \
-               \"null\": null, \
-               \"bool_true\": true, \
-               \"bool_false\": false \
-       }"
-}
+&Tmp-String-0 := "\
+{\
+       \"my_array\": [0, 1, 2, 3, 4, 5], \
+       \"my_object\": { \
+               \"foo\": \"bar\", \
+               \"num\" : 42 \
+       }, \
+       \"num\": 99, \
+       \"double\": 5.9, \
+       \"null\": null, \
+       \"bool_true\": true, \
+       \"bool_false\": false \
+}"
 
-update request {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # Check conversion of all JSON types to strings
 map json &Tmp-String-0 {
@@ -75,9 +69,7 @@ if (&Tmp-String-1[6] != 'no') {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 #
 # Now check array slicing operates correctly
@@ -90,9 +82,8 @@ map json &Tmp-String-0 {
 if (&Tmp-String-1 != '[ 0, 1, 2, 3, 4, 5 ]') {
        test_fail
 }
-update request {
-       &Tmp-String-1 !* ANY
-}
+
+&request -= &Tmp-String-1[*]
 
 # 9. Simple index
 map json &Tmp-String-0 {
@@ -101,9 +92,8 @@ map json &Tmp-String-0 {
 if (&Tmp-Integer-0 != 0) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 9a. All of the array
 map json &Tmp-String-0 {
@@ -113,9 +103,8 @@ if ((&Tmp-Integer-0[0] != 0) || (&Tmp-Integer-0[1] != 1) || (&Tmp-Integer-0[2] !
        test_fail
 }
 
-update request {
-       &Tmp-Integer-0 := 9
-}
+&Tmp-Integer-0 := 9
+
 # 9b. All of the array using prepend, places the array before the existing value
 map json &Tmp-String-0 {
        &Tmp-Integer-0 ^= '$.my_array.*'
@@ -123,9 +112,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 0) || (&Tmp-Integer-0[1] != 1) || (&Tmp-Integer-0[2] != 2) || (&Tmp-Integer-0[3] != 3) || (&Tmp-Integer-0[4] != 4) || (&Tmp-Integer-0[5] != 5) || (&Tmp-Integer-0[6] != 9)) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 10. End of the array
 map json &Tmp-String-0 {
@@ -134,9 +122,8 @@ map json &Tmp-String-0 {
 if (&Tmp-Integer-0 != 5) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 11. Past end of the array
 map json &Tmp-String-0 {
@@ -145,9 +132,8 @@ map json &Tmp-String-0 {
 if (&Tmp-Integer-0) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 12. Simple slice
 map json &Tmp-String-0 {
@@ -156,9 +142,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 0) || (&Tmp-Integer-0[1] != 1)) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 13. Slice with negative start
 map json &Tmp-String-0 {
@@ -167,9 +152,8 @@ map json &Tmp-String-0 {
 if (&Tmp-Integer-0 != 5) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 14. Slice with negative start and negative end
 map json &Tmp-String-0 {
@@ -186,9 +170,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 1) && (&Tmp-Integer-0[1] != 2)) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 16. Slice with start, end and negative step
 map json &Tmp-String-0 {
@@ -197,9 +180,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 4) || (&Tmp-Integer-0[1] != 3)) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 17. Slice with start, end (inverted) and negative step
 map json &Tmp-String-0 {
@@ -208,9 +190,8 @@ map json &Tmp-String-0 {
 if (&Tmp-Integer-0) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 18. Slice with start, end and positive step
 map json &Tmp-String-0 {
@@ -219,9 +200,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 2) || (&Tmp-Integer-0[1] != 3)) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 19. Slice with start, end and positive step > 1
 map json &Tmp-String-0 {
@@ -230,9 +210,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 1) && (&Tmp-Integer-0[1] != 3)) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 20. Slice with start, end and positive step > end of array
 map json &Tmp-String-0 {
@@ -241,9 +220,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 1) || &Tmp-Integer-0[1]) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 21. Slice with start, end and positive step > end of array
 map json &Tmp-String-0 {
@@ -252,9 +230,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 5) || &Tmp-Integer-0[1]) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 22. No start/end 3 step
 map json &Tmp-String-0 {
@@ -263,9 +240,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 0) || (&Tmp-Integer-0[1] != 3) || &Tmp-Integer-0[2]) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 23. No start/end 3 step
 map json &Tmp-String-0 {
@@ -274,9 +250,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 5) || (&Tmp-Integer-0[1] != 2) || &Tmp-Integer-0[2]) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 24. No end 3 step
 map json &Tmp-String-0 {
@@ -285,9 +260,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 3) || (&Tmp-Integer-0[1] != 0) || &Tmp-Integer-0[2]) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 25. End 0, 3 step
 map json &Tmp-String-0 {
@@ -296,9 +270,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 3) || &Tmp-Integer-0[1]) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 26. End 0, 3 step
 map json &Tmp-String-0 {
@@ -307,9 +280,8 @@ map json &Tmp-String-0 {
 if ((&Tmp-Integer-0[0] != 0) || &Tmp-Integer-0[1]) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 27. Everything two levels deep
 map json &Tmp-String-0 {
@@ -327,9 +299,7 @@ if ((&Tmp-String-1[0] != '0') || \
        test_fail
 }
 
-update request {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # 28. Everything three levels deep (nothing)
 map json &Tmp-String-0 {
@@ -359,19 +329,17 @@ if (&Tmp-String-1) {
 }
 
 # Some big numbers in nested arrays
-update request {
-       &Tmp-String-0 := "\
-       [\
-               9223372036854775807, \
-               -9223372036854775807, \
-               18446744073709551615, \
-               [ \
-                       2147483647, \
-                       -2147483647, \
-                       4294967295, \
-               ] \
-       ]"
-}
+&Tmp-String-0 := "\
+[\
+       9223372036854775807, \
+       -9223372036854775807, \
+       18446744073709551615, \
+       [ \
+               2147483647, \
+               -2147483647, \
+               4294967295, \
+       ] \
+]"
 
 # 31. Unsigned 32bit integers (are supported)
 # Will get smushed to INT32_MAX with json-c <= 0.10, or might wrap, it's
@@ -395,9 +363,8 @@ map json &Tmp-String-0 {
 if (&Tmp-Integer-0 != 2147483647) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+
+&request -= &Tmp-Integer-0[*]
 
 # 33. Signed 64bit integers
 map json &Tmp-String-0 {
@@ -406,9 +373,8 @@ map json &Tmp-String-0 {
 if (&Tmp-int64-0 != 9223372036854775807) {
        test_fail
 }
-update request {
-       &Tmp-int64-0 !* ANY
-}
+
+&request -= &Tmp-int64-0[*]
 
 # 34. Signed 64bit integers
 map json &Tmp-String-0 {
@@ -417,9 +383,8 @@ map json &Tmp-String-0 {
 if (&Tmp-int64-0 != -9223372036854775807) {
        test_fail
 }
-update request {
-       &Tmp-int64-0 !* ANY
-}
+
+&request -= &Tmp-int64-0[*]
 
 # 35. Unsigned 64bit integers (not allowed by json so gets truncated)
 map json &Tmp-String-0 {
@@ -428,9 +393,8 @@ map json &Tmp-String-0 {
 if (&Tmp-uint64-0 != 9223372036854775807) {
        test_fail
 }
-update request {
-       &Tmp-uint64-0 !* ANY
-}
+
+&request -= &Tmp-uint64-0[*]
 
 # 36. Multiple array indicies
 map json &Tmp-String-0 {
@@ -439,32 +403,27 @@ map json &Tmp-String-0 {
 if ((&Tmp-Signed-0[0] != 2147483647) || (&Tmp-signed-0[1] != -2147483647)) {
        test_fail
 }
-update request {
-       &Tmp-Signed-0 !* ANY
-}
+
+&request -= &Tmp-Signed-0[*]
 
 # 37. Path containing dynamic expansion
-update request {
-       &Tmp-Integer-2 := 0
-}
+&Tmp-Integer-2 := 0
+
 map json &Tmp-String-0 {
        &Tmp-Integer-0 += "$[3][%{Tmp-Integer-2}]"
 }
 if (&Tmp-Integer-0 != 2147483647) {
        test_fail
 }
-update request {
-       &Tmp-Integer-0 !* ANY
-}
+&request -= &Tmp-Integer-0[*]
 
 # 38. An expanded field name with bad chars
-update request {
-       &Tmp-String-0 := "\
-       {\
-               \"foo.bar\": \"baz\" \
-       }"
-       &Tmp-String-2 := %{taint:foo.bar}
-}
+&Tmp-String-0 := "\
+{\
+       \"foo.bar\": \"baz\" \
+}"
+&Tmp-String-2 := "%{taint:foo.bar}"
+
 map json &Tmp-String-0 {
        &Tmp-String-1 := "$.%{Tmp-String-2}"
 }
@@ -472,46 +431,43 @@ map json &Tmp-String-0 {
 if (&Tmp-String-1 != 'baz') {
        test_fail
 }
-update request {
-       &Tmp-String-1 !* ANY
-}
-
-update request {
-       &Tmp-String-0 := "\
-       {\
-               \"my_array\": [0, 1, 2, 3, 4, 5], \
-               \"my_object\": { \
-                       \"foo\": \"bar\", \
-                       \"num\" : 42, \
-                       \"my_deep_object\": { \
-                               \"foo\": \"baz\", \
-                               \"num\": 99, \
-                               \"bool\": true\
-                       }, \
-                       \"my_cats\": [\
-                               \"fluffy\", \
-                               \"scratchy\", \
-                               \"flat\" \
-                       ], \
+
+&request -= &Tmp-String-1[*]
+
+&Tmp-String-0 := "\
+{\
+       \"my_array\": [0, 1, 2, 3, 4, 5], \
+       \"my_object\": { \
+               \"foo\": \"bar\", \
+               \"num\" : 42, \
+               \"my_deep_object\": { \
+                       \"foo\": \"baz\", \
+                       \"num\": 99, \
+                       \"bool\": true\
                }, \
                \"my_cats\": [\
-                       \"spikey\", \
-                       \"clawy\", \
-                       \"woofy\" \
+                       \"fluffy\", \
+                       \"scratchy\", \
+                       \"flat\" \
                ], \
-       }"
-}
+       }, \
+       \"my_cats\": [\
+               \"spikey\", \
+               \"clawy\", \
+               \"woofy\" \
+       ], \
+}"
 
 # 39. Recursive descent with field match
 map json &Tmp-String-0 {
        &Tmp-String-1 += '$..bool'
 }
+
 if (("%{Tmp-String-1[#]}" != 1) || (&Tmp-String-1 != 'yes')) {
        test_fail
 }
-update request {
-       &Tmp-String-1 !* ANY
-}
+
+&request -= &Tmp-String-1[*]
 
 # 40. Recursive descent with element match (2nd element in each array)
 map json &Tmp-String-0 {
@@ -520,9 +476,7 @@ map json &Tmp-String-0 {
 if (("%{Tmp-String-1[#]}" != 3) || (&Tmp-String-1[0] != '1') || (&Tmp-String-1[1] != 'scratchy') || (&Tmp-String-1[2] != 'clawy')) {
        test_fail
 }
-update request {
-       &Tmp-String-1 !* ANY
-}
+&request -= &Tmp-String-1[*]
 
 # 41. Recursive descent with field then element match
 map json &Tmp-String-0 {
@@ -531,8 +485,7 @@ map json &Tmp-String-0 {
 if (("%{Tmp-String-1[#]}" != 2) || (&Tmp-String-1[0] != 'flat') || (&Tmp-String-1[1] != 'woofy')) {
        test_fail
 }
-update request {
-       &Tmp-String-1 !* ANY
-}
+
+&request -= &Tmp-String-1[*]
 
 test_pass
index 58fe477f57dbc019cf6960f0f92081e8ef9be313..d99017547c890b2efe539a32f0ada8bf3e8e77fd 100644 (file)
@@ -1,15 +1,10 @@
 #
 # JSON quoting
 #
-
-update request {
-       &Tmp-String-0 := 'foo/bar'
-       &Tmp-String-1 := 'foo"bar'
-}
-update request {
-       &Tmp-String-2 := "%{jsonquote:%{Tmp-String-0}}"
-       &Tmp-String-3 := "%{jsonquote:%{Tmp-String-1}}"
-}
+&Tmp-String-0 := 'foo/bar'
+&Tmp-String-1 := 'foo"bar'
+&Tmp-String-2 := "%{jsonquote:%{Tmp-String-0}}"
+&Tmp-String-3 := "%{jsonquote:%{Tmp-String-1}}"
 
 # Check for correct escapes
 if (&Tmp-String-2 != 'foo\/bar') {
@@ -24,14 +19,10 @@ if (&Module-Failure-Message) {
        test_fail
 }
 
-
 # Check for correct handling of null input
+&Tmp-String-4 := "%{jsonquote:}"
 
-update request {
-       &Tmp-String-4 := "%{jsonquote:}"
-}
-
-if (&Tmp-String-4 != '') {
+if (&Tmp-String-4) {
        test_fail
 }
 
index 004a2f31dce39d60aefe1d8ed512f8e0fe6fb131..b859c31ab9541dd0b26383c65f013564e572eb98 100644 (file)
@@ -8,9 +8,7 @@ if (!ok) {
         test_fail
 }
 
-update {
-        &Tmp-String-0 := "%{ldap:ldap://$ENV{TEST_SERVER}/uid=john,ou=people,dc=example,dc=com?description}"
-}
+&Tmp-String-0 := "%{ldap:ldap://$ENV{TEST_SERVER}/uid=john,ou=people,dc=example,dc=com?description}"
 
 if (&Tmp-String-0 != "User john is online") {
         test_fail
index 04d2fc904f82e44ff463a638ad3cf62fe4fc9e2a..e2309b2e410a56cae00fe53691546a1c5915f363 100644 (file)
@@ -42,9 +42,7 @@ ldap.authenticate
 
 ldap.post-auth
 
-update {
-        &Tmp-String-0 := "%{ldap:ldap://$ENV{TEST_SERVER}/uid=john,ou=people,dc=example,dc=com?description}"
-}
+&Tmp-String-0 := "%{ldap:ldap://$ENV{TEST_SERVER}/uid=john,ou=people,dc=example,dc=com?description}"
 
 if (&Tmp-String-0 != "User %{User-Name} authenticated") {
        test_fail
index e0c322b005f69715f065cc5bdb8018dfd7f9b23a..dd148ed783ad5d78a37499d3f584cdbf720ad38f 100644 (file)
@@ -29,9 +29,7 @@ ldapssl.authenticate
 
 ldapssl.post-auth
 
-update {
-        &Tmp-String-0 := "%{ldapssl:ldaps:///uid=fred,ou=people,dc=subdept,dc=example,dc=com?description}"
-}
+&Tmp-String-0 := "%{ldapssl:ldaps:///uid=fred,ou=people,dc=subdept,dc=example,dc=com?description}"
 
 if (&Tmp-String-0 != "User %{User-Name} authenticated") {
        test_fail
index 6f838e8bcd897852af8b48594866f75ebc72d911..e1eefc3951dbfc2eb65eef1c482dea197945e5a5 100644 (file)
@@ -30,9 +30,7 @@ ldaptls.authenticate
 
 ldaptls.post-auth
 
-update {
-        &Tmp-String-0 := "%{ldaptls:ldap:///uid=fred,ou=people,dc=subdept,dc=example,dc=com?description}"
-}
+&Tmp-String-0 := "%{ldaptls:ldap:///uid=fred,ou=people,dc=subdept,dc=example,dc=com?description}"
 
 if (&Tmp-String-0 != "User %{User-Name} authenticated") {
        test_fail
index 2dda4f20a808ed4a124e9066ffedcb2002cb7ae9..879d4851f102f8d54cae42936c4545f6ecbb836a 100644 (file)
@@ -7,15 +7,15 @@ if (!updated) {
        test_fail
 }
 
-if (&request.Tmp-String-0 != '255.255.255.0') {
+if (&Tmp-String-0 != '255.255.255.0') {
        test_fail
 }
 
-if (&request.Tmp-String-1[*] != 'cn=radprofile,ou=profiles,dc=example,dc=com') {
+if (&Tmp-String-1[*] != 'cn=radprofile,ou=profiles,dc=example,dc=com') {
        test_fail
 }
 
-if (&request.Tmp-String-1[*] != 'cn=profile1,ou=profiles,dc=example,dc=com') {
+if (&Tmp-String-1[*] != 'cn=profile1,ou=profiles,dc=example,dc=com') {
        test_fail
 }
 
index 7a9eac1cef241e1443f04a97d9c748bb74531d91..8a5953879917b66c1bd9ae74fd1739e90f372bee 100644 (file)
 #  Test the "ldap" module xlat escape functions
 #
 
-update request {
-        &Tmp-String-0 := "safe string"
-        &Tmp-String-1 := 'non safe,+"\<>;*=() string'
-        &Tmp-String-2 := ',+"\<>;*=()'
-}
+&Tmp-String-0 := "safe string"
+&Tmp-String-1 := 'non safe,+"\<>;*=() string'
+&Tmp-String-2 := ',+"\<>;*=()'
 
 # String with no escaping
-update control {
-        &Tmp-String-0 := "%{ldap_escape:%{Tmp-String-0}}"
-}
+&control.Tmp-String-0 := "%{ldap_escape:%{Tmp-String-0}}"
 
 if (&control.Tmp-String-0 != "safe string") {
         test_fail
 }
 
 # String with some characters to escape
-update control {
-        &Tmp-String-1 := "%{ldap_escape:%{Tmp-String-1}}"
-}
+&control.Tmp-String-1 := "%{ldap_escape:%{Tmp-String-1}}"
 
 if (&control.Tmp-String-1 != 'non safe\2c\2b\22\5c\3c\3e\3b\2a\3d\28\29 string') {
         test_fail
 }
 
 # String where all characters require escaping
-update control {
-        &Tmp-String-2 := "%{ldap_escape:%{Tmp-String-2}}"
-}
+&control.Tmp-String-2 := "%{ldap_escape:%{Tmp-String-2}}"
 
 if (&control.Tmp-String-2 != '\2c\2b\22\5c\3c\3e\3b\2a\3d\28\29') {
         test_fail
 }
 
-update request {
-        &Tmp-String-3 := "%{ldap_unescape:%{control.Tmp-String-0}}"
-}
+&Tmp-String-3 := "%{ldap_unescape:%{control.Tmp-String-0}}"
 
 if (&Tmp-String-3 != 'safe string') {
         test_fail
 }
 
-update request {
-        &Tmp-String-4 := "%{ldap_unescape:%{control.Tmp-String-1}}"
-}
+&Tmp-String-4 := "%{ldap_unescape:%{control.Tmp-String-1}}"
 
 if (&Tmp-String-4 != 'non safe,+"\<>;*=() string') {
         test_fail
 }
 
-update request {
-        &Tmp-String-5 := "%{ldap_unescape:%{control.Tmp-String-2}}"
-}
+&Tmp-String-5 := "%{ldap_unescape:%{control.Tmp-String-2}}"
 
 if (&Tmp-String-5 != ',+"\<>;*=()') {
         test_fail
 }
 
-update request {
-        &Tmp-String-6 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=people,dc=example,dc=com?displayName?sub?(uid=john)}"
-}
+&Tmp-String-6 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=people,dc=example,dc=com?displayName?sub?(uid=john)}"
 
 if (&Tmp-String-6 != "John Doe") {
         test_fail
 }
 
 # Return multiple values - could be in any sequence
-update request {
-        &Tmp-String-7 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=clients,dc=example,dc=com?radiusClientIdentifier?sub?(objectClass=radiusClient)}"
-}
+&Tmp-String-7 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=clients,dc=example,dc=com?radiusClientIdentifier?sub?(objectClass=radiusClient)}"
 
 if ((&Tmp-String-7 != "1.1.1.12.2.2.2") && (&Tmp-String-7 != "2.2.2.21.1.1.1")) {
         test_fail
 }
 
 # Use tainted string in filter - with special characters
-update request {
-        &Tmp-String-8 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=people,dc=example,dc=com?cn?sub?(displayName=*%{Tmp-String-9}*)}"
-}
+&Tmp-String-8 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=people,dc=example,dc=com?cn?sub?(displayName=*%{Tmp-String-9}*)}"
 
 if (&Tmp-String-8 != "Bob Smith") {
         test_fail
 }
 
 # A query which should return no results
-update request {
-        &Tmp-String-0 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=people,dc=example,dc=com?displayName?sub?(uid=notknown)}"
-}
+&Tmp-String-0 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=people,dc=example,dc=com?displayName?sub?(uid=notknown)}"
 
 if (&Tmp-String-0 != "") {
         test_fail
 }
 
 # Request an invalid DN
-update request {
-        &Tmp-String-0 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=notthere?displayName?sub?(uid=john)}"
-}
+&Tmp-String-0 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=notthere?displayName?sub?(uid=john)}"
 
 if (&Tmp-String-0 != "") {
         test_fail
@@ -108,36 +84,28 @@ if (&Module-Failure-Message != "LDAP server returned an error: lib error: No suc
 }
 
 # Query within a dn which will prompt a referral
-update request {
-        &Tmp-String-0 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
-}
+&Tmp-String-0 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
 
 if (&Tmp-String-0 != "Fred Jones") {
         test_fail
 }
 
 # Reference an alternative LDAP server in the xlat
-update request {
-        &Tmp-String-1 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:%{expr:$ENV{LDAP_TEST_SERVER_PORT} + 1}/dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
-}
+&Tmp-String-1 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:%{expr:$ENV{LDAP_TEST_SERVER_PORT} + 1}/dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
 
 if (&Tmp-String-1 != "Fred Jones") {
         test_fail
 }
 
 # This query will follow 2 referrals, the second will present an alternate search base
-update request {
-        &Tmp-String-2 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=offsite,dc=subdept,dc=example,dc=com?displayName?sub?(uid=john)}"
-}
+&Tmp-String-2 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=offsite,dc=subdept,dc=example,dc=com?displayName?sub?(uid=john)}"
 
 if (&Tmp-String-2 != "John Doe") {
         test_fail
 }
 
 # This query will follow 3 referrals - more than our max referral depth
-update request {
-        &Tmp-String-3 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=bounce1,dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
-}
+&Tmp-String-3 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=bounce1,dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
 
 if (&Tmp-String-3 != "") {
         test_fail
index b286b77ac9791ee89e15e1fd48013ec9476f8312..760b5803e90238011ab427f25fa4477f111da2a0 100644 (file)
@@ -1,14 +1,10 @@
-update control {
-       &Exec-Export := 'PATH="$ENV{PATH}:/bin:/usr/bin:/opt/bin:/usr/local/bin"'
-}
+&control.Exec-Export := 'PATH="$ENV{PATH}:/bin:/usr/bin:/opt/bin:/usr/local/bin"'
 
 #
 #  Remove old log files
 #
 group {
-       update request {
-               &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_delim.log"`
-       }
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_delim.log"`
 
        #
        #  We can only over-ride actions in an "actions" subsection,
@@ -23,9 +19,7 @@ if (fail) {
 }
 
 linelog_fmt_delim
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_delim.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_delim.log"`
 
 if (&Tmp-String-0 == 'bob, ') {
        test_pass
@@ -36,9 +30,7 @@ else {
 
 #  Check strings are appended
 linelog_fmt_delim
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_delim.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_delim.log"`
 
 if (&Tmp-String-0 == 'bob, bob, ') {
        test_pass
@@ -48,6 +40,4 @@ else {
 }
 
 #  Remove the file
-update request {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_delim.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_delim.log"`
index 4acad2340a0f399279cb123f3d7da2c4d694c0f2..d1226cedff0c2873181e75860e7e8676f652678a 100644 (file)
@@ -1,15 +1,10 @@
-
-update control {
-       &Exec-Export := 'PATH="$ENV{PATH}:/bin:/usr/bin:/opt/bin:/usr/local/bin"'
-}
+&control.Exec-Export := 'PATH="$ENV{PATH}:/bin:/usr/bin:/opt/bin:/usr/local/bin"'
 
 #
 #  Remove old log files
 #
 group {
-       update request {
-               &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_escapes.log"`
-       }
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_escapes.log"`
 
        actions {
                fail = 1
@@ -21,18 +16,12 @@ if (fail) {
 
 #  Raw attribute value should be written out without further molestation.
 #  Because the value is wrapped in '' the \n is left as \n.
-update control {
-       &Tmp-String-0 := 'test_attr'
-       &Tmp-String-1 := 'foo\nbar'
-}
+&control.Tmp-String-0 := 'test_attr'
+&control.Tmp-String-1 := 'foo\nbar'
 
 linelog_escapes
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n2 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
-}
-update request {
-       &Tmp-String-1 := "%{hex:%{Tmp-String-0}}"
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n2 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
+&Tmp-String-1 := "%{hex:%{Tmp-String-0}}"
 
 #
 #  Note that there's a '5f6e' here, which is "\n"
@@ -45,9 +34,7 @@ else {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
 
 #
 #  This is left alone, and not "\n" --> 0x0a, too.
@@ -61,18 +48,13 @@ else {
 
 #  Raw attribute value should be written out without further molestation.
 #  Because the value is wrapped in "" the \n is converted to 0x0a (binary).
-update control {
-       &Tmp-String-0 := 'test_attr'
-       &Tmp-String-1 := "foo\nbar"
-}
+&control.Tmp-String-0 := 'test_attr'
+&control.Tmp-String-1 := "foo\nbar"
 
 linelog_escapes
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n2 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
-}
-update request {
-       &Tmp-String-1 := "%{hex:%{Tmp-String-0}}"
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n2 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
+&Tmp-String-1 := "%{hex:%{Tmp-String-0}}"
+
 if (&Tmp-String-1 == '666f6f0a626172') {
        test_pass
 }
@@ -80,9 +62,8 @@ else {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
+
 if (&Tmp-String-0 == "bar") {
        test_pass
 }
@@ -93,6 +74,4 @@ else {
 #  Fixme... needs completing. Too many broken escaping things.
 
 #  Remove the file
-update request {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_escapes.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_escapes.log"`
index 183874356441b092d98c46cf925bccfe57403898..d4e7adecea6da347f606ecaf0c6996b3686299b4 100644 (file)
@@ -1,14 +1,10 @@
-update control {
-       &Exec-Export := 'PATH="$ENV{PATH}:/bin:/usr/bin:/opt/bin:/usr/local/bin"'
-}
+&control.Exec-Export := 'PATH="$ENV{PATH}:/bin:/usr/bin:/opt/bin:/usr/local/bin"'
 
 #
 #  Remove old log files
 #
 group {
-       update request {
-               &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_multi.log"`
-       }
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_multi.log"`
 
        actions {
                fail = 1
@@ -19,28 +15,24 @@ if (fail) {
 }
 
 #  Check multiple string type attributes are logged correctly
-update control {
-       &Tmp-String-0 := 'test_multi_str'
-}
+&control.Tmp-String-0 := 'test_multi_str'
 
-update control {
-       &Reply-Message := '0'
-       &Reply-Message += '1'
-       &Reply-Message += '2'
-       &Reply-Message += '3'
-       &Reply-Message += '4'
-       &Reply-Message += '5'
-       &Reply-Message += '6'
-       &Reply-Message += '7'
-       &Reply-Message += '8'
-       &Reply-Message += '9'
-       &Reply-Message += '10'
+&control += {
+       &Reply-Message = '0'
+       &Reply-Message = '1'
+       &Reply-Message = '2'
+       &Reply-Message = '3'
+       &Reply-Message = '4'
+       &Reply-Message = '5'
+       &Reply-Message = '6'
+       &Reply-Message = '7'
+       &Reply-Message = '8'
+       &Reply-Message = '9'
+       &Reply-Message = '10'
 }
 
 linelog_ref_multi
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_multi.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_multi.log"`
 
 if (&Tmp-String-0 == '0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ') {
        test_pass
@@ -50,19 +42,17 @@ else {
 }
 
 # Check octet type attributes are logged in raw form
-update control {
-       &Tmp-Octets-0 := 0x686970706f   # Hippo
-       &Tmp-Octets-0 += 0x0a           # new line
-       &Tmp-Octets-0 += 0x626c6970706f # Blippo
+&control += {
+       &Tmp-Octets-0 = 0x686970706f    # Hippo
+       &Tmp-Octets-0 = 0x0a            # new line
+       &Tmp-Octets-0 = 0x626c6970706f  # Blippo
 }
 
-update control {
-       &Tmp-String-0 := 'test_multi_octets'
-}
+&control.Tmp-String-0 := 'test_multi_octets'
+
 linelog_ref_multi
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_multi.log"`
-}
+
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_multi.log"`
 
 if (&Tmp-String-0 == ', blippo, ') {
        test_pass
@@ -72,9 +62,8 @@ else {
 }
 
 #  When no attributes that match are available, linelog should return noop
-update control {
-       &Tmp-String-0 := 'test_empty'
-}
+&control.Tmp-String-0 := 'test_empty'
+
 linelog_ref_multi
 if (noop) {
        test_pass
@@ -84,6 +73,4 @@ else {
 }
 
 #  Remove the file
-update request {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_multi.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_multi.log"`
index 1b97e7906866a7fe1ee1fca25f54a642f8b42a20..1dfe9820558a31596625530b765003dfcb493821 100644 (file)
@@ -1,14 +1,10 @@
-update control {
-       &Exec-Export := 'PATH="$ENV{PATH}:/bin:/usr/bin:/opt/bin:/usr/local/bin"'
-}
+&control.Exec-Export := 'PATH="$ENV{PATH}:/bin:/usr/bin:/opt/bin:/usr/local/bin"'
 
 #
 #  Remove old log files
 #
 group {
-       update request {
-               &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_a.log"`
-       }
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_a.log"`
 
        actions {
                fail = 1
@@ -19,13 +15,10 @@ if (fail) {
 }
 
 #  Check linelog fails over to the default message (an xlat expansion)
-update control {
-       &Tmp-String-0 := 'test_default'
-}
+&control.Tmp-String-0 := 'test_default'
+
 linelog_fmt_and_ref
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob default') {
        test_pass
@@ -35,14 +28,11 @@ else {
 }
 
 #  Check linelog adds a newline at the end of each message (also tests if execs pointed to by refs work)
-update control {
-       &Tmp-String-0 := 'test_exec'
-}
+&control.Tmp-String-0 := 'test_exec'
+
 linelog_fmt_and_ref
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob exec') {
        test_pass
@@ -52,9 +42,7 @@ else {
 }
 
 #  Check it's not overwriting the same line repeatedly
-update request {
-       &Tmp-String-0 := `/bin/sh -c "head -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "head -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob default') {
        test_pass
@@ -64,14 +52,11 @@ else {
 }
 
 #  Check linelog can use attrs pointed to by refs
-update control {
-       &Tmp-String-0 := 'test_attr'
-}
+&control.Tmp-String-0 := 'test_attr'
+
 linelog_fmt_and_ref
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob') {
        test_pass
@@ -81,14 +66,11 @@ else {
 }
 
 #  Check linelog can use xlats pointed to by refs
-update control {
-       &Tmp-String-0 := 'test_xlat'
-}
+&control.Tmp-String-0 := 'test_xlat'
+
 linelog_fmt_and_ref
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob xlat') {
        test_pass
@@ -98,14 +80,11 @@ else {
 }
 
 #  Check linelog can use literals pointed to by refs
-update control {
-       &Tmp-String-0 := 'test_literal'
-}
+&control.Tmp-String-0 := 'test_literal'
+
 linelog_fmt_and_ref
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
 
 if (&Tmp-String-0 == '%{User-Name} literal') {
        test_pass
@@ -115,14 +94,11 @@ else {
 }
 
 #  Check linelog can use empty conf pairs
-update control {
-       &Tmp-String-0 := 'test_empty'
-}
+&control.Tmp-String-0 := 'test_empty'
+
 linelog_fmt_and_ref
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
 
 if (&Tmp-String-0 == '') {
        test_pass
@@ -132,15 +108,11 @@ else {
 }
 
 #  Remove the file
-update request {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_a.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_a.log"`
 
 #  Remove old log files
 group {
-       update request {
-               &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_b.log"`
-       }
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_b.log"`
 
        actions {
                fail = 1
@@ -151,9 +123,8 @@ if (fail) {
 }
 
 #  Check behaviour when we don't have a default configured (should not create new file)
-update control {
-       &Tmp-String-0 := 'test_default'
-}
+&control.Tmp-String-0 := 'test_default'
+
 linelog_ref
 if (noop) {
        test_pass
@@ -163,9 +134,7 @@ else {
 }
 
 group {
-       update request {
-               &Tmp-String-0 := `/bin/sh -c "test ! -e $ENV{MODULE_TEST_DIR}/test_b.log"`
-       }
+       &Tmp-String-0 := `/bin/sh -c "test ! -e $ENV{MODULE_TEST_DIR}/test_b.log"`
 
        actions {
                fail = 1
@@ -179,14 +148,11 @@ else {
 }
 
 #  Check ref still works (with an exec)
-update control {
-       &Tmp-String-0 := 'test_exec'
-}
+&control.Tmp-String-0 := 'test_exec'
+
 linelog_ref
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_b.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_b.log"`
 
 if (&Tmp-String-0 == 'bob exec') {
        test_pass
@@ -196,15 +162,11 @@ else {
 }
 
 #  Remove the file
-update request {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_b.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_b.log"`
 
 #  Remove old log files
 group {
-       update request {
-               &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_c.log"`
-       }
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_c.log"`
 
        actions {
                fail = 1
@@ -215,14 +177,10 @@ if (fail) {
 }
 
 #  Check behaviour using an attribute ref as a path
-update control {
-       &Tmp-String-0 := '.messages.test_xlat'
-}
+&control.Tmp-String-0 := '.messages.test_xlat'
 
 linelog_fmt_and_ref_attr
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
 
 if (&Tmp-String-0 == 'bob xlat') {
        test_pass
@@ -232,14 +190,10 @@ else {
 }
 
 #  Check behaviour using an attribute ref (non existent path, with default also an attribute ref)
-update control {
-       &Tmp-String-0 := 'test_xlat'
-}
+&control.Tmp-String-0 := 'test_xlat'
 
 linelog_fmt_and_ref_attr
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
 
 if (&Tmp-String-0 == 'bob') {
        test_pass
@@ -249,14 +203,10 @@ else {
 }
 
 #  Check '.' is always prefixed to the path
-update control {
-       &Tmp-String-0 := 'messages.test_xlat'
-}
+&control.Tmp-String-0 := 'messages.test_xlat'
 
 linelog_fmt_and_ref_attr
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
 
 if (&Tmp-String-0 == 'bob xlat') {
        test_pass
@@ -266,9 +216,7 @@ else {
 }
 
 #  Check '..' results in a 'fail' (can't go up one level)
-update control {
-       &Tmp-String-0 := '..messages.test_attr'
-}
+&control.Tmp-String-0 := '..messages.test_attr'
 
 linelog_fmt_and_ref_attr {
        fail = 1
@@ -280,9 +228,7 @@ else {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
 
 if (&Tmp-String-0 == 'bob xlat') {
        test_pass
@@ -292,9 +238,7 @@ else {
 }
 
 #  Check '.messages' results in a 'fail' (messages is a section)
-update control {
-       &Tmp-String-0 := '.messages'
-}
+&control.Tmp-String-0 := '.messages'
 
 linelog_fmt_and_ref_attr {
        fail = 1
@@ -307,15 +251,11 @@ else {
 }
 
 #  Remove the file
-update request {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_c.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_c.log"`
 
 #  Remove old log files
 group {
-       update request {
-               &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_d.log"`
-       }
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_d.log"`
 
        actions {
                fail = 1
@@ -326,9 +266,8 @@ if (fail) {
 }
 linelog_fmt
 
-update request {
-       &Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_d.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_d.log"`
+
 if (&Tmp-String-0 == 'bob') {
        test_pass
 }
@@ -337,6 +276,4 @@ else {
 }
 
 #  Remove the file
-update request {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_d.log"`
-}
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_d.log"`
index 8abfa41b3ea01180afe28a3f8cd65491fc5cf977..4b169c6277bd0fef6a6177577c024a7f92f7ff27 100644 (file)
@@ -10,7 +10,7 @@ function authorize()
        end
 
        if not type(fr.request) == "table" then
-               print("error: The 'fr.request.{}' should be table")
+               print("error: The 'fr.{}' should be table")
                return fr.rcode.fail
        end
 
index dc517f9d60b84f32b7f1b6916b33df3267b32e94..af144871327f2da3dcb6da958776c5753ee3bb29 100644 (file)
@@ -1,5 +1,5 @@
 function authorize()
-       for k, v in fr.request.pairs() do
+       for k, v in fr.pairs() do
                if k == "Framed-IPv6-Prefix" and v == "11:22:33:44:55:66:77:88/128" then
                        return fr.rcode.ok
                end
index be7c807313b4c7e239b5cb1e43bcd5a559f8851c..e2648213d3fa926291becd2b33f3582a8fa76d23 100644 (file)
@@ -1,5 +1,5 @@
 function authorize()
-       for k, v in fr.request.pairs() do
+       for k, v in fr.pairs() do
                if k == "User-Name" and v == "caipirinha" then
                        return fr.rcode.ok
                end
index 5fee003b1d09e8aca1fa32d64ac0e85e4a7bea0f..e3614743c5c55155cc191a312f23e4c84797ad29 100644 (file)
@@ -33,10 +33,10 @@ function authorize()
        fr.log.debug("Powered by Luajit+FFI & fr_log()")
 
        -- fr.request {}
-       print("# fr.request.{}")
+       print("# fr.{}")
        print("type(fr.request) = " .. type(fr.request))
-       print("for k,v in fr.request.pairs()")
-       for k,v in fr.request.pairs() do print("\t"..k, v) end
+       print("for k,v in fr.pairs()")
+       for k,v in fr.pairs() do print("\t"..k, v) end
        print()
 
        print("#mod8.lua: returning fr.rcode.noop")
index b37b9750263cc79bb3914469c23cc0c037f7355e..b03376793f075ace41d7894d70af29ce6a0df2b3 100644 (file)
@@ -1,10 +1,7 @@
 if (&User-Name == 'test') {
-       update request {
-               &User-Password := "%{randstr:bbbbbbbbbbbbbbbb}"
-       }
-       update control {
-               &Password.Cleartext := "%{User-Password}"
-       }
+       &User-Password := "%{randstr:bbbbbbbbbbbbbbbb}"
+       &control.Password.Cleartext := "%{User-Password}"
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 76325d1e5115b5c83b670be9ba1c69813a6c0a9a..b9a00e2b887eff0ff980ea1f63a74a35b77f4594 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_dig_big') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index b9a9c4f0a289f4ccddc6c396b9b3bed20b5d6b88..78a40c45176b1c0b699837a0a5e7bd94c4f1deaf 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_dig_small') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI'
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI'
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 773fd0a3f64e3a693ea7a2dca73e99d56363a854..d8f7d37563d17a065839cad6ed030566070cf1ec 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_iter0') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAAAP:CuNDJ9NimZoP5ljnPNCBUA==:f09zV7dReGg5SIv/EXY9tCL4XQRr5guhL0Q6UXSKI3c='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAAAP:CuNDJ9NimZoP5ljnPNCBUA==:f09zV7dReGg5SIv/EXY9tCL4XQRr5guhL0Q6UXSKI3c='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index ec048cbd54168ea83f7cfc5d6d2278f28fd7c1f3..62e1055568269798ce8ad199ad366e350ec07340 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_iter1') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:OErtptMl2hOxhQqvNw7sNw==:4KkrgL+3Q9j8KlHPivtApBKRZAjyWjtDWmZEz2UjNko='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:OErtptMl2hOxhQqvNw7sNw==:4KkrgL+3Q9j8KlHPivtApBKRZAjyWjtDWmZEz2UjNko='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 69b68b63f5a134ebe2fbc58a185e4ed48f197db2..d0a8ece9f49f791e3d72b100795caceae17ef621 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_iter1000') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAD6A:yhmqoKrtPLY2KYK6cNjnfw==:Y6gkSZEo4TRtlsryHqnGYZhoe2qn5tJ4IUyyVHb/3WU='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAD6A:yhmqoKrtPLY2KYK6cNjnfw==:Y6gkSZEo4TRtlsryHqnGYZhoe2qn5tJ4IUyyVHb/3WU='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index d1f22bf682fe055b24a63050fd4df58e67f9cc4c..a01bde046ec128cec218cf0125a61917176544b5 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_iter100000') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AA9CQA:fCfnJGMVC1QLtTOPiaSICA==:KCmjMpQ+lokMvyFTl4f4pPJNc0xJq4iHZPdtHa0OEXM='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AA9CQA:fCfnJGMVC1QLtTOPiaSICA==:KCmjMpQ+lokMvyFTl4f4pPJNc0xJq4iHZPdtHa0OEXM='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 634a6d812dcb6e66973bcb5f265331285218b08b..c3f936206a9d92c86275b9729b5b3008a3ed07ec 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_iter_big') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ==:E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ==:E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index b459a0ed07de189b40d6471f4818572a5fc5256f..375d8ab6f5f07e20a30fcfe7a8f00008f74222b9 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_iter_miss') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256::E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256::E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
+
        pap.authorize
        pap.authenticate {
                invalid = 1
index b35f7fb0c090e945bbf8cf265af1093d5c64f29f..50353f894abe889c25e1f6b4336f10d52b4c3901 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_iter_small') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAAA:E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAAA:E+VXOSsE8RwyYGdygQoW9Q==:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
+
        pap.authorize
        pap.authenticate {
                invalid = 1
index cc84f656cd586250e05a8f66ce4b67ce5fb65da9..c4dd47ccecb1c4223d3f11b8a0796cb29e98754b 100644 (file)
@@ -7,9 +7,7 @@ test_pass
 #}
 
 #if (&User-Name == 'pbkdf2_passlib') {
-#      update control {
-#              &Password.PBKDF2 := '$pbkdf2-sha256$29000$9t7be09prfXee2/NOUeotQ$Y.RDnnq8vsezSZSKy1QNy6xhKPdoBIwc.0XDdRm9sJ8'
-#      }
+#      &control.Password.PBKDF2 := '$pbkdf2-sha256$29000$9t7be09prfXee2/NOUeotQ$Y.RDnnq8vsezSZSKy1QNy6xhKPdoBIwc.0XDdRm9sJ8'
 #      pap.authorize
 #      pap.authenticate
 #      if (!ok) {
index 5aa60ab43132b7201b8e6f9db6289e1deb155d4b..443f467cc3331cdaf8e8e3feaeaa13d58aa40e55 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_salt0') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAnEA::4RJEKVFQ5nE8126aURI0cJO9tqy/DIAhq64piBEwshA='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAnEA::4RJEKVFQ5nE8126aURI0cJO9tqy/DIAhq64piBEwshA='
+
        pap.authorize
        pap.authenticate {
                invalid = 1
index 9c9e8c8ffce598b4e9d020bb7e58b2c8bea72d72..12aeca446e4106077f45733b13b74dde071b594b 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_salt1') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAnEA:qg==:KQzCdedgOZYFwx+mQp1TKA8VM4fwf02pqSdJEh2ekwM='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAnEA:qg==:KQzCdedgOZYFwx+mQp1TKA8VM4fwf02pqSdJEh2ekwM='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 4c90087e2fe2a73d18a154f06dfcfac66b76f475..ec05a5350d2ca8da03c039c5bde6f742b3c03d33 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_salt1024') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAnEA:/IUrkJKe+1kzJNBw7aAMbnQuSFZpjbCqPeKso3cbuSUzWinxngxjK8yyZLiWwF+WE/0Gplfx25zZEQNTdRTvjZZNefoxQBR8Hht0FpdU9YiEBaeErwVo63EDEu83+ycvB18uH0IXpJKGSSkIPRfGpHT3BkwJDGo5SqjRJadDsyQzkc/WJCMrrfJ0igaWMxb5eR5J8qfXIjBFepRrOOU6acZGtANW8qvDYLJwN+TMd9Jb1wDDY14eoAlKglTF21S3kewNMkDDyeP+oDYv29t1S/soFUnnB+Pb5IdR6pDy2VDGx4jFZMQGshSHWTYQFqgulavS/tGEF8TvzcorrJZKuksAjKdTSmfZ6j4aBY3U+oMSQ+2lO131pkNfNQuMsDfr72r9wUA2xRgUiL/J7CgKn7mamL2OCaksl0Rw2PGqqIaHvAYS6Q1EoIzsmLNrWBYYqTRLyCGZw6+hUOahYRon2lglGmnuWHPfowU+LgcaR5gF1QjvTXhXQ8I39mB3ePgdi+7TUn644Z1FB+JTqGJbue92x4V40Zyyy+Qdt52QsR49iYokbKAwQRiqfVJ7J8NzCY/kIQnqT9RE0NCxZoMBRzboZxVPchxdpmWGQ9dXP06PqIuDCFFiJlVQUfyPMgOAxIlVJ/9NAmj5MWFdWMrmlBNDx9ihEV1FdTv23iFZH5Ejg+x4D3qN5oOyCDL2i9lobzFXh5z4EDpbbogQaFkUzqKEaxRGPBrfYVOi6XXYujVUnxHJaRxbs2UqjpJNsXMg8f7P78aRvOKCIbW70CHWlt7nF0pA5+kFUQRLXKuq7bW+ivoXKeDW5o4FVP3+Pcr67+DOsUXuehALLj9Mu2ICWlMIV/AWcM2szaqk1bwSo7bAeG4RtDKmNjGA7gpnT+w2x+/qS1eWbc832Sumqc1IA8aY6HNVDPsJZf99To4BR+N0rCoQQ/KIZybI31mQagR3+FR9yNzqWzKIl+qf69RTc1CbUCkKVF8pxWZ0ocP+CAdoKadgpdF8evQIiGcUD73HiJ0RsDWo21y0tN0P5jfzWo3WMhCk9e2wl6o1JAfKw54uHzWJnNlGLBK1LXF+R2m+WvNGBgvUhh4PtYV9gPSudumFdk614oak/Aqcn6xi+YZqOMPkW4WYaiczhHyS7qAyefqKaQkRVYS0Af+79CSjlxZJq57HrD7/1E+d/i0gKmSAbPe80uGHs2a13V3VxztFMBi4xD7zj9Mq7+0goVPD4MNXcR651MZ7vxDRGbvPPmclddZe/nkTEn1YB/909b9mC5P/XzximZYW8gEhBReZouukADRTAjuH8zgSIv6/uyTURnmSVoOumVLBpL7veJIzDm4dZ38BWiasiBnzgMuG9A==:RUoCF5O11OgwLFMTqnKY/yRJy6DYh+yNq4xHZC7COGM='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAnEA:/IUrkJKe+1kzJNBw7aAMbnQuSFZpjbCqPeKso3cbuSUzWinxngxjK8yyZLiWwF+WE/0Gplfx25zZEQNTdRTvjZZNefoxQBR8Hht0FpdU9YiEBaeErwVo63EDEu83+ycvB18uH0IXpJKGSSkIPRfGpHT3BkwJDGo5SqjRJadDsyQzkc/WJCMrrfJ0igaWMxb5eR5J8qfXIjBFepRrOOU6acZGtANW8qvDYLJwN+TMd9Jb1wDDY14eoAlKglTF21S3kewNMkDDyeP+oDYv29t1S/soFUnnB+Pb5IdR6pDy2VDGx4jFZMQGshSHWTYQFqgulavS/tGEF8TvzcorrJZKuksAjKdTSmfZ6j4aBY3U+oMSQ+2lO131pkNfNQuMsDfr72r9wUA2xRgUiL/J7CgKn7mamL2OCaksl0Rw2PGqqIaHvAYS6Q1EoIzsmLNrWBYYqTRLyCGZw6+hUOahYRon2lglGmnuWHPfowU+LgcaR5gF1QjvTXhXQ8I39mB3ePgdi+7TUn644Z1FB+JTqGJbue92x4V40Zyyy+Qdt52QsR49iYokbKAwQRiqfVJ7J8NzCY/kIQnqT9RE0NCxZoMBRzboZxVPchxdpmWGQ9dXP06PqIuDCFFiJlVQUfyPMgOAxIlVJ/9NAmj5MWFdWMrmlBNDx9ihEV1FdTv23iFZH5Ejg+x4D3qN5oOyCDL2i9lobzFXh5z4EDpbbogQaFkUzqKEaxRGPBrfYVOi6XXYujVUnxHJaRxbs2UqjpJNsXMg8f7P78aRvOKCIbW70CHWlt7nF0pA5+kFUQRLXKuq7bW+ivoXKeDW5o4FVP3+Pcr67+DOsUXuehALLj9Mu2ICWlMIV/AWcM2szaqk1bwSo7bAeG4RtDKmNjGA7gpnT+w2x+/qS1eWbc832Sumqc1IA8aY6HNVDPsJZf99To4BR+N0rCoQQ/KIZybI31mQagR3+FR9yNzqWzKIl+qf69RTc1CbUCkKVF8pxWZ0ocP+CAdoKadgpdF8evQIiGcUD73HiJ0RsDWo21y0tN0P5jfzWo3WMhCk9e2wl6o1JAfKw54uHzWJnNlGLBK1LXF+R2m+WvNGBgvUhh4PtYV9gPSudumFdk614oak/Aqcn6xi+YZqOMPkW4WYaiczhHyS7qAyefqKaQkRVYS0Af+79CSjlxZJq57HrD7/1E+d/i0gKmSAbPe80uGHs2a13V3VxztFMBi4xD7zj9Mq7+0goVPD4MNXcR651MZ7vxDRGbvPPmclddZe/nkTEn1YB/909b9mC5P/XzximZYW8gEhBReZouukADRTAjuH8zgSIv6/uyTURnmSVoOumVLBpL7veJIzDm4dZ38BWiasiBnzgMuG9A==:RUoCF5O11OgwLFMTqnKY/yRJy6DYh+yNq4xHZC7COGM='
+       
        pap.authorize
        pap.authenticate
        if (!ok) {
index 981d7aa8bebad9e607a788f1742a6dbdf1dae5a4..7ee75ffd5da1ac393543b039ac350b33dd874331 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_salt64') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAnEA:msGxE1XuC+wlgRr+H4+ioyxZuiN3KYLUSky2FINDTq7KJylKt4XnqloV+FuHGXUbOu1EWcsFp51u2z8wdXVnQQ==:rAV9BeEJH5kt9uZ6pJt0o5pYpN5LQRe4MAYyk2jvjpU='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAnEA:msGxE1XuC+wlgRr+H4+ioyxZuiN3KYLUSky2FINDTq7KJylKt4XnqloV+FuHGXUbOu1EWcsFp51u2z8wdXVnQQ==:rAV9BeEJH5kt9uZ6pJt0o5pYpN5LQRe4MAYyk2jvjpU='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 7707dabbc50ec2701853baafc0d684db3e74b9ae..d2456ea588e6127904ffa97b57c746490005cd1f 100644 (file)
@@ -4,9 +4,7 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_salt_big') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:E+VXOSsE8RwyYGdygQoW9QA==:pF23EcxNBhJLQ+9JRtd9wQ1Gz+k4i6YjeNZq+7DRBX8='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:E+VXOSsE8RwyYGdygQoW9QA==:pF23EcxNBhJLQ+9JRtd9wQ1Gz+k4i6YjeNZq+7DRBX8='
        pap.authorize
        pap.authenticate
        if (!ok) {
index a7d1d0eba8381e710f5cffdf5f645b20e0e5cad1..2872decf0a6622eb552623e1030dddd5d23b5efd 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_salt_small') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:E+VXOSsE8RwyYGdygQoW9Q=:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAAAQ:E+VXOSsE8RwyYGdygQoW9Q=:UivlvrwHML4VtZHMJLiT/xlH7oyoyvbXQceivptq9TI='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 819d043e170560fce820a659771d5c1c0616edbb..84aa363981c44c7a3ab8ecb1fba7e995f5bee334 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_sha1') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA1:AAAD6A:Xw1P133xrwk=:dtQBXQRiR/No5A8Ip3JFGF/qUC0='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA1:AAAD6A:Xw1P133xrwk=:dtQBXQRiR/No5A8Ip3JFGF/qUC0='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index acd79ad2e83c44151c9e66eff52949f028848763..c0403ca282365774a2b707512d93643ff89e5158 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_sha2_224') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+224:AAAnEA:UHScBrg/ZWOyBKqQdAh7bw==:tcFp6CDrkIYdhwa60g24U4ko+mBxzAiFxlpPnA=='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+224:AAAnEA:UHScBrg/ZWOyBKqQdAh7bw==:tcFp6CDrkIYdhwa60g24U4ko+mBxzAiFxlpPnA=='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 18085fe7029ef64aa2458300c49e9210acb78e5d..69c1659c1104ef0383654dad192733c7d2947f21 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_sha2_256') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+256:AAAnEA:a/8HbYW2HWsMthN27JI+Ew==:3nPlXYOlOuDCFOfethUomHxTXkG9JCivOdvh6FDNdGw='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+256:AAAnEA:a/8HbYW2HWsMthN27JI+Ew==:3nPlXYOlOuDCFOfethUomHxTXkG9JCivOdvh6FDNdGw='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 1c4d1ef260a818f54a7858085a49ee12af922957..9fb8e396eaf6b1df15c8be9cda681aef6093de1c 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_sha2_384') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+384:AAAnEA:pyHRsYLfNZdjszRcu6eHrA==:ktGfNmZ6PyD8FNEgPzFK1fypKERZ13pgvFl+PQdyKouaMXsXIiWPuTMXHqDUCWsx'
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+384:AAAnEA:pyHRsYLfNZdjszRcu6eHrA==:ktGfNmZ6PyD8FNEgPzFK1fypKERZ13pgvFl+PQdyKouaMXsXIiWPuTMXHqDUCWsx'
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index fc8f4a681954e151e67aaf4ddb4d1fdc79cd9895..85289e036b130bbd89ba921e7a343328ce83913e 100644 (file)
@@ -4,9 +4,8 @@ if ("${feature.tls}" == no) {
 }
 
 if (&User-Name == 'pbkdf2_sha2_512') {
-       update control {
-               &Password.PBKDF2 := 'HMACSHA2+512:AAAnEA:TG8Mb94NEmfPLaePwi5CFA==:SYSFeRf9jr4Uo5DB4NvNUEuc1gmEiLjTac5J4WgyKa7mO58KHKWop9xWmcFeuLtUN/iexLTNSgcubOugAyZcog=='
-       }
+       &control.Password.PBKDF2 := 'HMACSHA2+512:AAAnEA:TG8Mb94NEmfPLaePwi5CFA==:SYSFeRf9jr4Uo5DB4NvNUEuc1gmEiLjTac5J4WgyKa7mO58KHKWop9xWmcFeuLtUN/iexLTNSgcubOugAyZcog=='
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 54257f833af60a2cb41af7651f4c798cb10c9661..edbeb9f1823bfc86c1de140aa3a804fbe4fb7a63 100644 (file)
@@ -1,7 +1,5 @@
 if (&User-Name == 'plaintext_with_dollar_0') {
-       update control {
-               &Password.Cleartext := 'password$'
-       }
+       &control.Password.Cleartext := 'password$'
        pap.authorize
        pap.authenticate
        if (!ok) {
index 0eacc8ae55a6f208e66692505a855c7fbb136016..6bfd882555d94781c1e994adfb63374caca17310 100644 (file)
@@ -1,7 +1,6 @@
 if (&User-Name == 'plaintext_with_dollar_1') {
-       update control {
-               &Password.Cleartext := '$password'
-       }
+       &control.Password.Cleartext := '$password'
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index e4eec711fcac5f9aefebab46dcfb31a0a4a911a7..2989671d6029909a698500839e95b3fa028165a5 100644 (file)
@@ -1,7 +1,6 @@
 if (&User-Name == 'plaintext_with_dollar_2') {
-       update control {
-               &Password.Cleartext := 'pass$word'
-       }
+       &control.Password.Cleartext := 'pass$word'
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index cf13d5a8aac9c7028e40b1407e939b74221f00f4..0180251dcf0ec1042610b5eb6b90d7ccbc817b17 100644 (file)
@@ -1,7 +1,6 @@
 if (&User-Name == 'plaintext_with_dollar_3') {
-       update control {
-               &Password.Cleartext := '$pass$word'
-       }
+       &control.Password.Cleartext := '$pass$word'
+
        pap.authorize
        pap.authenticate
        if (!ok) {
index 1a144daf9ee503afb5aad701792aaa3b5da5d913..69f742549b7638aef256a700769f89cb271c476f 100644 (file)
@@ -10,14 +10,10 @@ if (&reply.Reply-Message != "Denied access by rlm_perl function") {
     test_fail
 }
 
-update reply {
-    &Reply-Message !* ANY
-}
+&reply -= &Reply-Message[*]
 
 #  User will not be rejected - an xlat will be called setting a reply attribute
-update request {
-    &User-Name := 'bob'
-}
+&User-Name := 'bob'
 
 perl.authenticate
 
index d5045ea9bf3e34b0beb222793f827fe7ff2ed04f..4dbeb32a92bb2f18f8d9818db907eada15c3cd0f 100644 (file)
@@ -7,87 +7,66 @@
 #  once multiple retuned boxes are handled to produce multiple attributes the tests
 #  will need amending.
 
-update request {
-       &Tmp-String-0 := "hello,goodbye,welcome,farewell"
-       &Tmp-String-1 := "foo,bar"
-}
-update request{
-       &Tmp-String-2 := "%(perl_xlat:xlat %{Tmp-String-0})"
-}
+&Tmp-String-0 := "hello,goodbye,welcome,farewell"
+&Tmp-String-1 := "foo,bar"
+&Tmp-String-2 := "%(perl_xlat:xlat %{Tmp-String-0})"
 
 if (&Tmp-String-2 != "hello|goodbye|welcome|farewell") {
        test_fail
 }
 
 # Check for multiple arguments to perl function
-update request {
-       &Tmp-String-3 := "%(perl_xlat:xlat %{Tmp-String-0} %{Tmp-String-1})"
-}
+&Tmp-String-3 := "%(perl_xlat:xlat %{Tmp-String-0} %{Tmp-String-1})"
 
 if (&Tmp-String-3 != "hello|goodbye|welcome|farewell#foo|bar") {
        test_fail
 }
 
-update request {
-       &Tmp-Integer-0 := "%(perl_xlat:add 1 2 3)"
-}
+&Tmp-Integer-0 := "%(perl_xlat:add 1 2 3)"
 
 if (&Tmp-Integer-0 != 6) {
        test_fail
 }
 
-
-update request {
-       &Tmp-String-0 := "hello"
-       &Tmp-String-0 += "goodbye"
-       &Tmp-String-0 += "welcome"
+&Tmp-String-0 := "hello"
+&request += {
+       &Tmp-String-0 = "goodbye"
+       &Tmp-String-0 = "welcome"
 }
 
 # Pass a list as an array
-update request {
-       &Tmp-String-2 := "%(perl_xlat:xlatarray %{Tmp-String-0[*]})"
-}
+&Tmp-String-2 := "%(perl_xlat:xlatarray %{Tmp-String-0[*]})"
 
 if (&Tmp-String-2 != "hello|goodbye|welcome") {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := "aa bb cc dd ee"
-}
+&Tmp-String-0 := "aa bb cc dd ee"
 
 # Expect an array of returned values
-update request {
-       &Tmp-String-2 := "%(perl_xlat:xlatscalar2array %{Tmp-String-0})"
-}
+&Tmp-String-2 := "%(perl_xlat:xlatscalar2array %{Tmp-String-0})"
 
 if (&Tmp-String-2 != "aabbccddee") {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 := "ff gg hh ii"
-}
+&Tmp-String-1 := "ff gg hh ii"
 
 # Expect an array of array ref returned values
-update request {
-       &Tmp-String-2 := "%(perl_xlat:xlatscalar2arrayref %{Tmp-String-0} %{Tmp-String-1})"
-}
+&Tmp-String-2 := "%(perl_xlat:xlatscalar2arrayref %{Tmp-String-0} %{Tmp-String-1})"
 
 if (&Tmp-String-2 != "aabbccddeeffgghhii") {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := "a"
-       &Tmp-String-0 += "b"
-       &Tmp-String-0 += "c"
+&Tmp-String-0 := "a"
+&request += {
+       &Tmp-String-0 = "b"
+       &Tmp-String-0 = "c"
 }
 
 # Returns a hash with each element in the provided array converted to Vn->value
-update request {
-       &Tmp-String-2 := "%(perl_xlat:xlatarray2hash %{Tmp-String-0[*]})"
-}
+&Tmp-String-2 := "%(perl_xlat:xlatarray2hash %{Tmp-String-0[*]})"
 
 # Note: hashes don't have a defined sequence so these are all the possible return values
 if (&Tmp-String-2 != "V1aV2bV3c") && (&Tmp-String-2 != "V1aV3cV2b") && (&Tmp-String-2 != "V2bV1aV3c") && (&Tmp-String-2 != "V2bV3cV1a") && (&Tmp-String-2 != "V3cV1aV2b") && (&Tmp-String-2 != "V3cV2bV1a") {
index 9ef6c0907d5ce679717bf44d9c400fb337476211..5a622a25cb5edb7177d52b267720f0b60cd2f858 100644 (file)
@@ -10,11 +10,9 @@ $INCLUDE cluster_reset.inc
 #  - 127.0.0.1:30005 - slave
 #  - 127.0.0.1:30003 - master [10923-16383]
 #  - 127.0.0.1:30006 - slave
-update control {
-       &Tmp-String-0 := "1-%{randstr:aaaaaaaa}"
-       &Tmp-String-1 := "2-%{randstr:aaaaaaaa}"
-       &Tmp-String-2 := "3-%{randstr:aaaaaaaa}"
-}
+&control.Tmp-String-0 := "1-%{randstr:aaaaaaaa}"
+&control.Tmp-String-1 := "2-%{randstr:aaaaaaaa}"
+&control.Tmp-String-2 := "3-%{randstr:aaaaaaaa}"
 
 #  Hashes to Redis cluster node master 1 (1)
 if ("%(redis:SET b "%{control.Tmp-String-0}")" == 'OK') {
index 56cdc9949f2f9613027009779f74dca5bae8137f..1d8b0b2e9811fe388ff98383ad23eac2d5ad6035 100644 (file)
@@ -11,9 +11,7 @@ if ("%(redis:SET b 'boom')" == 'OK') {
 }
 
 #  Leave some time (100ms) for the synchronisation
-update request {
-       &Tmp-String-0 := `/bin/sleep 0.1`
-}
+&Tmp-String-0 := `/bin/sleep 0.1`
 
 #  Cause one of the redis cluster nodes to SEGV
 if ("%(redis:@%(redis_node:b 0) DEBUG SEGFAULT)" != '') {
index 63bb51a3c75bb90dfbcbe7cfe20146a423f1dcc3..0a063bdcbce32939dff7feb7438dbbeff0c7aecc 100644 (file)
@@ -3,53 +3,45 @@
 #
 
 # Some values we need for startup
-update control {
-       &Tmp-Integer-0 := 0
-       &Tmp-Integer-0 += 1
-       &Tmp-Integer-0 += 2
-       &Tmp-Integer-0 += 3
-       &Tmp-Integer-0 += 4
-       &Tmp-Integer-0 += 5
-       &Tmp-Integer-0 += 6
-       &Tmp-Integer-0 += 7
-       &Tmp-Integer-0 += 8
-       &Tmp-Integer-0 += 9
-       &Tmp-Integer-0 += 10
-       &Tmp-String-0 := "1-%{randstr:aaaaaaaa}"
-       &Tmp-String-1 := "2-%{randstr:aaaaaaaa}"
-       &Tmp-String-2 := "3-%{randstr:aaaaaaaa}"
+&control += {
+       &Tmp-Integer-0 = 0
+       &Tmp-Integer-0 = 1
+       &Tmp-Integer-0 = 2
+       &Tmp-Integer-0 = 3
+       &Tmp-Integer-0 = 4
+       &Tmp-Integer-0 = 5
+       &Tmp-Integer-0 = 6
+       &Tmp-Integer-0 = 7
+       &Tmp-Integer-0 = 8
+       &Tmp-Integer-0 = 9
+       &Tmp-Integer-0 = 10
 }
 
+&control.Tmp-String-0 := "1-%{randstr:aaaaaaaa}"
+&control.Tmp-String-1 := "2-%{randstr:aaaaaaaa}"
+&control.Tmp-String-2 := "3-%{randstr:aaaaaaaa}"
+
 if ("$ENV{REDIS_CLUSTER_CONTROL}" == '') {
-       update control {
-               &Tmp-String-8 := 'scripts/ci/redis-setup.sh'
-       }
+       &control.Tmp-String-8 := 'scripts/ci/redis-setup.sh'
 } else {
-       update control {
-               &Tmp-String-8 := "$ENV{REDIS_CLUSTER_CONTROL}"
-       }
+       &control.Tmp-String-8 := "$ENV{REDIS_CLUSTER_CONTROL}"
 }
 
 #
 #  Reset the cluster
 #
-update control {
-       &Tmp-String-0 = `%{control.Tmp-String-8} stop`
-       &Tmp-String-0 = `%{control.Tmp-String-8} clean`
-       &Tmp-String-0 = `%{control.Tmp-String-8} start`
-       &Tmp-String-0 = `%{control.Tmp-String-8} create`
-}
+&control.Tmp-String-0 := `%{control.Tmp-String-8} stop`
+&control.Tmp-String-0 := `%{control.Tmp-String-8} clean`
+&control.Tmp-String-0 := `%{control.Tmp-String-8} start`
+&control.Tmp-String-0 := `%{control.Tmp-String-8} create`
 
 #
 #  Determine when initial synchronisation has been completed
 #
-update request {
-       &Tmp-String-0 := $ENV{REDIS_TEST_SERVER}
-}
+&Tmp-String-0 := $ENV{REDIS_TEST_SERVER}
+
 if (!&Tmp-String-0 || (&Tmp-String-0 == '')) {
-       update request {
-               &Tmp-String-0 := "$ENV{REDIS_IPPOOL_TEST_SERVER}"
-       }
+       &Tmp-String-0 := "$ENV{REDIS_IPPOOL_TEST_SERVER}"
 }
 
 #  Test nodes should be running on
@@ -81,14 +73,10 @@ foreach &control.Tmp-Integer-0 {
                }
        }
 
-       update request {
-               &Module-Failure-Message !* ANY
-       }
+       &request -= &Module-Failure-Message[*]
 
        # Perform checks every 0.5 seconds
-       update {
-               &Tmp-Integer-0 := `/bin/sleep 0.5`
-       }
+       &Tmp-Integer-0 := `/bin/sleep 0.5`
 
        if ("%{Foreach-Variable-0}" == 10) {
                test_fail
index cde0308a2a1c59ea0fcd646bf8b48ef6fb862152..b56ccbb53de879226a86f5017587ae8b228a2aee 100644 (file)
@@ -3,16 +3,12 @@
 #
 $INCLUDE cluster_reset.inc
 
-update control {
-       &IP-Pool.Name := 'test_alloc'
-}
+&control.IP-Pool.Name := 'test_alloc'
 
 #
 #  Add IP addresses
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 
 #
 #  Check allocation
@@ -33,9 +29,7 @@ if (&reply.Framed-IP-Address == 192.168.0.1) {
 #
 #  Check ZSCORE
 #
-update request {
-       &Tmp-Date-0 := "%l"
-}
+&Tmp-Date-0 := "%l"
 
 if ("%{expr:%(redis:ZSCORE "{%{control.IP-Pool.Name}}:pool" %{reply.Framed-IP-Address}) - %(integer:%{Tmp-Date-0})}" > 20) {
        test_pass
@@ -94,19 +88,15 @@ if (&reply.Session-Timeout == 30) {
        test_fail
 }
 
-update {
-       &request.IP-Pool.Range := &reply.IP-Pool.Range
-       &request.Framed-IP-Address := &reply.Framed-IP-Address
-       &request.Session-Timeout := &reply.Session-Timeout # We should get the same lease time
-       &reply !* ANY
-}
+&IP-Pool.Range := &reply.IP-Pool.Range
+&Framed-IP-Address := &reply.Framed-IP-Address
+&Session-Timeout := &reply.Session-Timeout # We should get the same lease time
+&reply := {}
 
 #
 #  Add IP addresses
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.1.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.1.0`
 
 #
 #  Check we get the same lease, with the same lease time
@@ -121,7 +111,7 @@ if (updated) {
 #
 #  Check the ranges are the same
 #
-if (&request.IP-Pool.Range == &reply.IP-Pool.Range) {
+if (&IP-Pool.Range == &reply.IP-Pool.Range) {
        test_pass
 } else {
        test_fail
@@ -130,7 +120,7 @@ if (&request.IP-Pool.Range == &reply.IP-Pool.Range) {
 #
 #  Check the IP addresses are the same
 #
-if (&request.Framed-IP-Address == &reply.Framed-IP-Address) {
+if (&Framed-IP-Address == &reply.Framed-IP-Address) {
        test_pass
 } else {
        test_fail
@@ -142,22 +132,18 @@ if (&request.Framed-IP-Address == &reply.Framed-IP-Address) {
 #  The fudge factor is to allow for delays running ippool tool and script interpretation
 #  as we should be allocating the same lesase as before, but its TTL could be slightly lower.
 #
-if ("%{expr:&request.Session-Timeout - &reply.Session-Timeout}" < 5) {
+if ("%{expr:&Session-Timeout - &reply.Session-Timeout}" < 5) {
        test_pass
 } else {
        test_fail
 }
 
-update {
-       &reply !* ANY
-}
+&reply := {}
 
 #
 #  Now change the Calling-Station-ID and check we get a different lease
 #
-update request {
-       &Calling-Station-ID := 'another_mac'
-}
+&Calling-Station-ID := 'another_mac'
 
 redis_ippool
 if (updated) {
@@ -175,6 +161,4 @@ if (&reply.Framed-IP-Address == 192.168.1.1) {
        test_fail
 }
 
-update {
-       &reply !* ANY
-}
+&reply := {}
index 8fd75e77d078f73bee63794543b43c9b0114a85e..c2f5840ae3bcd2aa4b3950a5ceca2dc360e55086 100644 (file)
@@ -3,16 +3,12 @@
 #
 $INCLUDE cluster_reset.inc
 
-update control {
-       &IP-Pool.Name := 'test_delete'
-}
+&control.IP-Pool.Name := 'test_delete'
 
 #
 #  Add IP addresses
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 
 #
 #  Check allocation
@@ -35,9 +31,7 @@ if (&reply.Framed-IP-Address == 192.168.0.1) {
 #
 #  Delete the IP address
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -d 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -d 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 
 #
 #  Verify the association with the device has been removed
@@ -64,6 +58,4 @@ if ("%(redis:ZCOUNT {%{control.IP-Pool.Name}%}:pool -inf +inf)" == 0) {
        test_fail
 }
 
-update {
-       &reply !* ANY
-}
+&reply := {}
index daae378669948ae8939fd299ef869e0276198e12..89eaf9a8732ae71d6e0439c78e619dc70162a414 100644 (file)
@@ -3,16 +3,12 @@
 #
 $INCLUDE cluster_reset.inc
 
-update control {
-       &IP-Pool.Name := 'test_update'
-}
+&control.IP-Pool.Name := 'test_update'
 
 #
 #  Add IP addresses
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 
 #
 #  Verify the range was set OK
@@ -26,9 +22,7 @@ if ("%(redis:HGET {%{control.IP-Pool.Name}}:ip:192.168.0.1 range)" == '192.168.0
 #
 #  Modify the range
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -m 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 10.0.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -m 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 10.0.0.0`
 
 #
 #  Check it was updated
index cb10f242b7a08945fbccd96c5ba8d1d42dbf2e3f..2621275b9c315dc6319b79e608f8b17fbbf5e8e6 100644 (file)
@@ -3,16 +3,12 @@
 #
 $INCLUDE cluster_reset.inc
 
-update control {
-       &IP-Pool.Name := 'test_update'
-}
+&control.IP-Pool.Name := 'test_update'
 
 #
 #  Add IP addresses
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 
 #
 #  Check allocation
@@ -35,9 +31,7 @@ if (&reply.Framed-IP-Address == 192.168.0.1) {
 #
 #  Release the IP address
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -r 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -r 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 
 #
 #  Verify the association with the device has been removed
@@ -76,6 +70,4 @@ if ("%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address})"
        test_fail
 }
 
-update {
-       &reply !* ANY
-}
+&reply := {}
index 6e0b3e1ff70456cc69b5e25a86207888b31587fa..edf7851b32695c5745815533d93385c963725d03 100644 (file)
@@ -3,16 +3,12 @@
 #
 $INCLUDE cluster_reset.inc
 
-update control {
-       &IP-Pool.Name := 'test_update'
-}
+&control.IP-Pool.Name := 'test_update'
 
 #
 #  Add IP addresses
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 
 #
 #  Check allocation
@@ -35,10 +31,9 @@ if (&reply.Framed-IP-Address == 192.168.0.1) {
 #
 #  Release the IP address
 #
-update {
-       &request.Framed-IP-Address := &reply.Framed-IP-Address
-       &control.IP-Pool.Action := Release
-}
+&Framed-IP-Address := &reply.Framed-IP-Address
+&control.IP-Pool.Action := Release
+
 redis_ippool {
        invalid = 1
 }
@@ -79,9 +74,7 @@ if ("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} range)
 }
 
 # Check the ZSCORE
-update request {
-       &Tmp-Date-0 := "%l"
-}
+&Tmp-Date-0 := "%l"
 
 if ("%{expr:%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) - %(integer:%{Tmp-Date-0})}" > 0) {
        test_pass
@@ -98,10 +91,9 @@ if ("%{expr:%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Addr
 #
 #  Release the IP address again (should still be fine)
 #
-update {
-       &request.Framed-IP-Address := &reply.Framed-IP-Address
-       &control.IP-Pool.Action := Release
-}
+&Framed-IP-Address := &reply.Framed-IP-Address
+&control.IP-Pool.Action := Release
+
 redis_ippool {
        invalid = 1
 }
@@ -111,6 +103,4 @@ if (updated) {
        test_fail
 }
 
-update reply {
-       &reply !* ANY
-}
+&reply := {}
index acff7616d058bc6071c3e7332a8fcee9b4a8b5e7..3e028ab057183b52aedb5d98545c9d0c62ed1c37 100644 (file)
@@ -3,16 +3,12 @@
 #
 $INCLUDE cluster_reset.inc
 
-update control {
-       &IP-Pool.Name := 'test_update'
-}
+&control.IP-Pool.Name := 'test_update'
 
 #
 #  Add IP addresses
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 
 # 1. Check allocation
 redis_ippool
@@ -44,16 +40,13 @@ if ("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} gatewa
 }
 
 # 5. Add another IP addresses
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.1.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.1.0`
 
 # 6. Verify that the lease time is extended
-update {
-       &request.Framed-IP-Address := &reply.Framed-IP-Address
-       &request.NAS-IP-Address := 127.0.0.2
-       &control.IP-Pool.Action := Renew
-}
+&Framed-IP-Address := &reply.Framed-IP-Address
+&NAS-IP-Address := 127.0.0.2
+&control.IP-Pool.Action := Renew
+
 redis_ippool
 if (updated) {
        test_pass
@@ -69,9 +62,7 @@ if (&reply.Session-Timeout == 60) {
 }
 
 # 8. Check ZSCORE reflects that
-update request {
-       &Tmp-Date-0 := "%l"
-}
+&Tmp-Date-0 := "%l"
 
 if ("%{expr:%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) - %(integer:%{Tmp-Date-0})}" > 50) {
        test_pass
@@ -101,7 +92,7 @@ if ("%(redis:TTL {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID})" == 60)
 }
 
 # 12. Verify the gateway was updated
-if ("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{request.Framed-IP-Address} gateway)" == '127.0.0.2') {
+if ("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{Framed-IP-Address} gateway)" == '127.0.0.2') {
        test_pass
 } else {
        test_fail
@@ -115,9 +106,8 @@ if (&reply.IP-Pool.Range && (&reply.IP-Pool.Range == '192.168.0.0')) {
 }
 
 # Change the ip address to one that doesn't exist in the pool and check we *can't* update it
-update request {
-       &request.Framed-IP-Address := 192.168.3.1
-}
+&Framed-IP-Address := 192.168.3.1
+
 redis_ippool {
        invalid = 1
 }
@@ -127,14 +117,11 @@ if (notfound) {
 } else {
        test_fail
 }
-update request {
-       &request.Framed-IP-Address := 192.168.0.1
-}
+&Framed-IP-Address := 192.168.0.1
 
 # 15. Now change the calling station ID and check that we *can't* update the lease
-update request {
-       &Calling-Station-ID := 'naughty'
-}
+&Calling-Station-ID := 'naughty'
+
 redis_ippool {
        invalid = 1
 }
@@ -151,6 +138,4 @@ if (&reply.Framed-IP-Address == "%(redis:GET {%{control.IP-Pool.Name}}:device:00
        test_fail
 }
 
-update {
-       &reply !* ANY
-}
+&reply := {}
index f069c4fb5b8031dc0811e9f75e640925751c3a68..dba651059429d3cdb66bb6997a00ecb5ff339864 100644 (file)
@@ -3,16 +3,12 @@
 #
 $INCLUDE cluster_reset.inc
 
-update control {
-       &IP-Pool.Name := 'test_update'
-}
+&control.IP-Pool.Name := 'test_update'
 
 #
 #  Add IP addresses
 #
-update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
-}
+&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 
 # 1. Check allocation
 redis_ippool
@@ -25,11 +21,10 @@ if (updated) {
 #
 #  Attempt to reserve an IP address by performing a renew
 #
-update {
-       &request.Framed-IP-Address := 192.168.0.1
-       &request.NAS-IP-Address := 127.0.0.1
-       &control.IP-Pool.Action := Renew
-}
+&Framed-IP-Address := 192.168.0.1
+&NAS-IP-Address := 127.0.0.1
+&control.IP-Pool.Action := Renew
+
 redis_ippool
 
 # 3. Check the expiry attribute is present and correct
@@ -53,6 +48,4 @@ if (&reply.Framed-IP-Address == 192.168.0.1) {
        test_fail
 }
 
-update {
-       &reply !* ANY
-}
+&reply := {}
index fd01b9923bb2d3cb1df06242761fcf9b9ef0b263..3206e691bb3ff3506aafaf6f02baa086c16eaf50 100644 (file)
@@ -1,7 +1,5 @@
 # Pre-set Tmp-String-2 to check correct operator behaviour
-update control {
-       &Tmp-String-2 := "foo"
-}
+&control.Tmp-String-2 := "foo"
 
 # Test "authorize" rest call.  Uses http to a GET end point
 rest
@@ -34,16 +32,12 @@ if ((&control.Tmp-String-2[0] != "Bob") || (&control.Tmp-String-2[1] != "foo"))
 }
 
 # Reset control attributes
-update control {
-       &Tmp-String-0 !* ANY
-       &Tmp-String-1 !* ANY
-       &User-Name !* ANY
-}
+&control -= &Tmp-String-0[*]
+&control -= &Tmp-String-1[*]
+&control -= &User-Name[*]
 
 # Pre-fill NAS-IP-Address to check operator behaviour
-update control {
-       &NAS-IP-Address := "10.0.0.10"
-}
+&control.NAS-IP-Address := "10.0.0.10"
 
 # Test "accounting" rest call.  Uses https to a POST end point
 rest.accounting
index 178c5e29ca0848e69bcbe042a6d025a3eb14d864..aca84409363a3354b1074d3c1670a8ca12a6c63f 100644 (file)
@@ -2,17 +2,13 @@
 # PRE rest_module eval
 #
 
-update request {
-       &Tmp-String-0 := "$ENV{REST_TEST_SERVER}"
-       &Tmp-Integer-0 := "$ENV{REST_TEST_SERVER_PORT}"
-       &Tmp-Integer-1 := "$ENV{REST_TEST_SERVER_SSL_PORT}"
-       &Tmp-String-1 := "notfound"
-}
+&Tmp-String-0 := "$ENV{REST_TEST_SERVER}"
+&Tmp-Integer-0 := "$ENV{REST_TEST_SERVER_PORT}"
+&Tmp-Integer-1 := "$ENV{REST_TEST_SERVER_SSL_PORT}"
+&Tmp-String-1 := "notfound"
 
 # Retrieve a plain text file
-update control {
-       &Tmp-String-1 := "%(rest:GET http://%{Tmp-String-0}:%{Tmp-Integer-0}/test.txt)"
-}
+&control.Tmp-String-1 := "%(rest:GET http://%{Tmp-String-0}:%{Tmp-Integer-0}/test.txt)"
 
 if (&REST-HTTP-Status-Code != 200) {
        test_fail
@@ -23,36 +19,28 @@ if (&control.Tmp-String-1 != "Sample text response\n") {
 }
 
 # Take host from incomming packet
-update control {
-       &Tmp-String-1 := "%(rest:http://%{Login-IP-Host}:%{Tmp-Integer-0}/test.txt)"
-}
+&control.Tmp-String-1 := "%(rest:http://%{Login-IP-Host}:%{Tmp-Integer-0}/test.txt)"
 
 if ((&REST-HTTP-Status-Code != 200) || (&control.Tmp-String-1 != "Sample text response\n")) {
        test_fail
 }
 
 # Port is not allowed from incomming packet
-update control {
-       &Tmp-String-1 := "%(rest:http://%{Tmp-String-0}:%{NAS-Port}/test.txt)"
-}
+&control.Tmp-String-1 := "%(rest:http://%{Tmp-String-0}:%{NAS-Port}/test.txt)"
 
 if ((&Module-Failure-Message != "Failed escaping URI: Tainted value not allowed for port") || (&control.Tmp-String-1 != "")) {
        test_fail
 }
 
 # Check a "not found" gives a 404 status code
-update control {
-       &Tmp-String-1 := "%(rest:GET http://%{Tmp-String-0}:%{Tmp-Integer-0}/%{Tmp-String-1})"
-}
+&control.Tmp-String-1 := "%(rest:GET http://%{Tmp-String-0}:%{Tmp-Integer-0}/%{Tmp-String-1})"
 
 if (&REST-HTTP-Status-Code != 404) {
        test_fail
 }
 
 # GET with URL parameters
-update request {
-       &Tmp-String-2 := "%(rest:GET http://%{Tmp-String-0}:%{Tmp-Integer-0}/user/%{User-Name}/mac/%{Called-Station-Id})"
-}
+&Tmp-String-2 := "%(rest:GET http://%{Tmp-String-0}:%{Tmp-Integer-0}/user/%{User-Name}/mac/%{Called-Station-Id})"
 
 if (&REST-HTTP-Status-Code != 200) {
        test_fail
@@ -71,9 +59,7 @@ if (&control.User-Name != "Bob") {
        test_fail
 }
 
-update control {
-       &Tmp-String-3 := 'dummy'
-}
+&control.Tmp-String-3 := 'dummy'
 
 # Directly use json map and prepend the returned value
 map json "%(rest:GET http://%{Tmp-String-0}:%{Tmp-Integer-0}/user/%{User-Name}/mac/%{Called-Station-Id})" {
@@ -84,14 +70,10 @@ if ((&control.Tmp-String-3[0] != 'Bob') || (&control.Tmp-String-3[1] != 'dummy')
        test_fail
 }
 
-update control {
-       &Tmp-String-2 = "%{json_encode:&request.NAS-IP-Address}"
-}
+&control.Tmp-String-2 = "%{json_encode:&NAS-IP-Address}"
 
 # POST to https with JSON body data
-update request {
-       &Tmp-String-2 := "%(rest:POST https://%{Tmp-String-0}:%{Tmp-Integer-1}/user/%{User-Name}/mac/%{Called-Station-Id}?section=accounting %{control.Tmp-String-2})"
-}
+&Tmp-String-2 := "%(rest:POST https://%{Tmp-String-0}:%{Tmp-Integer-1}/user/%{User-Name}/mac/%{Called-Station-Id}?section=accounting %{control.Tmp-String-2})"
 
 if (&REST-HTTP-Status-Code != 200) {
        test_fail
@@ -115,14 +97,10 @@ if (&control.NAS-IP-Address != "192.168.1.1") {
        test_fail
 }
 
-update control {
-       &Tmp-String-2 := "NAS=%{NAS-IP-Address}&user=%{User-Name}"
-}
+&control.Tmp-String-2 := "NAS=%{NAS-IP-Address}&user=%{User-Name}"
 
 # POST to https with POST body data
-update request {
-       &Tmp-String-2 := "%(rest:POST https://%{Tmp-String-0}:%{Tmp-Integer-1}/post/test?section=dummy %{control.Tmp-String-2})"
-}
+&Tmp-String-2 := "%(rest:POST https://%{Tmp-String-0}:%{Tmp-Integer-1}/post/test?section=dummy %{control.Tmp-String-2})"
 
 if (&REST-HTTP-Status-Code != 200) {
        test_fail
@@ -134,31 +112,22 @@ if (&Tmp-String-2 != "Section: dummy, User: Bob\n") {
 
 # URI with tainted values in the arguments - input argument includes URI argument
 # separator - make sure this doesn't end up generating extra arguments, but gets escaped.
-update request {
-       &Tmp-String-2 := "%(rest:GET http://%{Tmp-String-0}:%{Tmp-Integer-0}/user/%{User-Name}/reflect/?station=%{Calling-Station-Id})"
-}
+&Tmp-String-2 := "%(rest:GET http://%{Tmp-String-0}:%{Tmp-Integer-0}/user/%{User-Name}/reflect/?station=%{Calling-Station-Id})"
 
 if (&Tmp-String-2 != "{\"station\":\"dummy&unsafe=escaped\"}\n" ) {
        test_fail
 }
 
 # Zero length untainted value - check parsing doesn't break on zero length string
-update request {
-       &Tmp-String-8 := ""
-}
-
-update request {
-       &Tmp-String-2 := "%(rest:http://%{Tmp-String-0}:%{Tmp-Integer-0}/user/%{User-Name}/reflect/%{Tmp-String-8}?station=%{User-Name})"
-}
+&Tmp-String-8 := ""
+&Tmp-String-2 := "%(rest:http://%{Tmp-String-0}:%{Tmp-Integer-0}/user/%{User-Name}/reflect/%{Tmp-String-8}?station=%{User-Name})"
 
 if (&Tmp-String-2 != "{\"station\":\"Bob\"}\n" ) {
        test_fail
 }
 
 # Zero length tainted value - check escaping doesn't break on zero length string
-update request {
-       &Tmp-String-2 := "%(rest:http://%{Tmp-String-0}:%{Tmp-Integer-0}/user/%{User-Name}/reflect/%{Tmp-String-9}?station=%{Called-Station-Id})"
-}
+&Tmp-String-2 := "%(rest:http://%{Tmp-String-0}:%{Tmp-Integer-0}/user/%{User-Name}/reflect/%{Tmp-String-9}?station=%{Called-Station-Id})"
 
 if (&Tmp-String-2 != "{\"station\":\"aa:bb:cc:dd:ee:ff\"}\n" ) {
        test_fail
index d1e52073f582efd35ac830b0d1d32c6e2ec4af66..ce3a41fa2c8eef47ebc84b096354b2660eecf49f 100644 (file)
@@ -1,18 +1,16 @@
+&request += {
+       &SMTP-Mail-Header = "x-test-Subject: smtp test"
+       &SMTP-Mail-Body = "sent from the smtp test module\r\n"
 
+       &SMTP-Recipients = "smtp_attachment_receiver@localhost"
 
-update request {
-       &SMTP-Mail-Header += "x-test-Subject: smtp test"
-       &SMTP-Mail-Body += "sent from the smtp test module\r\n"
+       &SMTP-TO = "smtp_to_1@localhost"
+       &SMTP-TO = "smtp_to_2@localhost"
 
-       &SMTP-Recipients += "smtp_attachment_receiver@localhost"
+       &SMTP-CC = "smtp_cc_1@localhost"
+       &SMTP-CC = "smtp_cc_2@localhost"
 
-       &SMTP-TO += "smtp_to_1@localhost"
-       &SMTP-TO += "smtp_to_2@localhost"
-
-       &SMTP-CC += "smtp_cc_1@localhost"
-       &SMTP-CC += "smtp_cc_2@localhost"
-
-       &SMTP-Attachments += "testfile"
+       &SMTP-Attachments = "testfile"
 }
 smtp.authorize
 
@@ -38,9 +36,7 @@ echo $?"` == "1") {
 if (`/bin/sh -c "cat build/ci/exim4/mail/smtp_attachment_receiver | \
 grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' | base64 -d | tr -d '\r\n' | \
 grep -f build/ci/exim4/testfile"`){
-       update control {
-               &Auth-Type := Accept
-       }
+       &control.Auth-Type := Accept
 }
 else {
        reject
index ef676706fca42e5af3636495d513e0e449f99ff7..2b001957cb0e8153150fc76812e173335d8bb243 100644 (file)
@@ -1,24 +1,22 @@
-update request {
-       &SMTP-Mail-Header += "Subject: smtp test"
-       &SMTP-Mail-Header += "FROM: smtp_sender@gmail.com"
-       &SMTP-Mail-Header += "TO: smtp_receiver@localhost"
-       &SMTP-Mail-Body += "sent from the smtp test module\r\n"
-       &SMTP-Sender-Address += "smtp_sender@localhost"
-       &SMTP-Recipients += "smtp_receiver@localhost"
-       &SMTP-Attachments += "testfile"
+&request += {
+       &SMTP-Mail-Header = "Subject: smtp test"
+       &SMTP-Mail-Header = "FROM: smtp_sender@gmail.com"
+       &SMTP-Mail-Header = "TO: smtp_receiver@localhost"
+       &SMTP-Mail-Body = "sent from the smtp test module\r\n"
+       &SMTP-Sender-Address = "smtp_sender@localhost"
+       &SMTP-Recipients = "smtp_receiver@localhost"
+       &SMTP-Attachments = "testfile"
 }
 smtp.authenticate
 
 if(ok) {
-       update control {
-               &Auth-Type := Accept
-       }
+       &control.Auth-Type := Accept
 }
 else {
        reject
 }
 
-if (&request.TLS-Certificate.Issuer =~ /@example\.org/) {
+if (&TLS-Certificate.Issuer =~ /@example\.org/) {
         test_pass
 } else {
        test_fail
index 6383b633e471e6ca24bea124868869da0bec1f7a..c75a03827a4cde4b232b18dbb637dac763b59b75 100644 (file)
@@ -1,14 +1,14 @@
-update request {
-       &SMTP-Mail-Body += "sent from the smtp test module\r\n"
-       &SMTP-Mail-Body += "\r\n"
-       &SMTP-Mail-Body += "Some Body\r\n"
-       &SMTP-Mail-Body += ".\r\n"
-       &SMTP-Mail-Body += "More Body\r\n"
-       &SMTP-Mail-Body += "."
-       &SMTP-Mail-Body += "Most Body\r\n"
+&request += {
+       &SMTP-Mail-Body = "sent from the smtp test module\r\n"
+       &SMTP-Mail-Body = "\r\n"
+       &SMTP-Mail-Body = "Some Body\r\n"
+       &SMTP-Mail-Body = ".\r\n"
+       &SMTP-Mail-Body = "More Body\r\n"
+       &SMTP-Mail-Body = "."
+       &SMTP-Mail-Body = "Most Body\r\n"
 
-       &SMTP-Recipients += "crln_test_receiver@localhost"
-       &SMTP-Sender-Address += "smtp_sender@localhost"
+       &SMTP-Recipients = "crln_test_receiver@localhost"
+       &SMTP-Sender-Address = "smtp_sender@localhost"
 }
 smtp.authorize
 
@@ -28,15 +28,13 @@ echo $?"` == "1") {
 
 if (`/bin/sh -c "cat build/ci/exim4/mail/crln_test_receiver | \
 grep -E 'Most Body'"`) {
-       update control {
-               &Auth-Type := Accept
-       }
+       &control.Auth-Type := Accept
 }
 else {
        reject
 }
 
-if (&request.TLS-Certificate.Issuer =~ /@example\.org/) {
+if (&TLS-Certificate.Issuer =~ /@example\.org/) {
         test_pass
 } else {
        test_fail
index 959aaa9a3afab2920580f24ec1414eb77aa67288..6f26d3d1ea702cecd99c4bf62729c1159c371592 100644 (file)
@@ -1,11 +1,9 @@
-update request {
-       &SMTP-Mail-Body += "sent from the smtp test module\r\n"
-
-       &SMTP-Recipients += "stringparse_test_receiver@localhost"
-
-       &SMTP-Sender-Address += "smtp_sender@localhost"
-       &SMTP-Sender-Address += "smtp_sender_2@localhost"
-       &SMTP-Sender-Address += "smtp_sender_3@localhost"
+&request += {
+       &SMTP-Mail-Body = "sent from the smtp test module\r\n"
+       &SMTP-Recipients = "stringparse_test_receiver@localhost"
+       &SMTP-Sender-Address = "smtp_sender@localhost"
+       &SMTP-Sender-Address = "smtp_sender_2@localhost"
+       &SMTP-Sender-Address = "smtp_sender_3@localhost"
 }
 smtp.authorize
 
@@ -25,15 +23,13 @@ echo $?"` == "1") {
 
 if (`/bin/sh -c "cat build/ci/exim4/mail/stringparse_test_receiver | \
 grep -E 'Subject: for Bob'"`) {
-       update control {
-               &Auth-Type := Accept
-       }
+       &control.Auth-Type := Accept
 }
 else {
        reject
 }
 
-if (&request.TLS-Certificate.Issuer =~ /@example\.org/) {
+if (&TLS-Certificate.Issuer =~ /@example\.org/) {
         test_pass
 } else {
        test_fail
index b806639600ed89d4b92eb47ba326fa50928e3e85..30e48ecefc511415deb2577840d4dfad8bedac5c 100644 (file)
@@ -1,17 +1,17 @@
-update request {
-       &SMTP-Mail-Header += "x-test-Subject: smtp test"
-       &SMTP-Mail-Body += "sent from the smtp test module\r\n"
+&request += {
+       &SMTP-Mail-Header = "x-test-Subject: smtp test"
+       &SMTP-Mail-Body = "sent from the smtp test module\r\n"
 
-       &SMTP-Recipients += "smtp_delivery_receiver@localhost"
-       &SMTP-Recipients += "smtp_recipient_request@localhost"
+       &SMTP-Recipients = "smtp_delivery_receiver@localhost"
+       &SMTP-Recipients = "smtp_recipient_request@localhost"
 
-       &SMTP-TO += "smtp_to_request_1@localhost"
-       &SMTP-TO += "smtp_to_request_2@localhost"
+       &SMTP-TO = "smtp_to_request_1@localhost"
+       &SMTP-TO = "smtp_to_request_2@localhost"
 
-       &SMTP-CC += "smtp_cc_request_1@localhost"
-       &SMTP-CC += "smtp_cc_request_2@localhost"
+       &SMTP-CC = "smtp_cc_request_1@localhost"
+       &SMTP-CC = "smtp_cc_request_2@localhost"
 
-       &SMTP-Attachments += "testfile"
+       &SMTP-Attachments = "testfile"
 }
 smtp.authorize
 
@@ -56,9 +56,7 @@ done ;"` == "found")) {
 if (`/bin/sh -c "cat build/ci/exim4/mail/smtp_delivery_receiver | \
 grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' | base64 -d | tr -d '\r\n' | \
 grep -f build/ci/exim4/testfile"`){
-       update control {
-               &Auth-Type := Accept
-       }
+       &control.Auth-Type := Accept
 }
 else {
        reject
index 45da5fdf84a6e8f917fd4da4f742f093e32d3a05..58909717297a611222e17615e78778892361bea7 100644 (file)
@@ -35,9 +35,8 @@ if ("%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000003'}
 #
 #  Change acctsessiontime and verify it's updated
 #
-update request {
-       &Connect-Info = 'updated'
-}
+&Connect-Info = 'updated'
+
 sql.accounting
 if (ok) {
        test_pass
index d95019848f9171920ab53456c1fc5010481b6073..6f03ee19f1f8944bfa2b7249b128c7383479357a 100644 (file)
@@ -86,9 +86,7 @@ else {
 #
 #  Test paircmp group comparisons with dynamic expansions
 #
-update request {
-       &Tmp-String-0 := 'groups_group_b'
-}
+&Tmp-String-0 := 'groups_group_b'
 
 if (&SQL-Group == "%{Tmp-String-0}") {
        test_pass
index 69831909a8f096b5e4120b9d530a74a966aad96d..e3521d013a30d32eb29130892abfcb8e7b1db5f4 100644 (file)
@@ -74,11 +74,9 @@ else {
 }
 
 # Clear the control list
-update {
-       &control.Tmp-String-0 !* ANY
-       &control.Tmp-String-1 !* ANY
-       &control.Tmp-Integer-0 !* ANY
-}
+&control -= &Tmp-String-0[*]
+&control -= &Tmp-String-1[*]
+&control -= &Tmp-Integer-0[*]
 
 # Insert our second test row
 "%{sql:INSERT INTO radusergroup (username, groupname, priority) VALUES ('oof', 'rab', 0)}"
@@ -119,11 +117,9 @@ else {
 }
 
 # Clear the control list
-update {
-       &control.Tmp-String-0 !* ANY
-       &control.Tmp-String-1 !* ANY
-       &control.Tmp-Integer-0 !* ANY
-}
+&control -= &Tmp-String-0[*]
+&control -= &Tmp-String-1[*]
+&control -= &Tmp-Integer-0[*]
 
 # Retrieve our test row(s) - With = we should get the values from the first row
 map sql 'SELECT * FROM radusergroup WHERE priority = 0' {
@@ -161,11 +157,9 @@ else {
 }
 
 # Clear the control list
-update {
-       &control.Tmp-String-0 !* ANY
-       &control.Tmp-String-1 !* ANY
-       &control.Tmp-Integer-0 !* ANY
-}
+&control -= &Tmp-String-0[*]
+&control -= &Tmp-String-1[*]
+&control -= &Tmp-Integer-0[*]
 
 # Retrieve our test row(s) - With ^= we should get the values from the second row then the first
 map sql 'SELECT * FROM radusergroup WHERE priority = 0' {
@@ -193,11 +187,9 @@ if ((&control.Tmp-Integer-0[0] != 0) || (&control.Tmp-Integer-0[1] != 0)) {
 }
 
 # Clear the control list
-update {
-       &control.Tmp-String-0 !* ANY
-       &control.Tmp-String-1 !* ANY
-       &control.Tmp-Integer-0 !* ANY
-}
+&control -= &Tmp-String-0[*]
+&control -= &Tmp-String-1[*]
+&control -= &Tmp-Integer-0[*]
 
 # Retrieve our test row(s) - With += we should get the values from both rows
 map sql 'SELECT * FROM radusergroup WHERE priority = 0' {
@@ -249,11 +241,9 @@ else {
 }
 
 # Clear the control list
-update {
-       &control.Tmp-String-0 !* ANY
-       &control.Tmp-String-1 !* ANY
-       &control.Tmp-Integer-0 !* ANY
-}
+&control -= &Tmp-String-0[*]
+&control -= &Tmp-String-1[*]
+&control -= &Tmp-Integer-0[*]
 
 # Retrieve the username column only (should result in noop because not in map)
 map sql 'SELECT username FROM radusergroup WHERE priority = 0' {
@@ -303,16 +293,12 @@ else {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := "SELECT * FROM radusergroup WHERE priority = 0 AND username = '%{User-Name}'"
-}
+&Tmp-String-0 := "SELECT * FROM radusergroup WHERE priority = 0 AND username = '%{User-Name}'"
 
 # Clear the control list
-update {
-       &control.Tmp-String-0 !* ANY
-       &control.Tmp-String-1 !* ANY
-       &control.Tmp-Integer-0 !* ANY
-}
+&control -= &Tmp-String-0[*]
+&control -= &Tmp-String-1[*]
+&control -= &Tmp-Integer-0[*]
 
 # Retrieve test row with specific username (using ref'd query)
 map sql &Tmp-String-0 {
@@ -350,16 +336,12 @@ else {
 }
 
 # Clear the control list
-update {
-       &control.Tmp-String-0 !* ANY
-       &control.Tmp-String-1 !* ANY
-       &control.Tmp-Integer-0 !* ANY
-}
+&control -= &Tmp-String-0[*]
+&control -= &Tmp-String-1[*]
+&control -= &Tmp-Integer-0[*]
 
-update request {
-       &Tmp-String-0 := 'username'
-       &Tmp-String-1 := 'name'
-}
+&Tmp-String-0 := 'username'
+&Tmp-String-1 := 'name'
 
 # Retrieve our test row(s) - Using different RHS types
 map sql 'SELECT * FROM radusergroup WHERE priority = 0' {
index 21ad0c9a75fce551f7ea110bf58afde128977d08..562e2d9315597280aaf3922469d201ed80b20458 100644 (file)
@@ -1,6 +1,5 @@
-update {
-       &Fall-Through := yes
-}
+&Fall-Through := yes
+
 # Should be compiled out
 if ('${a_term}' != '${a_term}') {
        test_fail
index b773b67e0e547ac55b5ec03f1109cfaabde96913..ff86844bd273f9c5fc44066d6addbd5913b8a7e6 100644 (file)
@@ -37,9 +37,8 @@ section_names {
 }
 
 dollar_expansions {
-       update {
-               &Fall-Through := yes
-       }
+       &Fall-Through := yes
+
        # Should be compiled out
        if ('${a_term}' != '${a_term}') {
                test_fail
index b4302126ca6403128ffae12e5dace0d891d74e8f..5b74a389f1e22d389f4c392dc736691643ef1411 100644 (file)
@@ -1,40 +1,30 @@
 #  Use builtin "local" zone
-update request {
-       &Tmp-IP-Address-0 := "%(dns:localhost A)"
-}
+&Tmp-IP-Address-0 := "%(dns:localhost A)"
 
 if (&Tmp-IP-Address-0 != 127.0.0.1) {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := "%(dns:localhost AAAA)"
-}
+&Tmp-String-0 := "%(dns:localhost AAAA)"
 
 if (&Tmp-String-0 != "::1") {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 := "%(dns:1.0.0.127.in-addr.arpa PTR)"
-}
+&Tmp-String-1 := "%(dns:1.0.0.127.in-addr.arpa PTR)"
 
 if (&Tmp-String-1 != "localhost") {
        test_fail
 }
 
 #  Use local data in module config to allow for dotted names
-update request {
-       &Tmp-IP-Address-0 := "%(dns:www.example.com A)"
-}
+&Tmp-IP-Address-0 := "%(dns:www.example.com A)"
 
 if (&Tmp-IP-Address-0 != 192.168.1.1) {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := "%(dns:1.1.168.192.in-addr.arpa PTR)"
-}
+&Tmp-String-0 := "%(dns:1.1.168.192.in-addr.arpa PTR)"
 
 if (&Tmp-String-0 != "www.example.com") {
        test_fail
@@ -51,37 +41,20 @@ if (&Tmp-String-0 != "www.example.com") {
 #}
 
 # Invalid query
-update request {
-       &Tmp-String-0 := "%(dns:www.example.com ABC)"
-}
-
-if (&Tmp-String-0 != "") {
-       test_fail
-}
+&Tmp-String-0 := "%(dns:www.example.com ABC)"
 
 if (&Module-Failure-Message != "Invalid / unsupported DNS query type") {
        test_fail
 }
 
-update request {
-       &Tmp-String-0 := ""
-}
-
-update request {
-       &Tmp-String-1 := "%(dns:%{Tmp-String-0} A)"
-}
-
-if (&Tmp-String-1 != "") {
-       test_fail
-}
+&Tmp-String-0 := ""
+&Tmp-String-1 := "%(dns:%{Tmp-String-0} A)"
 
 if (&Module-Failure-Message != "Can't resolve zero length host") {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 := "%(dns:example.com MX)"
-}
+&Tmp-String-1 := "%(dns:example.com MX)"
 
 # Until we can handle multiple boxes in xlat expansion, the results
 # are concatenated into a single string
@@ -92,21 +65,13 @@ if ((&Tmp-String-1 != '10mail.example.com20mail2.example.com') && (&Tmp-String-1
 
 # Just return a single record
 # As results are not in a specified order, it could be either.
-update request {
-       &Tmp-String-1 := "%(dns:example.com MX 1)"
-}
+&Tmp-String-1 := "%(dns:example.com MX 1)"
 
 if ((&Tmp-String-1 != '10mail.example.com') && (&Tmp-String-1 != '20mail2.example.com')) {
        test_fail
 }
 
-update request {
-       &Tmp-String-1 := "%(dns:n0nex1stent.d0ma1n A)"
-}
-
-if (&Tmp-String-1 != "") {
-       test_fail
-}
+&Tmp-String-1 := "%(dns:n0nex1stent.d0ma1n A)"
 
 # Running this on macOS produces a timeout due to the nonexistent TLD
 if ((&Module-Failure-Message != "dns - Nonexistent domain name") && (&Module-Failure-Message != "Timeout waiting for DNS resolution")) {
index 1562687f42e2abb302bb32399445b792d8ba70fd..c8983aca4ddfb2d1b94f35d44813c16e8d6a761e 100644 (file)
@@ -56,14 +56,12 @@ server default {
 
 policy {
        test_pass {
-               update control {
-                       &Auth-Type := Accept
-               }
+               &control.Auth-Type := Accept
        }
 
        test_fail {
-               update reply {
-                       &Reply-Message += "Failure in test at line %(interpreter:...line)"
+               &reply += {
+                       &Reply-Message = "Failure in test at line %(interpreter:...line)"
                }
                reject
        }
index 07329add1502d14440de1d56edb04996b72dfcf9..edb76e55e7c1a6322af09a75b753ddaa724c06b8 100644 (file)
@@ -1,20 +1,12 @@
-
-update request {
-       &Tmp-String-0 := "vvrbuctetdhc"
-}
-
-update request {
-       &Tmp-String-1 := "%{modhextohex:%{Tmp-String-0}}"
-}
+&Tmp-String-0 := "vvrbuctetdhc"
+&Tmp-String-1 := "%{modhextohex:%{Tmp-String-0}}"
 
 if (&Tmp-String-1 != "ffc1e0d3d260") {
        test_fail
 }
 
 #  Invalid modhex string - not even length
-update request {
-       &Tmp-String-0 := "vvrbuctetdh"
-}
+&Tmp-String-0 := "vvrbuctetdh"
 
 update request {
        &Tmp-String-1 := "%{modhextohex:%{Tmp-String-0}}"