]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Replace Tmp- with local variables / real attributes in keyword tests
authorNick Porter <nick@portercomputing.co.uk>
Wed, 3 Jan 2024 09:27:52 +0000 (09:27 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 3 Jan 2024 10:28:09 +0000 (10:28 +0000)
Local variables used where possible, real attributes where the tests are
about manipulation in lists.

Tmp-Group- is still in use.

128 files changed:
src/tests/keywords/3gpp
src/tests/keywords/attr-index
src/tests/keywords/cast-ipaddr
src/tests/keywords/concat
src/tests/keywords/count-error
src/tests/keywords/date
src/tests/keywords/debug
src/tests/keywords/edit
src/tests/keywords/edit-add-create
src/tests/keywords/edit-attr-ref-null
src/tests/keywords/edit-group
src/tests/keywords/edit-intersection
src/tests/keywords/edit-leaf
src/tests/keywords/edit-leaf-multivalue
src/tests/keywords/edit-leaf-star
src/tests/keywords/edit-list
src/tests/keywords/edit-list-remove
src/tests/keywords/edit-list-reset
src/tests/keywords/edit-list-star
src/tests/keywords/edit-list-string
src/tests/keywords/edit-merge
src/tests/keywords/edit-merge-lhs
src/tests/keywords/edit-nested
src/tests/keywords/edit-remove-index
src/tests/keywords/edit-rhs-error
src/tests/keywords/edit-string
src/tests/keywords/edit-union
src/tests/keywords/escape
src/tests/keywords/escape-sequences
src/tests/keywords/ethernet
src/tests/keywords/expr
src/tests/keywords/foreach-break-2
src/tests/keywords/foreach-isolation
src/tests/keywords/foreach-regex
src/tests/keywords/foreach-varied-depth
src/tests/keywords/hex
src/tests/keywords/if-multivalue
src/tests/keywords/if-regex-empty
src/tests/keywords/if-regex-match
src/tests/keywords/if-regex-match-comp
src/tests/keywords/if-regex-match-named
src/tests/keywords/immutable
src/tests/keywords/ipaddr
src/tests/keywords/ipprefix
src/tests/keywords/join
src/tests/keywords/length
src/tests/keywords/load-balance
src/tests/keywords/logical-and
src/tests/keywords/logical-or
src/tests/keywords/map-csv-prepend
src/tests/keywords/map-xlat
src/tests/keywords/map-xlat-nested
src/tests/keywords/map-xlat-nested-overwrite
src/tests/keywords/map-xlat-struct
src/tests/keywords/md4
src/tests/keywords/md5
src/tests/keywords/md5-error
src/tests/keywords/mschap
src/tests/keywords/nexttime
src/tests/keywords/notfound
src/tests/keywords/pack
src/tests/keywords/pad
src/tests/keywords/pairs
src/tests/keywords/pap
src/tests/keywords/pap-ssha2
src/tests/keywords/parallel
src/tests/keywords/parallel-rcode
src/tests/keywords/parallel-yield
src/tests/keywords/rand
src/tests/keywords/randstr
src/tests/keywords/redundant
src/tests/keywords/redundant-load-balance
src/tests/keywords/redundant-map-fail
src/tests/keywords/redundant-redundant
src/tests/keywords/regex-escape
src/tests/keywords/regex-lhs
src/tests/keywords/retry-section
src/tests/keywords/return-break-mix
src/tests/keywords/return-within-foreach
src/tests/keywords/sha1
src/tests/keywords/sha1-error
src/tests/keywords/sha2
src/tests/keywords/sign
src/tests/keywords/subrequest-attr
src/tests/keywords/subrequest-detach
src/tests/keywords/subrequest-request-qualifiers
src/tests/keywords/subrequest-return
src/tests/keywords/subrequest-src-dst
src/tests/keywords/subrequest-src-dst-nested
src/tests/keywords/subrequest-src-dst-nested.attrs
src/tests/keywords/subrequest-src-dst.attrs
src/tests/keywords/switch-escape
src/tests/keywords/timeout
src/tests/keywords/tolower
src/tests/keywords/toupper
src/tests/keywords/truncation
src/tests/keywords/unpack
src/tests/keywords/update-delete
src/tests/keywords/update-filter
src/tests/keywords/update-group
src/tests/keywords/update-group-error
src/tests/keywords/update-hex
src/tests/keywords/update-list-null-rhs
src/tests/keywords/update-null-value-assign
src/tests/keywords/update-prepend
src/tests/keywords/update-remove-any
src/tests/keywords/update-remove-list
src/tests/keywords/update-remove-value
src/tests/keywords/update-to-edit
src/tests/keywords/urlquote
src/tests/keywords/xlat-alternation
src/tests/keywords/xlat-alternation-fail-then-func
src/tests/keywords/xlat-alternation-with-func
src/tests/keywords/xlat-attr-index
src/tests/keywords/xlat-cond-missing
src/tests/keywords/xlat-config
src/tests/keywords/xlat-delay
src/tests/keywords/xlat-dhcpv4
src/tests/keywords/xlat-double-alternation
src/tests/keywords/xlat-eval
src/tests/keywords/xlat-exec
src/tests/keywords/xlat-explode
src/tests/keywords/xlat-inline
src/tests/keywords/xlat-interpreter
src/tests/keywords/xlat-list
src/tests/keywords/xlat-octets
src/tests/keywords/xlat-string
src/tests/keywords/xlat-subst

index becd900abff7f4b0cf37ec8090ec53eb45476953..1441968da8739d5e108e319c60180c6479633d6b 100644 (file)
@@ -1,10 +1,13 @@
+string result_string1
+string result_string2
+
 &Vendor-Specific.3GPP.IMSI := "hello"
 
 #
 #  "request.[0-9]" should be parsed as a list followed
 #  by an attribute.
 #
-&control.Tmp-String-0 := &Vendor-Specific.3GPP.IMSI
-&control.Tmp-String-1 := &Vendor-Specific.3GPP.IMSI
+&result_string1 := &Vendor-Specific.3GPP.IMSI
+&result_string2 := &request.Vendor-Specific.3GPP.IMSI
 
 success
index 5f6d437e26a4d6557fd0bf6b59d84077c08c2a5c..3442a42e19b77f98c8829ef941d1fb4679219a40 100644 (file)
@@ -1,34 +1,34 @@
 &request += {
-       &Tmp-String-0 = "foo"
-       &Tmp-String-0 = "bar"
-       &Tmp-String-0 = "baz"
+       &Filter-Id = "foo"
+       &Filter-Id = "bar"
+       &Filter-Id = "baz"
 }
 
-&Tmp-String-0[1] := "yellow"
+&Filter-Id[1] := "yellow"
 
-if (!("%{Tmp-String-0[*]}" == "fooyellowbaz")) {
+if (!("%{Filter-Id[*]}" == "fooyellowbaz")) {
        test_fail
 }
 
-&Tmp-String-0[2] += "red"
+&Filter-Id[2] += "red"
 
-if (!("%{Tmp-String-0[*]}" == "fooyellowbazred")) {
+if (!("%{Filter-Id[*]}" == "fooyellowbazred")) {
        test_fail
 }
 
-&Tmp-String-0[2] -= "red"
+&Filter-Id[2] -= "red"
 
-if (!("%{Tmp-String-0[*]}" == "fooyellowbaz")) {
+if (!("%{Filter-Id[*]}" == "fooyellowbaz")) {
        test_fail
 }
 
-&Tmp-String-0[0] := "oof"
-if (!("%{Tmp-String-0[*]}" == "oofyellowbaz")) {
+&Filter-Id[0] := "oof"
+if (!("%{Filter-Id[*]}" == "oofyellowbaz")) {
        test_fail
 }
 
-&Tmp-String-0[1] := "bar"
-if (!("%{Tmp-String-0[*]}" == "oofbarbaz")) {
+&Filter-Id[1] := "bar"
+if (!("%{Filter-Id[*]}" == "oofbarbaz")) {
        test_fail
 }
 
index 3c6d1a315500165911376a967c4b2dc65d358609..f3873c5e591af3dc082355d2a6f0ecfcfec9f541 100644 (file)
@@ -1,12 +1,28 @@
 #
 #  PRE: if redundant
 #
+uint32 test_integer
+string test_string
+ipv4addr test_ipaddr
+ipv4prefix test_ipv4prefix1
+ipv4prefix test_ipv4prefix2
+ipv6addr test_ipv6addr1
+ipv6addr test_ipv6addr2
+ipv6prefix test_ipv6prefix1
+ipv6prefix test_ipv6prefix2
+ipv6prefix test_ipv6prefix3
+
+ipv4addr result_ipaddr
+ipv4prefix result_ipv4prefix
+ipv6addr result_ipv6addr
+ipv6prefix result_ipv6prefix
+
 &NAS-IP-Address                := 127.0.0.1
-&Tmp-Integer-0         := 0x7f000001
+&test_integer          := 0x7f000001
 
-&Tmp-String-0                  := &NAS-IP-Address
+&test_string           := &NAS-IP-Address
 
-if (!((ipaddr)&Tmp-Integer-0[0] == &NAS-IP-Address)) {
+if (!((ipaddr)&test_integer == &NAS-IP-Address)) {
        test_fail
 }
 
@@ -15,110 +31,108 @@ if (!((ipaddr)&Tmp-Integer-0[0] == &NAS-IP-Address)) {
 #  correct, by using the assignment to perform the cast, and looking
 #  at the results.
 #
-&request += {
-       &Tmp-Cast-Ipaddr        = 203.0.113.1
-       &Tmp-Cast-IPv4Prefix    = 203.0.113.0/24
-       &Tmp-Cast-IPv4Prefix    = 203.0.113.1/32
-       &Tmp-Cast-IPv6Addr      = 2001:DB8::1
-       &Tmp-Cast-IPv6Addr      = ::ffff:203.0.113.1
-       &Tmp-Cast-IPv6Prefix    = 2001:DB8::/32
-       &Tmp-Cast-IPv6Prefix    = ::ffff:203.0.113.1/128
-       &Tmp-Cast-IPv6Prefix    = ::ffff:203.0.113.1/64
-}
+&test_ipaddr           = 203.0.113.1
+&test_ipv4prefix1      = 203.0.113.0/24
+&test_ipv4prefix2      = 203.0.113.1/32
+&test_ipv6addr1                = 2001:DB8::1
+&test_ipv6addr2                = ::ffff:203.0.113.1
+&test_ipv6prefix1      = 2001:DB8::/32
+&test_ipv6prefix2      = ::ffff:203.0.113.1/128
+&test_ipv6prefix3      = ::ffff:203.0.113.1/64
 
 #
 #  IPv4 address to IPv6 address
 #
-&control.Tmp-Cast-IPv6addr     := &Tmp-Cast-IPaddr[0]
-if (!(&control.Tmp-Cast-IPv6addr[0] == ::ffff:203.0.113.1)) {
+&result_ipv6addr := &test_ipaddr
+if (!(&result_ipv6addr == ::ffff:203.0.113.1)) {
        test_fail
 }
 
 #
 #  IPv6 address to IPv4 address
 #
-&control.Tmp-Cast-IPaddr := &control.Tmp-Cast-IPv6addr
-if (!(&control.Tmp-Cast-IPaddr[0] == 203.0.113.1)) {
+&result_ipaddr := &result_ipv6addr
+if (!(&result_ipaddr == 203.0.113.1)) {
        test_fail
 }
 
 #
 #  IPv4 prefix to IPv6 prefix
 #
-&control.Tmp-Cast-IPv6Prefix := &Tmp-Cast-IPv4Prefix[0]
-if (!(&control.Tmp-Cast-IPv6Prefix[0] == ::ffff:203.0.113.0/120)) {
+&result_ipv6prefix := &test_ipv4prefix1
+if (!(&result_ipv6prefix == ::ffff:203.0.113.0/120)) {
        test_fail
 }
 
 #
 #  IPv6 prefix to IPv4 prefix
 #
-&control.Tmp-Cast-IPv4Prefix := &control.Tmp-Cast-IPv6Prefix[0]
-if (!(&control.Tmp-Cast-IPv4Prefix[0] == 203.0.113.1/24)) {
+&result_ipv4prefix := &result_ipv6prefix
+if (!(&result_ipv4prefix == 203.0.113.1/24)) {
        test_fail
 }
 
 #
 #  IPv4 prefix (32) to IPv6 address
 #
-&control.Tmp-Cast-IPv6Addr := &Tmp-Cast-IPv4Prefix[1]
-if (!(&control.Tmp-Cast-IPv6Addr[0] == ::ffff:203.0.113.1)) {
+&result_ipv6addr := &test_ipv4prefix2
+if (!(&result_ipv6addr == ::ffff:203.0.113.1)) {
        test_fail
 }
 
 #
 #  IPv6 prefix (128) to IPv4 address
 #
-&control.Tmp-Cast-Ipaddr := &Tmp-Cast-IPv6Prefix[1]
-if (!(&control.Tmp-Cast-Ipaddr[0] == 203.0.113.1/32)) {
+&result_ipaddr := &test_ipv6prefix2
+if (!(&result_ipaddr == 203.0.113.1/32)) {
        test_fail
 }
 
 #
 #  IPv4 address to IPv6 prefix (128)
 #
-&control.Tmp-Cast-IPv6Prefix := &Tmp-Cast-Ipaddr[0]
-if (!(&control.Tmp-Cast-IPv6Prefix == ::ffff:203.0.113.1/128)) {
+&result_ipv6prefix := &test_ipaddr
+if (!(&result_ipv6prefix == ::ffff:203.0.113.1/128)) {
        test_fail
 }
 
 #
 #  IPv6 address to IPv4 prefix (32)
 #
-&control.Tmp-Cast-IPv4Prefix[0] := &Tmp-Cast-IPv6Addr[1]
-if (!(&control.Tmp-Cast-IPv4Prefix == 203.0.113.1/32)) {
+&result_ipv4prefix := &test_ipv6addr2
+if (!(&result_ipv4prefix == 203.0.113.1/32)) {
        test_fail
 }
 
 #
 #  IPv4 address to IPv4 prefix (32)
 #
-&control.Tmp-Cast-IPv4Prefix := &Tmp-Cast-Ipaddr[0]
-if (!(&control.Tmp-Cast-IPv4Prefix == 203.0.113.1/32)) {
+&result_ipv4prefix := &test_ipaddr
+if (!(&result_ipv4prefix == 203.0.113.1/32)) {
        test_fail
 }
 
 #
 #  IPv6 address to IPv6 prefix (128)
 #
-&control.Tmp-Cast-IPv6Prefix := &Tmp-Cast-Ipv6addr[0]
-if (!(&control.Tmp-Cast-IPv6Prefix == 2001:DB8::1/128)) {
+&result_ipv6prefix := &test_ipv6addr1
+if (!(&result_ipv6prefix == 2001:DB8::1/128)) {
        test_fail
 }
 
 #
 #  IPv4 prefix (32) to IPv4 address
 #
-&control.Tmp-Cast-Ipaddr := &Tmp-Cast-IPv4Prefix[1]
-if (!(&control.Tmp-Cast-Ipaddr == 203.0.113.1)) {
+&result_ipaddr := &test_ipv4prefix2
+if (!(&result_ipaddr == 203.0.113.1)) {
        test_fail
 }
 
 #
 #  IPv6 prefix (128) to IPv6 address
 #
-&control.Tmp-Cast-IPv6Addr := &Tmp-Cast-IPv6Prefix[1]
-if (!(&control.Tmp-Cast-IPv6Addr == ::ffff:203.0.113.1)) {
+&result_ipv6addr := &test_ipv6prefix2
+if (!(&result_ipv6addr == ::ffff:203.0.113.1)) {
        test_fail
 }
 
@@ -131,11 +145,11 @@ if (!(&control.Tmp-Cast-IPv6Addr == ::ffff:203.0.113.1)) {
 #
 redundant {
        group {
-               &control.Tmp-Cast-IPv6Addr := &Tmp-Cast-IPv6Prefix[0]
+               &result_ipv6addr := &test_ipv6prefix1
                fail
        }
        group {
-               if !(&Module-Failure-Message == 'Assigning value to &control.Tmp-Cast-IPv6Addr failed: Invalid cast from ipv6prefix to ipv6addr.  Only /128 (not /32) prefixes may be cast to IP address types') {
+               if !(&Module-Failure-Message == 'Assigning value to &result_ipv6addr failed: Invalid cast from ipv6prefix to ipv6addr.  Only /128 (not /32) prefixes may be cast to IP address types') {
                        test_fail
                }
                &request -= &Module-Failure-Message[*]
@@ -148,11 +162,11 @@ redundant {
 #
 redundant {
        group {
-               &control.Tmp-Cast-Ipaddr := &Tmp-Cast-IPv6Prefix[2]
+               &result_ipaddr := &test_ipv6prefix3
                fail
        }
        group {
-               if !(&Module-Failure-Message == 'Assigning value to &control.Tmp-Cast-Ipaddr failed: Invalid cast from ipv6prefix to ipaddr.  Only /128 (not /64) prefixes may be cast to IP address types') {
+               if !(&Module-Failure-Message == 'Assigning value to &result_ipaddr failed: Invalid cast from ipv6prefix to ipaddr.  Only /128 (not /64) prefixes may be cast to IP address types') {
                        test_fail
                }
                &request -= &Module-Failure-Message[*]
@@ -165,11 +179,11 @@ redundant {
 #
 redundant {
        group {
-               &control.Tmp-Cast-Ipv4prefix := &Tmp-Cast-IPv6Prefix[2]
+               &result_ipv4prefix := &test_ipv6prefix3
                fail
        }
        group {
-               if !(&Module-Failure-Message == 'Assigning value to &control.Tmp-Cast-Ipv4prefix failed: Invalid cast from ipv6prefix to ipv4prefix.  No IPv4-IPv6 mapping prefix') {
+               if !(&Module-Failure-Message == 'Assigning value to &result_ipv4prefix failed: Invalid cast from ipv6prefix to ipv4prefix.  No IPv4-IPv6 mapping prefix') {
                        test_fail
                }
                &request -= &Module-Failure-Message[*]
@@ -182,11 +196,11 @@ redundant {
 #
 redundant {
        group {
-               &control.Tmp-Cast-IPv6Addr := &Tmp-Cast-IPv4Prefix[0]
+               &result_ipv6addr := &test_ipv4prefix1
                fail
        }
        group {
-               if !(&Module-Failure-Message == 'Assigning value to &control.Tmp-Cast-IPv6Addr failed: Invalid cast from ipv4prefix to ipv6addr.  Only /32 (not /24) prefixes may be cast to IP address types') {
+               if !(&Module-Failure-Message == 'Assigning value to &result_ipv6addr failed: Invalid cast from ipv4prefix to ipv6addr.  Only /32 (not /24) prefixes may be cast to IP address types') {
                        test_fail
                }
                &request -= &Module-Failure-Message[*]
@@ -199,11 +213,11 @@ redundant {
 #
 redundant {
        group {
-               &control.Tmp-Cast-Ipaddr := &Tmp-Cast-IPv4Prefix[0]
+               &result_ipaddr := &test_ipv4prefix1
                fail
        }
        group {
-               if !(&Module-Failure-Message == 'Assigning value to &control.Tmp-Cast-Ipaddr failed: Invalid cast from ipv4prefix to ipaddr.  Only /32 (not 24/) prefixes may be cast to IP address types') {
+               if !(&Module-Failure-Message == 'Assigning value to &result_ipaddr failed: Invalid cast from ipv4prefix to ipaddr.  Only /32 (not 24/) prefixes may be cast to IP address types') {
                        test_fail
                }
                &request -= &Module-Failure-Message[*]
@@ -216,11 +230,11 @@ redundant {
 #
 redundant {
        group {
-               &control.Tmp-Cast-Ipaddr := &Tmp-Cast-IPv6Prefix[0]
+               &result_ipaddr := &test_ipv6prefix1
                fail
        }
        group {
-               if !(&Module-Failure-Message == 'Assigning value to &control.Tmp-Cast-Ipaddr failed: Invalid cast from ipv6prefix to ipaddr.  Only /128 (not /32) prefixes may be cast to IP address types') {
+               if !(&Module-Failure-Message == 'Assigning value to &result_ipaddr failed: Invalid cast from ipv6prefix to ipaddr.  Only /128 (not /32) prefixes may be cast to IP address types') {
                        test_fail
                }
                &request -= &Module-Failure-Message[*]
@@ -233,11 +247,11 @@ redundant {
 #
 redundant {
        group {
-               &control.Tmp-Cast-IPv4prefix := &Tmp-Cast-IPv6Prefix[0]
+               &result_ipv4prefix := &test_ipv6prefix1
                fail
        }
        group {
-               if !(&Module-Failure-Message == 'Assigning value to &control.Tmp-Cast-IPv4prefix failed: Invalid cast from ipv6prefix to ipv4prefix.  No IPv4-IPv6 mapping prefix') {
+               if !(&Module-Failure-Message == 'Assigning value to &result_ipv4prefix failed: Invalid cast from ipv6prefix to ipv4prefix.  No IPv4-IPv6 mapping prefix') {
                        test_fail
                }
                &request -= &Module-Failure-Message[*]
@@ -250,11 +264,11 @@ redundant {
 #
 redundant {
        group {
-               &control.Tmp-Cast-Ipaddr := &Tmp-Cast-IPv6Addr[0]
+               &result_ipaddr := &test_ipv6addr1
                fail
        }
        group {
-               if !(&Module-Failure-Message == 'Assigning value to &control.Tmp-Cast-Ipaddr failed: Invalid cast from ipv6addr to ipaddr.  No IPv4-IPv6 mapping prefix') {
+               if !(&Module-Failure-Message == 'Assigning value to &result_ipaddr failed: Invalid cast from ipv6addr to ipaddr.  No IPv4-IPv6 mapping prefix') {
                        test_fail
                }
                &request -= &Module-Failure-Message[*]
@@ -267,11 +281,11 @@ redundant {
 #
 redundant {
        group {
-               &control.Tmp-Cast-IPv4prefix := &Tmp-Cast-IPv6Addr[0]
+               &result_ipv4prefix := &test_ipv6addr1
                fail
        }
        group {
-               if !(&Module-Failure-Message == 'Assigning value to &control.Tmp-Cast-IPv4prefix failed: Invalid cast from ipv6addr to ipv4prefix.  No IPv4-IPv6 mapping prefix') {
+               if !(&Module-Failure-Message == 'Assigning value to &result_ipv4prefix failed: Invalid cast from ipv6addr to ipv4prefix.  No IPv4-IPv6 mapping prefix') {
                        test_fail
                }
                &request -= &Module-Failure-Message[*]
index dd087b3a669a68539e5481b1d78ca8c7505d7183..b454a73b9dfbc85a5a211986a0d47b874a8c0892 100644 (file)
@@ -2,17 +2,19 @@
 # PRE: if
 #
 # this fails, so the next edit is merged in and fails, too.
+string result_string
+
 &control -= &Password
 
 &control += {
        &User-Name = &request.User-Name
        &User-Password = &request.User-Password
-       &Tmp-String-0 = "ab c"
-       &Tmp-String-0 = "de fg"
-#      &Tmp-Integer-0 = { 123, 456 }  # @todo - Doesn't work :(
-       &Tmp-Integer-0 = 123
-       &Tmp-Integer-1 = 456
-       &Tmp-Integer-1 = 789
+       &Calling-Station-Id = "ab c"
+       &Calling-Station-Id = "de fg"
+#      &Port-Limit = { 123, 456 }  # @todo - Doesn't work :(
+       &Port-Limit = 123
+       &NAS-Port = 456
+       &NAS-Port = 789
 }
 
 #
 #  (string) (&ref) casts that one value to a string
 #    and returns one string
 #
-&Tmp-String-2 := %{(string) (&control.Tmp-Integer-1[*])}
-if !(&Tmp-String-2 == "456789") {
+&result_string := %{(string) (&control.NAS-Port[*])}
+if !(&result_string == "456789") {
        test_fail
 }
 
 #
 #  &ref could return a list.
-#  (&ref) means "treat the list as one value"
-#  (string) (&ref) casts each value to a string
+#  (string) &ref casts each value to a string
 #    and returns a list of strings
 #
-&Tmp-String-2 := %{(string) &control.Tmp-Integer-1[*]}
-if !(&Tmp-String-2[0] == "456") {
+&Called-Station-Id := %{(string) &control.NAS-Port[*]}
+if !(&Called-Station-Id[0] == "456") {
        test_fail
 }
 
-if !(&Tmp-String-2[1] == "789") {
+if !(&Called-Station-Id[1] == "789") {
        test_fail
 }
 
-&control -= &Tmp-Integer-1[*]
+&control -= &NAS-Port[*]
 ok     # separate updates
 
 
-&control += {
-       &Tmp-String-1 = %concat(%{control.[*]}, ', ')
-}
+&result_string := %concat(%{control.[*]}, ', ')
 
-"%{control.Tmp-String-1}"
-if (!(&control.Tmp-String-1 == "bob, hello, ab c, de fg, 123")) {
+"%{result_string}"
+if (!(&result_string == "bob, hello, ab c, de fg, 123")) {
        test_fail
 }
 
-&control += {
-       &Tmp-String-2 = %concat(%{control.Tmp-String-0[*]}, ', ')
-}
+&result_string := %concat(%{control.Calling-Station-Id[*]}, ', ')
 
-if (!(&control.Tmp-String-2 == "ab c, de fg")) {
+if (!(&result_string == "ab c, de fg")) {
        test_fail
 }
 
 # Empty separator
-&control += {
-       &Tmp-String-3 = %concat(%{control.Tmp-String-0[*]})
-}
+&result_string := %concat(%{control.Calling-Station-Id[*]})
 
-if (!(&control.Tmp-String-3 == "ab cde fg")) {
+if (!(&result_string == "ab cde fg")) {
        test_fail
 }
 
 # Single character separator
-&control += {
-       &Tmp-String-4 = %concat(%{control.Tmp-String-0[*]}, ',')
-}
+&result_string := %concat(%{control.Calling-Station-Id[*]}, ',')
 
-if (!(&control.Tmp-String-4 == "ab c,de fg")) {
+if (!(&result_string == "ab c,de fg")) {
        test_fail
 }
 
 # Multi character separator not delimited
-&control += {
-       &Tmp-String-5 = %concat(%{control.Tmp-String-0[*]}, '|-')
-}
+&result_string := %concat(%{control.Calling-Station-Id[*]}, '|-')
 
-if !(&control.Tmp-String-5 == "ab c|-de fg") {
+if !(&result_string == "ab c|-de fg") {
        test_fail
 }
 
index c494b20dd4755c1eb02cb0a2d6ac735c7f99e993..1dfc6c383bbd3b87e275ef5ad0b1c31bff54642b 100644 (file)
@@ -1 +1,2 @@
-&Tmp-String-0 := &reply.Filter-Id[#]   # ERROR
+string result_string
+&result_string := &reply.Filter-Id[#]  # ERROR
index 77636b597237160c1e918478470e3be1694f88e0..370505ab735c84793bd148244e76663420bffcb9 100644 (file)
@@ -1,56 +1,62 @@
 #
 #  PRE: if
 #
+uint32 test_integer
+uint32 result_integer
+string result_string1
+string result_string2
+date test_date
+
 # Use pre-defined date and time
-&Tmp-Integer-0 := 1506101100
+&test_integer := 1506101100
 
 # Convert to string representation
-&Tmp-String-0 := %date(%{Tmp-Integer-0})
+&result_string1 := %date(%{test_integer})
 
 # Some systems report GMT some UTC...
-if (!(&Tmp-String-0 == "Fri 22 Sep 17:25:00 GMT 2017")) && (!(&Tmp-String-0 == "Fri 22 Sep 17:25:00 UTC 2017")) {
+if (!(&result_string1 == "Fri 22 Sep 17:25:00 GMT 2017")) && (!(&result_string1 == "Fri 22 Sep 17:25:00 UTC 2017")) {
        test_fail
 }
 
 # Convert string to integer
-&Tmp-Integer-1 := %date(%{Tmp-String-0})
+&result_integer := %date(%{result_string1})
 
 
-if (!(&Tmp-Integer-1 == &Tmp-Integer-0)) {
+if (!(&result_integer == &test_integer)) {
        test_fail
 }
 
 # Compare two methods of reading request timestamp in local timezone
-&Tmp-String-0 := %localdate(request)
-&Tmp-String-1 := %S
+&result_string1 := %localdate(request)
+&result_string2 := %S
 
-if (!(&Tmp-String-0 == &Tmp-String-1)) {
+if (!(&result_string1 == &result_string2)) {
        test_fail
 }
 
 # Convert different string format
-&Tmp-String-2 := "2017-09-22 17:25:00"
+&result_string1 := "2017-09-22 17:25:00"
 
-&Tmp-Integer-2 := %sqldate(%{Tmp-String-2})
+&result_integer := %sqldate(%{result_string1})
 
-if (!(&Tmp-Integer-2 == &Tmp-Integer-0)) {
+if (!(&result_integer == &test_integer)) {
        test_fail
 }
 
 # Use a date attribute
-&Tmp-Date-0 := 1659985459
-&Tmp-String-2 := %sqldate(%{Tmp-Date-0})
+&test_date := 1659985459
+&result_string1 := %sqldate(%{test_date})
 
-if !(&Tmp-String-2 == '2022-08-08 19:04:19') {
+if !(&result_string1 == '2022-08-08 19:04:19') {
        test_fail
 }
 
 # Invalid format
-&Tmp-String-3 := '201-32-22 17:25:00'
-&Tmp-String-4 := %sqldate(%{Tmp-String-3})
+&result_string1 := '201-32-22 17:25:00'
+&result_string2 := %sqldate(%{result_string1})
 
 # This shouldn't exist, as the RHS above is NULL, and therefore the assignment will fail
-if (&Tmp-String-4) {
+if (&result_string2) {
        test_fail
 }
 
@@ -60,9 +66,9 @@ if (!(&Module-Failure-Message == "Failed to parse time string \"201-32-22 17:25:
 
 # Invalid type
 &NAS-IP-Address := "192.168.1.1"
-&Tmp-String-5 := %date(%{NAS-IP-Address})
+&result_string2 := %date(%{NAS-IP-Address})
 
-if (&Tmp-String-5) {
+if (&result_string2) {
        test_fail
 }
 
index 66028d9d8db786162c43e90102caac704fee35df..4bda461ebb97a50b7de086d28ccfa6d7fa2bf0b1 100644 (file)
@@ -1,8 +1,10 @@
 #
 #  PRE: if
 #
+uint32 test_integer
+string dummy_string
 
-&Tmp-Integer-0 := "%debug(4)"
+&test_integer := "%debug(4)"
 
 # Check debug level is now 4
 if (!(%debug(3) == 4)) {
@@ -10,12 +12,12 @@ if (!(%debug(3) == 4)) {
 }
 
 # Call with NULL arg, should report current level
-if (!(%debug(%{Tmp-String-8}) == 3)) {
+if (!(%debug(%{dummy_string}) == 3)) {
        test_fail
 }
 
 # ...and again
-if (!(%debug(%{Tmp-String-8}) == 3)) {
+if (!(%debug(%{dummy_string}) == 3)) {
        test_fail
 }
 
index f31bd8f751f529fcec69ef2810c3e51db3cc7b4a..289f65cf632472529070f025e4cadf6a5a83875f 100644 (file)
@@ -1,20 +1,22 @@
 #
 #  PRE: if
 #
-&Tmp-Integer-0 := 4
-&Tmp-Integer-1 := 6
+uint32 test_integer1
+uint32 test_integer2
+&test_integer1 := 4
+&test_integer2 := 6
 
 #
 #  Many, many, years of work led up to this!
 #
-&Tmp-Integer-0 += 5
+&test_integer1 += 5
 
-if (!(&Tmp-Integer-0 == 9)) {
+if (!(&test_integer1 == 9)) {
        test_fail
 }
 
-&Tmp-Integer-0 += &Tmp-Integer-1
-if (!(&Tmp-Integer-0 == 15)) {
+&test_integer1 += &test_integer2
+if (!(&test_integer1 == 15)) {
        test_fail
 }
 
index 09d56fb7904905d535a33e92545b050bde9f7efa..2fc291a0abdde4577013e578496d964c925fe7ee 100644 (file)
@@ -1,15 +1,19 @@
 #
 #  Add to something which doesn't exist
 #
+string test_string
+uint32 test_integer1
+uint32 test_integer2
+uint32 test_integer3
 
-&Tmp-Integer-0 += 4
-if !(&Tmp-Integer-0 == 4) {
+&test_integer1 += 4
+if !(&test_integer1 == 4) {
        test_fail
 }
 
 
-&Tmp-String-0 += "bar"
-if !(&Tmp-String-0 == "bar") {
+&test_string += "bar"
+if !(&test_string == "bar") {
        test_fail
 }
 
@@ -25,11 +29,11 @@ if !(&Tmp-Group-0.Filter-Id == "foo") {
        test_fail
 }
 
-&Tmp-Integer-1 := 3
-&Tmp-Integer-2 := 4
+&test_integer2 := 3
+&test_integer3 := 4
 
-&Tmp-Integer-0 += &Tmp-Integer-2 - &Tmp-Integer-1
-if !(&Tmp-Integer-0 == 5) {
+&test_integer1 += &test_integer3 - &test_integer2
+if !(&test_integer1 == 5) {
        test_fail
 }
 
index 1484a2ebf5238641d2dc0fd738aebaf969e2a281..d08a229ed72e1dec04131e9ac2f3156aafc65a8c 100644 (file)
@@ -4,48 +4,48 @@
 #  Form attribute references with xlats
 #
 &request += {
-       &Tmp-String-0 = 'foo'
-       &Tmp-String-0 = 'bar'
-       &Tmp-String-1 = 'baz'
+       &Filter-Id = 'foo'
+       &Filter-Id = 'bar'
+       &Calling-Station-Id = 'baz'
 }
 
 &control = {}
 
-if (!(%{Tmp-String-0[#]} == 2)) {
+if (!(%{Filter-Id[#]} == 2)) {
        test_fail
 }
 
-if (!(&Tmp-String-0[0] == 'foo')) {
+if (!(&Filter-Id[0] == 'foo')) {
        test_fail
 }
 
 #
 # Delete an attribute by assigning a non-existent attribute to it
 #
-&Tmp-String-0[1] := &Reply-Message
+&Filter-Id[1] := &Reply-Message
 
 # Should only remove 'bar'
-if !(&Tmp-String-0[0] == 'foo') {
+if !(&Filter-Id[0] == 'foo') {
        test_fail
 }
 
-if (!(&Tmp-String-0[#] == 1)) {
+if (!(&Filter-Id[#] == 1)) {
        test_fail
 }
 
 # Nothing should exist for this attribute.
-if (&Tmp-String-0[1]) {
+if (&Filter-Id[1]) {
        test_fail
 }
 
-if (&Tmp-String-0[2]) {
+if (&Filter-Id[2]) {
        test_fail
 }
 
-&Tmp-String-0 := &Reply-Message
+&Filter-Id := &Reply-Message
 
 # All instances should be removed
-if (&Tmp-String-0) {
+if (&Filter-Id) {
        test_fail
 }
 
index 37f1d2c4bd1b2fa19fddbf5a071abe483e956ff7..01366adcb39784566fb076acad417f7c28b8a8b6 100644 (file)
@@ -1,26 +1,29 @@
 #
 #  PRE: edit
 #
+string test_string1
+string test_string2
+string test_string3
 
 #
 #  ALl of these edits are grouped.  So if one of them fails, all of
 #  them are rolled back.
 #
 transaction {
-       &Tmp-String-0 := "foo"
-       &Tmp-String-1 -= "bar" # fails, no existing Tmp-String-1
-       &Tmp-String-2 := "bar"
+       &test_string1 := "foo"
+       &test_string2 -= "bar" # fails, no existing test_string2
+       &test_string3 := "bar"
 }
 
-if (&Tmp-String-0) {
+if (&test_string1) {
        test_fail
 }
 
-if (&Tmp-String-1) {
+if (&test_string2) {
        test_fail
 }
 
-if (&Tmp-String-2) {
+if (&test_string3) {
        test_fail
 }
 
@@ -28,20 +31,20 @@ if (&Tmp-String-2) {
 #  All of these succeed individually, so all of them should succeed.
 #
 transaction {
-       &Tmp-String-0 := "foo"
-       &Tmp-String-1 := "yup"
-       &Tmp-String-2 := "bar"
+       &test_string1 := "foo"
+       &test_string2 := "yup"
+       &test_string3 := "bar"
 }
 
-if (!(&Tmp-String-0 == "foo")) {
+if (!(&test_string1 == "foo")) {
        test_fail
 }
 
-if (!(&Tmp-String-1 == "yup")) {
+if (!(&test_string2 == "yup")) {
        test_fail
 }
 
-if (!(&Tmp-String-2 == "bar")) {
+if (!(&test_string3 == "bar")) {
        test_fail
 }
 
index 5fadc347561680d7457da003e3d1464daf361531..4995717f1c4bc7ba32c949e746bfff7f82ceea68 100644 (file)
@@ -2,33 +2,33 @@
 # PRE: edit-list
 #
 
-&control.Tmp-String-0 := "foo"
-&reply.Tmp-String-0 := "foo"
+&control.Filter-Id := "foo"
+&reply.Filter-Id := "foo"
 
 &reply &= &control
 
 #  must exist
-if (!&reply.Tmp-String-0) {
+if (!&reply.Filter-Id) {
        test_fail
 }
 
 # and have the correct value
-if (!(&reply.Tmp-String-0 == "foo")) {
+if (!(&reply.Filter-Id == "foo")) {
        test_fail
 }
 
 # reset
-&reply -= &Tmp-String-0[*]
+&reply -= &Filter-Id[*]
 
 #
 # Same attribute, but different value
 #
-&reply.Tmp-String-0 := "bar"
+&reply.Filter-Id := "bar"
 
 &reply &= &control
 
 #  must NOT exist
-if (&reply.Tmp-String-0) {
+if (&reply.Filter-Id) {
        test_fail
 }
 
index 88485a18d206c463b241f6ba6908ac68dedd9b25..f829b06a1fd8384d34c94a04878f50730b0358d5 100644 (file)
@@ -1,16 +1,20 @@
-&Tmp-String-0 := "foo"
-&Tmp-String-1 := &Tmp-String-0
-&Tmp-String-2 := "Tmp-String-0"
+string test_string1
+string test_string2
+string test_string3
+
+&test_string1 := "foo"
+&test_string2 := &test_string1
+&test_string3 := "test_string1"
 
 # foo, bar, "foo", "foo"
-&Tmp-String-3 := { &Tmp-String-0, "bar", "%{Tmp-String-0}", %{Tmp-String-2} }
+&Filter-Id := { &test_string1, "bar", "%{test_string1}", %{test_string3} }
 
 
-if (!(%{Tmp-String-3[#]} == 4)) {
+if (!(%{Filter-Id[#]} == 4)) {
        test_fail
 }
 
-if (!("%{Tmp-String-3[*]}" == "foobarfooTmp-String-0")) {
+if (!("%{Filter-Id[*]}" == "foobarfootest_string1")) {
        test_fail
 }
 
index 557937f176d1131669e526255dfd6494ab693cfe..757e0d15a7b642bd235b01e4965354222ab3251f 100644 (file)
@@ -1,40 +1,40 @@
 #
 # PRE: edit
 #
-&Tmp-String-0 := {
+&Filter-Id := {
        "foo %{User-Name}",
        "bar",
        "baz",
        &User-Name
 }
 
-if (!(%{request.Tmp-String-0[#]} == 4)) {
+if (!(%{request.Filter-Id[#]} == 4)) {
        test_fail
 }
 
-if (!(&Tmp-String-0[0] == "foo bob")) {
+if (!(&Filter-Id[0] == "foo bob")) {
        test_fail
 }
 
-if (!(&Tmp-String-0[1] == "bar")) {
+if (!(&Filter-Id[1] == "bar")) {
        test_fail
 }
 
-if (!(&Tmp-String-0[2] == "baz")) {
+if (!(&Filter-Id[2] == "baz")) {
        test_fail
 }
 
-if (!(&Tmp-String-0[3] == "bob")) {
+if (!(&Filter-Id[3] == "bob")) {
        test_fail
 }
 
 #
 #  And test non-string things
 #
-&Tmp-String-0 := "127"
+&Filter-Id := "127"
 
 &Framed-IP-Address := {
-       "%{Tmp-String-0}.0.0.1",
+       "%{Filter-Id}.0.0.1",
        192.0.2.1
 }
 
index 02824ede659a28f93b4347aa4ec9205aa051c4a9..b347c2566c1548d3475bdf7176a3486f1db015d0 100644 (file)
@@ -1,30 +1,30 @@
 #
 #  PRE: edit
 #
-&Tmp-Integer-0 := { 1, 3, 5, 7, 11 }
+uint32 result_integer
 
-&Tmp-Integer-1 := 0
+&NAS-Port := { 1, 3, 5, 7, 11 }
 
 #
 #  Do operations on sets of inputs.
 #
-&Tmp-Integer-1 += &Tmp-Integer-0[*]
-if (!(&Tmp-Integer-1 == 27)) {
+&result_integer += &NAS-Port[*]
+if (!(&result_integer == 27)) {
        test_fail
 }
 
 #
 #  We should be able to copy multiple attributes
 #
-&Tmp-Integer-2 := &Tmp-Integer-0[*]
-&Tmp-Integer-1 := 0
+&Port-Limit := &NAS-Port[*]
+&result_integer := 0
 
 
 #
 #  Do operations on sets of inputs.
 #
-&Tmp-Integer-1 += &Tmp-Integer-2[*]
-if (!(&Tmp-Integer-1 == 27)) {
+&result_integer += &Port-Limit[*]
+if (!(&result_integer == 27)) {
        test_fail
 }
 
index 3a499b93c0510a78f9d75e9aa28560a5ff3cab43..ed02d524270201da96b12790cb53dec9afe1bc09 100644 (file)
@@ -2,10 +2,10 @@
 # PRE: edit
 #
 
-&control.Tmp-String-0 := "foo"
+&control.Filter-Id := "foo"
 
 #  Doesn't exist
-if (&Tmp-String-0) {
+if (&Filter-Id) {
        test_fail
 }
 
@@ -13,14 +13,14 @@ if (&Tmp-String-0) {
 &request += &control
 
 #  Does exist, and is the last attribute
-if (!&Tmp-String-0[n]) {
+if (!&Filter-Id[n]) {
        test_fail
 }
 
-&request -= &Tmp-String-0[*]
+&request -= &Filter-Id[*]
 
 #  Doesn't exist
-if (&Tmp-String-0) {
+if (&Filter-Id) {
        test_fail
 }
 
@@ -28,15 +28,15 @@ if (&Tmp-String-0) {
 &request ^= &control
 
 #  Does exist, and is at offset 0
-if (!&Tmp-String-0[0]) {
+if (!&Filter-Id[0]) {
        test_fail
 }
 
-&request -= &Tmp-String-0[*]
-&control.Tmp-String-0 := { "a", "b", "c", "d" }
+&request -= &Filter-Id[*]
+&control.Filter-Id := { "a", "b", "c", "d" }
 
-&request += &control.Tmp-String-0[*]
-if (!(%{request.Tmp-String-0[#]} == 4)) {
+&request += &control.Filter-Id[*]
+if (!(%{request.Filter-Id[#]} == 4)) {
        test_fail
 }
 
index 710a9d4f22009deb6cb39cf38e85705092442b8d..a8cebb96178adcd0a35140decb713ede3225299c 100644 (file)
@@ -3,30 +3,30 @@
 #
 
 &request += {
-       &Tmp-Octets-0 = 0x00
-       &Tmp-String-0 = "foo"
-       &Tmp-Integer-0 = 1
+       &Class = 0x00
+       &Filter-Id = "foo"
+       &NAS-Port = 1
 }
 
 #  Does exist
-if (!&Tmp-String-0) {
+if (!&Filter-Id) {
        test_fail
 }
 
 # Remove the first one
-&request -= &Tmp-String-0
+&request -= &Filter-Id
 
 #  Does not exist
-if (&Tmp-String-0) {
+if (&Filter-Id) {
        test_fail
 }
 
 # Other things still exist
-if (!&Tmp-Octets-0) {
+if (!&Class) {
        test_fail
 }
 
-if (!&Tmp-Integer-0) {
+if (!&NAS-Port) {
        test_fail
 }
 
@@ -34,39 +34,39 @@ if (!&Tmp-Integer-0) {
 #  Add multiple of the same type
 #
 &request += {
-       &Tmp-String-0 = "foo"
-       &Tmp-String-0 = "bar"
-       &Tmp-String-0 = "baz"
+       &Filter-Id = "foo"
+       &Filter-Id = "bar"
+       &Filter-Id = "baz"
 }
 
-if (!&Tmp-String-0) {
+if (!&Filter-Id) {
        test_fail
 }
 
-&request -= &Tmp-String-0[0]
+&request -= &Filter-Id[0]
 
 #  the first one has been removed
-if (!(&Tmp-String-0[0] == "bar")) {
+if (!(&Filter-Id[0] == "bar")) {
        test_fail
 }
 
 # Other things still exist
-if (!&Tmp-Octets-0) {
+if (!&Class) {
        test_fail
 }
 
-if (!&Tmp-Integer-0) {
+if (!&NAS-Port) {
        test_fail
 }
 
-&request -= &Tmp-String-0[*]
+&request -= &Filter-Id[*]
 
 # Does not exist
-if (&Tmp-String-0) {
+if (&Filter-Id) {
        test_fail
 }
 
-&Tmp-String-0 := { "foo", "bar", "baz" }
+&Filter-Id := { "foo", "bar", "baz" }
 
 #
 #  Remove one by value.
@@ -75,30 +75,30 @@ if (&Tmp-String-0) {
 #  as a condition?  For now, it's an exact match. :(
 #
 &request -= {
-       &Tmp-String-0 == "bar"
+       &Filter-Id == "bar"
 }
 
-if (!(&Tmp-String-0[0] == "foo")) {
+if (!(&Filter-Id[0] == "foo")) {
        test_fail
 }
 
-if (!(&Tmp-String-0[1] == "baz")) {
+if (!(&Filter-Id[1] == "baz")) {
        test_fail
 }
 
-if (&Tmp-String-0[2]) {
+if (&Filter-Id[2]) {
        test_fail
 }
 
 #
 #  Remove via in-place list, too.
 #
-&request -= "Tmp-String-0 == 'foo'"
-if (!(&Tmp-String-0[0] == "baz")) {
+&request -= "Filter-Id == 'foo'"
+if (!(&Filter-Id[0] == "baz")) {
        test_fail
 }
 
-if (&Tmp-String-0[1]) {
+if (&Filter-Id[1]) {
        test_fail
 }
 
index 1ec36012fff7ae530cd658c746997b843bee92cf..fc584eafb6fbcca53a60e5c2d3d2b740a60254ff 100644 (file)
@@ -2,10 +2,10 @@
 # PRE: edit-list
 #
 
-&control.Tmp-String-0 := "foo"
+&control.Filter-Id := "foo"
 
 #  must exist
-if (!&control.Tmp-String-0) {
+if (!&control.Filter-Id) {
        test_fail
 }
 
@@ -15,7 +15,7 @@ if (!&control.Tmp-String-0) {
 &control := {}
 
 #  must not exist
-if (&control.Tmp-String-0) {
+if (&control.Filter-Id) {
        test_fail
 }
 
index 3c90af0338ae27da331099b5259a762816e0ab4e..79a38441db313513f8610fd038d32386ecd6d928 100644 (file)
@@ -1,22 +1,22 @@
 #
 #  PRE: edit-leaf-star
 #
-&Tmp-Group-0.Tmp-Integer-0 := { 1, 3, 5, 7, 11 }
-&Tmp-Integer-1 := 0
+&Tmp-Group-0.NAS-Port := { 1, 3, 5, 7, 11 }
+&Port-Limit := 0
 
 #
 #  Do operations on sets of inputs.
 #
-&Tmp-Integer-1 += &Tmp-Group-0.Tmp-Integer-0[*]
-if (!(&Tmp-Integer-1 == 27)) {
+&Port-Limit += &Tmp-Group-0.NAS-Port[*]
+if (!(&Port-Limit == 27)) {
        test_fail
 }
 
 &Tmp-Group-1 := &Tmp-Group-0
-&Tmp-Integer-1 := 0
+&Port-Limit := 0
 
-&Tmp-Integer-1 += &Tmp-Group-1.Tmp-Integer-0[*]
-if (!(&Tmp-Integer-1 == 27)) {
+&Port-Limit += &Tmp-Group-1.NAS-Port[*]
+if (!(&Port-Limit == 27)) {
        test_fail
 }
 
index 6e5140a3725c2c6835913c29875aacea317f8233..8885ffdd52157e50300004c1e634aef452959a83 100644 (file)
@@ -8,9 +8,9 @@
 #
 #  The purpose of this functionality is mainly for xlat, exec, etc.
 #
-&control += "Tmp-Integer-0 = 9"
+&control += "NAS-Port = 9"
 
-if (!(&control.Tmp-Integer-0 == 9)) {
+if (!(&control.NAS-Port == 9)) {
        test_fail
 }
 
index 6279252f1f3eb7e5722aeab21704e9eddb33fd5b..38b45fad97997aa9cb85b3bb3e1e5956f51098cf 100644 (file)
@@ -8,23 +8,23 @@
 #      = A' MERGE B' if A and B are lists
 #
 
-&Tmp-String-0 := "foo"
-&control.Tmp-String-0 := "bar"
+&Filter-Id := "foo"
+&control.Filter-Id := "bar"
 
 # merge
 &request >= &control
 
-if (!&Tmp-String-0) {
+if (!&Filter-Id) {
        test_fail
 }
 
 # The original value should be unchanged
-if (!(&Tmp-String-0 == "foo")) {
+if (!(&Filter-Id == "foo")) {
        test_fail
 }
 
 #  and the new value should not be there
-if (&Tmp-String-0 == "bar") {
+if (&Filter-Id == "bar") {
        test_fail
 }
 
index f65c71ac866508584f967dff204f0ccfc5ce03f9..604c92d6f042c4fea81800644a8a51b9440917b2 100644 (file)
@@ -8,23 +8,23 @@
 #      = A' MERGE B' if A and B are lists
 #
 
-&Tmp-String-0 := "foo"
-&control.Tmp-String-0 := "bar"
+&Filter-Id := "foo"
+&control.Filter-Id := "bar"
 
 # merge
 &request <= &control
 
-if (!&Tmp-String-0) {
+if (!&Filter-Id) {
        test_fail
 }
 
 # we want the *control* version
-if (!(&Tmp-String-0 == "bar")) {
+if (!(&Filter-Id == "bar")) {
        test_fail
 }
 
 #  and the original value should not be there
-if (&Tmp-String-0 == "foo") {
+if (&Filter-Id == "foo") {
        test_fail
 }
 
index 7e7ef40e44c738866739b6f0ec9b41c9d3350e7b..b2e4a0400074789c6f1a7ce5279663e2628075a0 100644 (file)
 #  &request, etc. for now.  We should support more.
 #
 &control.Tmp-Group-0 := {
-       &Tmp-Integer-0 = 1
+       &NAS-Port = 1
 }
 
-if (!&control.Tmp-Group-0.Tmp-Integer-0) {
+if (!&control.Tmp-Group-0.NAS-Port) {
        test_fail
 }
 
-if (!(&control.Tmp-Group-0.Tmp-Integer-0 == 1)) {
+if (!(&control.Tmp-Group-0.NAS-Port == 1)) {
        test_fail
 }
 
 #
 #  Edit it in place.
 #
-&control.Tmp-Group-0.Tmp-Integer-0 += 5
+&control.Tmp-Group-0.NAS-Port += 5
 
-if (!(&control.Tmp-Group-0.Tmp-Integer-0 == 6)) {
+if (!(&control.Tmp-Group-0.NAS-Port == 6)) {
        test_fail
 }
 
@@ -35,9 +35,9 @@ if (!(&control.Tmp-Group-0.Tmp-Integer-0 == 6)) {
 #
 #  @todo - look FIRST for attributes in the current group?
 #
-&control.Tmp-Group-0 -= &control.Tmp-Group-0.Tmp-Integer-0
+&control.Tmp-Group-0 -= &control.Tmp-Group-0.NAS-Port
 
-if (&control.Tmp-Group-0.Tmp-Integer-0) {
+if (&control.Tmp-Group-0.NAS-Port) {
        test_fail
 }
 
@@ -49,10 +49,10 @@ if (&control.Tmp-Group-0.Tmp-Integer-0) {
 #  Append something to it
 #
 &control.Tmp-Group-0 += {
-       &Tmp-IP-Address-0 = 127.0.0.1
+       &Framed-IP-Address = 127.0.0.1
 }
 
-if (!(&control.Tmp-Group-0.Tmp-IP-Address-0 == 127.0.0.1)) {
+if (!(&control.Tmp-Group-0.Framed-IP-Address == 127.0.0.1)) {
        test_fail
 }
 
@@ -60,14 +60,14 @@ if (!(&control.Tmp-Group-0.Tmp-IP-Address-0 == 127.0.0.1)) {
 #  Multiple members
 #
 &control.Tmp-Group-0 += {
-       &Tmp-Octets-0 = 0xabcdef
+       &Class = 0xabcdef
 }
 
-if (!(&control.Tmp-Group-0.Tmp-IP-Address-0 == 127.0.0.1)) {
+if (!(&control.Tmp-Group-0.Framed-IP-Address == 127.0.0.1)) {
        test_fail
 }
 
-if (!(&control.Tmp-Group-0.Tmp-Octets-0 == 0xabcdef)) {
+if (!(&control.Tmp-Group-0.Class == 0xabcdef)) {
        test_fail
 }
 
index aa78030624b478e56bcd317dc892f4ad3a82d057..b38a51b84751ff9a5ee902b1055a1d4bbff06f46 100644 (file)
@@ -2,20 +2,20 @@
 #  PRE: if edit
 #
 &request += {
-       &Tmp-IP-Address-0 = 192.0.2.1
-       &Tmp-IP-Address-0 = 192.0.2.2
+       &Framed-IP-Address = 192.0.2.1
+       &Framed-IP-Address = 192.0.2.2
 }
 
 #
 #  Delete only the second one
 #
-&request.Tmp-IP-Address-0[1] := {}
+&request.Framed-IP-Address[1] := {}
 
-if (&Tmp-IP-Address-0[#] != 1) {
+if (&Framed-IP-Address[#] != 1) {
        test_fail
 }
 
-if !(&Tmp-IP-Address-0[0] == 192.0.2.1) {
+if !(&Framed-IP-Address[0] == 192.0.2.1) {
        test_fail
 }
 
index 1a011ade6b10aa60492e541df87e82ed6d65d342..1581768ae305a68b5c63dae717f7ade9639cc6e0 100644 (file)
@@ -1,4 +1,5 @@
 #
 #  The RHS isn't a number or an enum
 #
-&Tmp-Integer-0 := '$[3][2]'    # ERROR
\ No newline at end of file
+uint32 a
+&a := '$[3][2]'        # ERROR
index fc6661452304e01d5f5cb01410e253ff47c3fc03..0f04709a7bc668bf95fa6266a637943e410f42a6 100644 (file)
@@ -1,26 +1,27 @@
 #
 #  PRE: edit
 #
-&Tmp-String-0 := "foo"
-&Tmp-String-0 ^= "bar"
+string test_string
+&test_string := "foo"
+&test_string ^= "bar"
 
-if (!(&Tmp-String-0 == "barfoo")) {
+if (!(&test_string == "barfoo")) {
        test_fail
 }
 
-&Tmp-String-0 := "foo"
-&Tmp-String-0 += "bar"
+&test_string := "foo"
+&test_string += "bar"
 
-if (!(&Tmp-String-0 == "foobar")) {
+if (!(&test_string == "foobar")) {
        test_fail
 }
 
 #
 #  Subtract is the inverse of add.
 #
-&Tmp-String-0 -= "bar"
+&test_string -= "bar"
 
-if (!(&Tmp-String-0 == "foo")) {
+if (!(&test_string == "foo")) {
        test_fail
 }
 
index 9f29053ebd2ef9d6e08bb699e81a02cf3cdfc899..6060671e66fc986146deec0e54a02bd518449d1d 100644 (file)
@@ -8,23 +8,23 @@
 #      = A' UNION B' if A and B are lists
 #
 
-&Tmp-String-0 := "foo"
-&control.Tmp-String-0 := "bar"
+&Reply-Message := "foo"
+&control.Reply-Message := "bar"
 
 # union
 &request |= &control
 
-if (!&Tmp-String-0) {
+if (!&Reply-Message) {
        test_fail
 }
 
 # The original value should be unchanged
-if (!(&Tmp-String-0[0] == "foo")) {
+if (!(&Reply-Message[0] == "foo")) {
        test_fail
 }
 
 #  and the new value should be there, too
-if (!(&Tmp-String-0[1] == "bar")) {
+if (!(&Reply-Message[1] == "bar")) {
        test_fail
 }
 
index d87b961c8ad0dfe665738e0666535131b67b7783..307e2e14551bc8228bba66d2bda894b362ef239b 100644 (file)
@@ -1,53 +1,63 @@
 #
 #  PRE: if xlat-attr-index
 #
-&Tmp-String-0 := '@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /'
-&Tmp-String-1 := '±§#$%^&+={[}];<,>?`|"'
-&Tmp-String-2 := '™¥¤'
-&Tmp-String-3 := '=C2=B1=C2=A7=23=24=25=5E=26=2B=3D=7B=5B=7D=5D=3B=3C=2C=3E=3F=60=7C=22'
-&Tmp-String-4 := '=E2=84=A2=C2=A5=C2=A4'
-&Tmp-String-5 := '=40=61=62=63=64=65=66=67'
+string test_string1
+string test_string2
+string test_string3
+string test_string4
+string test_string5
+string test_string6
+string test_string7
+string test_string8
+string test_string9
+
+&test_string1 := '@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /'
+&test_string2 := '±§#$%^&+={[}];<,>?`|"'
+&test_string3 := '™¥¤'
+&test_string4 := '=C2=B1=C2=A7=23=24=25=5E=26=2B=3D=7B=5B=7D=5D=3B=3C=2C=3E=3F=60=7C=22'
+&test_string5 := '=E2=84=A2=C2=A5=C2=A4'
+&test_string6 := '=40=61=62=63=64=65=66=67'
 
 # Mixture of safe and unsafe chars
-&Tmp-String-6 := 'ŒČÿ'
-&Tmp-String-7 := 'Å’=C4=8Cÿ'
+&test_string7 := 'ŒČÿ'
+&test_string8 := 'Å’=C4=8Cÿ'
 
 # = not followed by hex and without 2 following chars
-&Tmp-String-8 := 'a=Az=y'
+&test_string9 := 'a=Az=y'
 
-if (!((string)%escape.escape("%{Tmp-String-0}") == &Tmp-String-0)) {
+if (!((string)%escape.escape("%{test_string1}") == &test_string1)) {
        test_fail
 }
 
-if (!((string)%escape.escape("%{Tmp-String-1}") == &Tmp-String-3)) {
+if (!((string)%escape.escape("%{test_string2}") == &test_string4)) {
        test_fail
 }
 
-if (!((string)%escape.escape("%{Tmp-String-2}") == &Tmp-String-4)) {
+if (!((string)%escape.escape("%{test_string3}") == &test_string5)) {
        test_fail
 }
 
-if (!((string)%escape.unescape("%{Tmp-String-0}") == &Tmp-String-0)) {
+if (!((string)%escape.unescape("%{test_string1}") == &test_string1)) {
        test_fail
 }
 
-if (!((string)%escape.unescape("%{Tmp-String-3}") == "%{Tmp-String-1}")) {
+if (!((string)%escape.unescape("%{test_string4}") == "%{test_string2}")) {
        test_fail
 }
 
-if (!((string)%escape.unescape("%{Tmp-String-4}") == &Tmp-String-2)) {
+if (!((string)%escape.unescape("%{test_string5}") == &test_string3)) {
        test_fail
 }
 
-if (!((string)%escape.escape("%{Tmp-String-6}") == &Tmp-String-7)) {
+if (!((string)%escape.escape("%{test_string7}") == &test_string8)) {
        test_fail
 }
 
-if (!((string)%escape.unescape("%{Tmp-String-7}") == &Tmp-String-6)) {
+if (!((string)%escape.unescape("%{test_string8}") == &test_string7)) {
        test_fail
 }
 
-if (!((string)%escape.unescape("%{Tmp-String-8}") == &Tmp-String-8)) {
+if (!((string)%escape.unescape("%{test_string9}") == &test_string9)) {
        test_fail
 }
 
index 30d4b6453579416e96cfb6de3de69ce188537d96..d600ce50d0b8b1d49fe4fa31e75035ae76e82fe8 100644 (file)
@@ -1,60 +1,63 @@
 #
 #  PRE: if xlat-attr-index
 #
+octets test_octets
+ipaddr test_ipaddr
+string result_string
+
+&test_octets := 0x69206861766520736361727920656d626564646564207468696e67730020696e73696465206d65
+&test_ipaddr := 127.0.0.1
 &request += {
-       &Tmp-Octets-0 = 0x69206861766520736361727920656d626564646564207468696e67730020696e73696465206d65
-       &Tmp-Octets-1 = 0x30783031013078303707307830410A307830440D222230786230b0C2b0
-       &Tmp-String-0 = "i have scary embedded things\000 inside me"
-       &Tmp-String-0 = "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°"
+       &Reply-Message = "i have scary embedded things\000 inside me"
+       &Reply-Message = "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°"
 
        # and again with single quoted strings.
        # unlike other languages, \r, \t, and \n have meaning inside of 'string'
-       &Tmp-String-1 = 'i have scary embedded things\000 inside me'
-       &Tmp-String-1 = '0x01\0010x07\0070x0A\n0x0D\r""0xb0\260°'
-
-       &Tmp-String-2 = 'i have scary embedded things\000 inside me'
-       &Tmp-String-2 = "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°"
+       &Callback-Number = 'i have scary embedded things\000 inside me'
+       &Callback-Number = '0x01\0010x07\0070x0A\n0x0D\r""0xb0\260°'
 
-       &Tmp-IP-Address-0 = 127.0.0.1
+       &Callback-Id = 'i have scary embedded things\000 inside me'
+       &Callback-Id = "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°"
 }
 
 
-if (!("%length(%{Tmp-String-0})" == 39)) {
+if (!("%length(%{Reply-Message})" == 39)) {
        test_fail
 }
 
-if (!("%length(%{Tmp-String-1})" == 42)) {
+if (!("%length(%{Callback-Number})" == 42)) {
        test_fail
 }
 
-&Tmp-String-8 := "%{(string) %{Tmp-Octets-0}}"
-if (!(&Tmp-String-8 == "i have scary embedded things\000 inside me")) {
+&result_string := "%{(string) %{test_octets}}"
+if (!(&result_string == "i have scary embedded things\000 inside me")) {
        test_fail
 }
 
-if (!(&Tmp-String-0 == "i have scary embedded things\000 inside me")) {
+if (!(&Reply-Message == "i have scary embedded things\000 inside me")) {
        test_fail
 }
 
-&Tmp-String-8 := "%{(string) %{Tmp-Octets-1}}"
-if (!(&Tmp-String-8 == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) {
+&test_octets := 0x30783031013078303707307830410A307830440D222230786230b0C2b0
+&result_string := "%{(string) %{test_octets}}"
+if (!(&result_string == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) {
        test_fail
 }
 
-if (!("%{Tmp-String-0[0]}" == "i have scary embedded things\000 inside me")) {
+if (!("%{Reply-Message[0]}" == "i have scary embedded things\000 inside me")) {
        test_fail
 }
 
-if (!(&Tmp-String-0[1] == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) {
+if (!(&Reply-Message[1] == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) {
        test_fail
 }
 
 # And another slightly different codepath...
-if !("%{Tmp-String-0[*]}" == "i have scary embedded things\000 inside me0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°") {
+if !("%{Reply-Message[*]}" == "i have scary embedded things\000 inside me0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°") {
        test_fail
 }
 
-if (!(&Tmp-String-0[0] == &Tmp-String-0[0])) {
+if (!(&Reply-Message[0] == &Reply-Message[0])) {
        test_fail
 }
 
@@ -62,22 +65,22 @@ if (!(&Tmp-String-0[0] == &Tmp-String-0[0])) {
 #  This seems weird... double escapes for most things, but single escapes
 #  for the quotation marks.
 #
-if (!(&Tmp-String-2[1] == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) {
+if (!(&Callback-Id[1] == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) {
        test_fail
 }
 
 #
 # And again as an attribute reference
 #
-if (!(&Tmp-String-2[1] == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) {
+if (!(&Callback-Id[1] == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) {
        test_fail
 }
 
 #
 #  Other data types
 #
-&Tmp-String-0 := "%{(string) &Tmp-IP-Address-0}"
-if (!(%length(%{Tmp-String-0}) == 9)) {
+&result_string := "%{(string) &test_ipaddr}"
+if (!(%length(%{result_string}) == 9)) {
        test_fail
 }
 
index 296a5a44f0c1e2ecb094c9b43785fd0d2374f684..7b3a8f62096493af12b13931480ad05e0ea75571 100644 (file)
@@ -1,34 +1,21 @@
-&request += {
-       &Tmp-Ethernet-0 = 00:11:22:33:44:54,
-       &Tmp-Ethernet-0 = 00:11:22:33:44:55,
-       &Tmp-Octets-0 = 0x001122334456,
-}
+octets test_octets
+ether test_ether
 
-if (!(&Tmp-Ethernet-0[0] == 00:11:22:33:44:54)) {
-       test_fail
-}
+&test_octets := 0x001122334456
 
-if (!(&Tmp-Ethernet-0[1] == 00:11:22:33:44:55)) {
-       test_fail
-}
-
-&request += {
-       &Tmp-Ethernet-0 = &Tmp-Octets-0[0]
-}
+&test_ether = &test_octets
 
-if (!(&Tmp-Ethernet-0[2] == 00:11:22:33:44:56)) {
+if (!(&test_ether == 00:11:22:33:44:56)) {
        test_fail
 }
 
 # invalid assignment
 # this will silently fail with a no Module-Failure-Message.
 transaction {
-       &request += {
-               &Tmp-Ethernet-0 = %{Tmp-Ethernet-1[42]}
-       }
+       &test_ether := %{Class[42]}
 }
 
-if (!(%{request.Tmp-Ethernet-0[#]} == 3)) {
+if (&test_ether) {
        test_fail
 }
 
index c7a146adfd0390de9e1481ce7d3601c13b8a81d6..03f660e6da2420010a0a83fef8f98544d41bbc5a 100644 (file)
@@ -1,6 +1,9 @@
 #
 #  PRE: if
 #
+uint32 test_integer1
+uint32 test_integer2
+date test_date
 
 #
 #  Simple
@@ -25,30 +28,29 @@ if !(1 + 2 * 3 + 4 == 11) {
 #
 #  attribute references
 #
-&Tmp-Integer-0 := 1
-&Tmp-Integer-1 := 3
-&Tmp-Integer-2 := 4
-&Tmp-Date-0 := "%l"
+&test_integer1 := 3
+&test_integer2 := 4
+&test_date := "%l"
 
-if (!(%{ 1 + 2 * &Tmp-Integer-1 + 4} == 11)) {
+if (!(%{ 1 + 2 * &test_integer1 + 4} == 11)) {
        test_fail
 }
-if !(1 + 2 * &Tmp-Integer-1 + 4 == 11) {
+if !(1 + 2 * &test_integer1 + 4 == 11) {
        test_fail
 }
 
 
-if (!(%{ 1 + 2 * (&Tmp-Integer-1 + 4)} == 15)) {
+if (!(%{ 1 + 2 * (&test_integer1 + 4)} == 15)) {
        test_fail
 }
-if !(1 + 2 * (&Tmp-Integer-1 + 4) == 15) {
+if !(1 + 2 * (&test_integer1 + 4) == 15) {
        test_fail
 }
 
-if (!(%{ 1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2)} == 15)) {
+if (!(%{ 1 + 2 * (&test_integer1 + &test_integer2)} == 15)) {
        test_fail
 }
-if !(1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2) == 15) {
+if !(1 + 2 * (&test_integer1 + &test_integer2) == 15) {
        test_fail
 }
 
@@ -94,10 +96,10 @@ if !(((1 << 2) | 1) == 5) { # needs extra () to resolve precedence
        test_fail
 }
 
-if ("%{ &Tmp-Date-0}" <= 0) {
+if ("%{ &test_date}" <= 0) {
        test_fail
 }
-if (&Tmp-Date-0 <= 0) {
+if (&test_date <= 0) {
        test_fail
 }
 
@@ -111,10 +113,10 @@ if !(6 + -(1 + 3) == 2) {
        test_fail
 }
 
-if (!(%{ 6 * -&Tmp-Integer-2} == -24)) {
+if (!(%{ 6 * -&test_integer2} == -24)) {
        test_fail
 }
-if !(6 * -&Tmp-Integer-2 == -24) {
+if !(6 * -&test_integer2 == -24) {
        test_fail
 }
 
index c545439047d851e4e87b5ad4777b0f5ad77872f2..a71dcc3802096c8a03d24127323f49b2490a18f4 100644 (file)
@@ -1,17 +1,18 @@
 #
 #  PRE: foreach foreach-break
 #
+string test_string
 
-&Tmp-String-0 := "ABCDEF_8"
+&test_string := "ABCDEF_8"
 
 #
-#  This creates a bunch of Tmp-String-0 attributes.
+#  This creates a bunch of User-Name attributes.
 #
-&control.Tmp-String-0 := { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g" }
+&control.User-Name := { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g" }
 
-foreach &control.Tmp-String-0 {
-       if ("%{Tmp-String-0[*]}" =~ /([A-Z0-9\-]*)_%{Foreach-Variable-0}/) {
-               &Tmp-String-0 := "%{1}"
+foreach &control.User-Name {
+       if ("%{test_string}" =~ /([A-Z0-9\-]*)_%{Foreach-Variable-0}/) {
+               &test_string := "%{1}"
                success
                break
        }
index bb97bf8481e4c57294cab81b9b2b6e52ffe1906c..5f88190840d62a4f85beb8d14b2079691bee5ca9 100644 (file)
@@ -2,26 +2,26 @@
 #  PRE: foreach
 #
 
-&control.Tmp-String-0 := { "0", "1", "2", "3" }
+&control.User-Name := { "0", "1", "2", "3" }
 
-foreach &control.Tmp-String-0 {
+foreach &control.User-Name {
        &control -= {
-               &Tmp-String-0 == "%{1 + %{Foreach-Variable-0}}"
+               &User-Name == "%{1 + %{Foreach-Variable-0}}"
        }
        &request += {
-               &Tmp-String-0 = "%{Foreach-Variable-0}"
+               &Filter-Id = "%{Foreach-Variable-0}"
        }
 }
 
-if (!&Tmp-String-0[0] || !&Tmp-String-0[1] || !&Tmp-String-0[2] || !&Tmp-String-0[3]) {
+if (!&Filter-Id[0] || !&Filter-Id[1] || !&Filter-Id[2] || !&Filter-Id[3]) {
        test_fail
 }
 
-if (!((&Tmp-String-0[0] == '0')) || (!(&Tmp-String-0[1] == '1')) || (!(&Tmp-String-0[2] == '2')) || (!(&Tmp-String-0[3] == '3'))) {
+if (!((&Filter-Id[0] == '0')) || (!(&Filter-Id[1] == '1')) || (!(&Filter-Id[2] == '2')) || (!(&Filter-Id[3] == '3'))) {
        test_fail
 }
 
-if (!&control.Tmp-String-0[0] || &control.Tmp-String-0[1] || &control.Tmp-String-0[2] || &control.Tmp-String-0[3]) {
+if (!&control.User-Name[0] || &control.User-Name[1] || &control.User-Name[2] || &control.User-Name[3]) {
        test_fail
 }
 
index efdda351a032e131248f6e321ade2425a4b30660..24d1b61f9dad39c916285166ae4f82916b19f626 100644 (file)
@@ -1,12 +1,13 @@
 # PRE: foreach if-regex-match
+string cisco_prefix
 
 # This is what most people end up using foreach for,
 # so we should probably test it works.
-&Tmp-String-0 := "cisco"
+&cisco_prefix := "cisco"
 
 # Expanded regex
 foreach &Vendor-Specific.Cisco.AVPair {
-       if ("%{Foreach-Variable-0}"  =~ /^%{Tmp-String-0}=(.*)$/i) {
+       if ("%{Foreach-Variable-0}"  =~ /^%{cisco_prefix}=(.*)$/i) {
                &reply += {
                        &Called-Station-Id = "%{1}"
                }
index 3e312c9a1bb81674839879c01776916037a783e1..2e035e270cd1ad22d5b3b19d9cb143a689525370 100644 (file)
@@ -2,34 +2,34 @@
 #  PRE: foreach
 #
 &control += {
-       &Tmp-String-0 = "ssid=ABCDEF"
-       &Tmp-String-0 = "ssid=GHIJKL"
+       &Filter-Id = "ssid=ABCDEF"
+       &Filter-Id = "ssid=GHIJKL"
 }
 
 if (&User-Name) {
-       foreach &control.Tmp-String-0 {
+       foreach &control.Filter-Id {
                if ("%{Foreach-Variable-0}" =~ /(.*)/) {
-                       &control.Tmp-String-1 := "%{1}"
+                       &control.Calling-Station-Id := "%{1}"
                }
        }
 }
 
-if (!(&control.Tmp-String-1 == 'ssid=GHIJKL')) {
+if (!(&control.Calling-Station-Id == 'ssid=GHIJKL')) {
        test_fail
 }
 
-&control -= &Tmp-String-1[*]
+&control -= &Calling-Station-Id[*]
 
-foreach &control.Tmp-String-0 {
+foreach &control.Filter-Id {
        if ("%{Foreach-Variable-0}" =~ /(.*)/) {
-               &control.Tmp-String-1 := "%{1}"
+               &control.Calling-Station-Id := "%{1}"
        }
 }
 
-if (!(&control.Tmp-String-1 == 'ssid=GHIJKL')) {
+if (!(&control.Calling-Station-Id == 'ssid=GHIJKL')) {
        test_fail
 }
 
-&control -= &Tmp-String-1[*]
+&control -= &Calling-Station-Id[*]
 
 success
index 316ab3ae01f7aa9be0a04e7d5f02b8163405bb5a..c5d753b6caf65f9168134ab6f5ae4bcc8596ea69 100644 (file)
 #
 # PRE: if
 #
-&Tmp-String-0          := '9870'
-&Tmp-Octets-0          := 0x39383731
-&Tmp-IP-Address-0      := 57.56.55.50
-&Tmp-Integer-0         := 959985460
-&Tmp-Cast-IfId         := '0000:0000:3938:3737'
-&Tmp-Cast-IPv6Addr     := '::3938:3738'
-&Tmp-Cast-IPv6Prefix   := '::3938:3739/128'
-&Tmp-Cast-Byte         := 58
-&Tmp-Cast-Short                := 14139
-&Tmp-Cast-Ether                := 00:00:39:38:37:3c
-&Tmp-Cast-Integer64    := 1152921505566832445
-&Tmp-Cast-IPv4Prefix   := 57.56.55.62/32
-
-ok  # break up edit sections
-
-&Tmp-String-1 := {
-       %hex(%{Tmp-String-0})
-       %hex(%{Tmp-Octets-0})
-       %hex(%{Tmp-IP-Address-0})
-       %hex(%{Tmp-Integer-0})
-       %hex(%{Tmp-Cast-Ifid})
-       %hex(%{Tmp-Cast-IPv6Addr})
-       %hex(%{Tmp-Cast-IPv6Prefix})
-       %hex(%{Tmp-Cast-Byte})
-}
+string test_string
+octets test_octets
+ipaddr test_ipaddr
+uint32 test_integer
+ifid test_ifid
+ipv6addr test_ipv6addr
+ipv6prefix test_ipv6prefix
+byte test_byte
+uint16 test_short
+ether test_ether
+uint64 test_int64
+ipv4prefix test_ipv4prefix
+
+string result_string
+
+&test_string           := '9870'
+&test_octets           := 0x39383731
+&test_ipaddr           := 57.56.55.50
+&test_integer          := 959985460
+&test_ifid             := '0000:0000:3938:3737'
+&test_ipv6addr         := '::3938:3738'
+&test_ipv6prefix       := '::3938:3739/128'
+&test_byte             := 58
+&test_short            := 14139
+&test_ether            := 00:00:39:38:37:3c
+&test_int64            := 1152921505566832445
+&test_ipv4prefix       := 57.56.55.62/32
 
 # String
-if (!(&Tmp-String-1[0] == '39383730')) {
+&result_string := %hex(%{test_string})
+if (!(&result_string == '39383730')) {
        test_fail
 }
 
 # Octets
-if (!(&Tmp-String-1[1] == '39383731')) {
+&result_string := %hex(%{test_octets})
+if (!(&result_string == '39383731')) {
        test_fail
 }
 
 # IP Address
-if (!(&Tmp-String-1[2] == '39383732')) {
+&result_string := %hex(%{test_ipaddr})
+if (!(&result_string == '39383732')) {
        test_fail
 }
 
 # Integer
-if (!(&Tmp-String-1[3] == '39383734')) {
+&result_string := %hex(%{test_integer})
+if (!(&result_string == '39383734')) {
        test_fail
 }
 
 # ifid
-if (!(&Tmp-String-1[4] == '0000000039383737')) {
+&result_string := %hex(%{test_ifid})
+if (!(&result_string == '0000000039383737')) {
        test_fail
 }
 
 # ipv6addr
-if (!(&Tmp-String-1[5] == '00000000000000000000000039383738')) {
+&result_string := %hex(%{test_ipv6addr})
+if (!(&result_string == '00000000000000000000000039383738')) {
        test_fail
 }
 
 # ipv6addrprefix
-if (!(&Tmp-String-1[6] == '008000000000000000000000000039383739')) {
+&result_string := %hex(%{test_ipv6prefix})
+if (!(&result_string == '008000000000000000000000000039383739')) {
        test_fail
 }
 
 # byte
-if (!(&Tmp-String-1[7] == '3a')) {
+&result_string := %hex(%{test_byte})
+if (!(&result_string == '3a')) {
        test_fail
 }
 
-&Tmp-String-1 := {
-       %hex(%{Tmp-Cast-Short})
-       %hex(%{Tmp-Cast-Ether})
-       %hex(%{Tmp-Cast-Integer64})
-       %hex(%{Tmp-Cast-IPv4Prefix})
-}
-
 # short
-if (!(&Tmp-String-1[0] == '373b')) {
+&result_string := %hex(%{test_short})
+if (!(&result_string == '373b')) {
        test_fail
 }
 
 # ethernet
-if (!(&Tmp-String-1[1] == '00003938373c')) {
+&result_string := %hex(%{test_ether})
+if (!(&result_string == '00003938373c')) {
        test_fail
 }
 
 # integer64
-if (!(&Tmp-String-1[2] == '100000003938373d')) {
+&result_string := %hex(%{test_int64})
+if (!(&result_string == '100000003938373d')) {
        test_fail
 }
 
 # ipv4prefix
-if (!(&Tmp-String-1[3] == '203938373e')) {
-       test_fail
-}
-
-# Empty input
-if (&Tmp-String-1[4]) {
+&result_string := %hex(%{test_ipv4prefix})
+if (!(&result_string == '203938373e')) {
        test_fail
 }
 
index 73267ddb506a26a8bc6c12d22105cd02a3b05f3e..87aef13d766d84430f4ff7a481b4246aa8faf024 100644 (file)
 #
 
 &request += {
-       &Tmp-String-0 = 'foo'
-       &Tmp-String-0 = 'bar'
-       &Tmp-String-0 = 'baz'
+       &Filter-Id = 'foo'
+       &Filter-Id = 'bar'
+       &Filter-Id = 'baz'
 
-       &Tmp-String-1 = 'GROUP ADMINISTRATORS'
-       &Tmp-String-1 = 'GROUP STUDENTS'
-       &Tmp-String-1 = 'GROUP PEONS'
+       &NAS-Port-Id = 'GROUP ADMINISTRATORS'
+       &NAS-Port-Id = 'GROUP STUDENTS'
+       &NAS-Port-Id = 'GROUP PEONS'
 
-       &Tmp-String-2 = 'PEONS'
-       &Tmp-String-2 = 'STUDENTS'
-       &Tmp-String-2 = 'ADMINISTRATORS'
+       &Reply-Message = 'PEONS'
+       &Reply-Message = 'STUDENTS'
+       &Reply-Message = 'ADMINISTRATORS'
 
-       &Tmp-String-3 = 'no'
-       &Tmp-String-3 = 'no'
-       &Tmp-String-3 = 'yes'
+       &Callback-Id = 'no'
+       &Callback-Id = 'no'
+       &Callback-Id = 'yes'
 
-       &Tmp-Integer-0 = 1
-       &Tmp-Integer-0 = 2
-       &Tmp-Integer-0 = 5
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 5
 }
 
 &control += {
-       &Tmp-String-0 = 'foo'
-       &Tmp-String-0 = 'bar'
-       &Tmp-String-0 = 'baz'
+       &Filter-Id = 'foo'
+       &Filter-Id = 'bar'
+       &Filter-Id = 'baz'
 
-       &Tmp-String-1 = 'boink'
-       &Tmp-String-1 = 'tard'
-       &Tmp-String-1 = 'dink'
-       &Tmp-String-1 = 'slink'
+       &NAS-Port-Id = 'boink'
+       &NAS-Port-Id = 'tard'
+       &NAS-Port-Id = 'dink'
+       &NAS-Port-Id = 'slink'
 
-       &Tmp-Integer-0 = 01
-       &Tmp-Integer-0 = 02
-       &Tmp-Integer-0 = 05
-       &Tmp-Integer-0 = 04
+       &NAS-Port = 01
+       &NAS-Port = 02
+       &NAS-Port = 05
+       &NAS-Port = 04
 
-       &Tmp-Integer-1 = 10
-       &Tmp-Integer-1 = 20
-       &Tmp-Integer-1 = 30
+       &Port-Limit = 10
+       &Port-Limit = 20
+       &Port-Limit = 30
 }
 
 #
 #  Mmmm O(N^2)
 #
-if (!(&Tmp-String-0[*] == &control.Tmp-String-0[*])) {
+if (!(&Filter-Id[*] == &control.Filter-Id[*])) {
        test_fail
 }
 
-if (&Tmp-String-0[*] == &control.Tmp-String-1[*]) {
+if (&Filter-Id[*] == &control.NAS-Port-Id[*]) {
        test_fail
 }
 
-if (&Tmp-String-1[*] == &control.Tmp-String-0[*]) {
+if (&NAS-Port-Id[*] == &control.Filter-Id[*]) {
        test_fail
 }
 
 #
 #  Integer comparison and normalisation
 #
-if (!(&Tmp-Integer-0 == &control.Tmp-Integer-0)) {
+if (!(&NAS-Port == &control.NAS-Port)) {
        test_fail
 }
 
 #
-#  if any value of request.Tmp-Integer-0 > any value of
-#  request.Tmp-Integer-1 then evaluate to true
+#  if any value of request.NAS-Port > any value of
+#  request.Port-Limit then evaluate to true
 #
-if (&Tmp-Integer-0[*] > &control.Tmp-Integer-1[*]) {
+if (&NAS-Port[*] > &control.Port-Limit[*]) {
        test_fail
 }
 
 #
 #  Compiled regex comparisons
 #
-if (&Tmp-String-1[*] !~ /PEONS$/) {
+if (&NAS-Port-Id[*] !~ /PEONS$/) {
        test_fail
 }
 
-if (&control.Tmp-String-1 =~ /PEONS$/) {
+if (&control.NAS-Port-Id =~ /PEONS$/) {
        test_fail
 }
 
-if (&control.Tmp-String-1 =~ /DINKS$/) {
+if (&control.NAS-Port-Id =~ /DINKS$/) {
        test_fail
 }
 
 #
 #  Dynamic regex comparisons
 #
-if (&Tmp-String-1[*] !~ /%{Tmp-String-2[0]}$/) {
+if (&NAS-Port-Id[*] !~ /%{Reply-Message[0]}$/) {
        test_fail
 }
 
-if (&Tmp-String-1 =~ /%{Tmp-String-2[1]}$/) {
+if (&NAS-Port-Id =~ /%{Reply-Message[1]}$/) {
        test_fail
 }
 
-if !(&Tmp-String-1 =~ /%{Tmp-String-2[2]}$/) {
+if !(&NAS-Port-Id =~ /%{Reply-Message[2]}$/) {
        test_fail
 }
 
-if (&Tmp-String-1 =~ /%{Tmp-String-2[#]}$/) {
+if (&NAS-Port-Id =~ /%{Reply-Message[#]}$/) {
        test_fail
 }
 
 #
 #  XLAT virtual comparisons
 #
-if (!(&control.Tmp-Integer-0[*] == %{control.Tmp-Integer-0[#]})) {
+if (!(&control.NAS-Port[*] == %{control.NAS-Port[#]})) {
        test_fail
 }
 
 #
 #  Literal comparisons
 #
-if (!(&control.Tmp-String-1[*] == 'boink')) {
+if (!(&control.NAS-Port-Id[*] == 'boink')) {
        test_fail
 }
 
-if (&control.Tmp-String-1[*] == 'foo') {
+if (&control.NAS-Port-Id[*] == 'foo') {
        test_fail
 }
 
-if (&Tmp-Integer-0[*] > 10) {
+if (&NAS-Port[*] > 10) {
        test_fail
 }
 
-if (!(&Tmp-Integer-0[*] < 10)) {
+if (!(&NAS-Port[*] < 10)) {
        test_fail
 }
 
index 459288834d4bd44fe9f38b14ef4b67a9980dad63..aef8ac71211bcea171fdc81319f9b0d0d53552fc 100644 (file)
@@ -35,14 +35,14 @@ if ("%{1}") {
 #  Check assignment of regex null-match
 #
 if (&control.Password.Cleartext =~ /hell(o)(.*)/) {
-       &control.Tmp-String-1 := "%{2}"
+       &control.Filter-Id := "%{2}"
 }
 
-if (!&control.Tmp-String-1) {
+if (!&control.Filter-Id) {
        test_fail
 }
 
-if (!(&control.Tmp-String-1 == "")) {
+if (!(&control.Filter-Id == "")) {
        test_fail
 }
 
index 925cf362053a32dfc2dfbef3cf487f79b8f72815..3da4cf8b32fa08e9314cfca9b4325d19c2d65b38 100644 (file)
@@ -1,19 +1,23 @@
 # PRE: if
 #
-&Tmp-Integer-0 := '123456789'
+string test_string
+string dummy_string
+uint32 test_integer
+
+&test_integer := '123456789'
 
 # Non matching on attribute ref
-if !(&User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{Tmp-String-0}/) {
+if !(&User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{test_string}/) {
        test_fail
 }
 
 # Matching on xlat expanded value
-if !("%{User-Name}" =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{Tmp-String-0}/) {
+if !("%{User-Name}" =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{test_string}/) {
        test_fail
 }
 
 # Matching on attribute ref with capture groups
-if (&User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{Tmp-String-0}/) {
+if (&User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{test_string}/) {
        # Test all the capture groups
        &reply.User-Name := "%{7}_%{6}_%{5}_%{4}_%{3}_%{2}_%{1}_%{0}"
 }
@@ -22,7 +26,7 @@ else {
 }
 
 # Checking capture groups are cleared out correctly
-if (&User-Name =~ /^([0-9])_%{Tmp-String-0}/) {
+if (&User-Name =~ /^([0-9])_%{test_string}/) {
        if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1_1')) {
                test_fail
        }
@@ -32,7 +36,7 @@ else {
 }
 
 # Checking capture groups are cleared out correctly when there are no matches
-if (&User-Name =~ /^.%{Tmp-String-0}/) {
+if (&User-Name =~ /^.%{test_string}/) {
        if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1')) {
                test_fail
        }
@@ -62,68 +66,68 @@ else {
 }
 
 # uncompiled - ref - insensitive
-if !(&Calling-Station-Id =~ /:roamyroam%{Tmp-String-0}$/i) {
+if !(&Calling-Station-Id =~ /:roamyroam%{test_string}$/i) {
        test_fail
 }
 
 # uncompiled - expansion - insensitive
-if !(&Calling-Station-Id =~ /:roamyroam%{Tmp-String-0}$/i) {
+if !(&Calling-Station-Id =~ /:roamyroam%{test_string}$/i) {
        test_fail
 }
 
 # uncompiled - enum - ref - insensitive
-if !(&Service-Type =~ /^framed-user%{Tmp-String-0}$/i) {
+if !(&Service-Type =~ /^framed-user%{test_string}$/i) {
        test_fail
 }
 
 # uncompiled - enum - expansion - insensitive
-if !("%{Service-Type}" =~ /^framed-user%{Tmp-String-0}$/i) {
+if !("%{Service-Type}" =~ /^framed-user%{test_string}$/i) {
        test_fail
 }
 
 # uncompiled - enum - ref
-if (&Service-Type =~ /^framed-user%{Tmp-String-0}$/) {
+if (&Service-Type =~ /^framed-user%{test_string}$/) {
        test_fail
 }
 
 # uncompiled - integer - ref
-if !(&Tmp-Integer-0 =~ /%{Tmp-Integer-0}/) {
+if !(&test_integer =~ /%{test_integer}/) {
        test_fail
 }
 
-&Tmp-String-0 := "foo\nbar"
+&test_string := "foo\nbar"
 
 # uncompiled - ref - multiline
-if !(&Tmp-String-0 =~ /^foo$%{Tmp-String-8}/m) {
+if !(&test_string =~ /^foo$%{dummy_string}/m) {
        test_fail
 }
 
 # uncompiled - ref - non-multiline
-if (&Tmp-String-0 =~ /^foo$%{Tmp-String-8}/) {
+if (&test_string =~ /^foo$%{dummy_string}/) {
        test_fail
 }
 
 # uncompiled - ref - non-multiline
-if !(&Tmp-String-0 =~ /^foo\nbar%{Tmp-String-8}$/) {
+if !(&test_string =~ /^foo\nbar%{dummy_string}$/) {
        test_fail
 }
 
 # uncompiled - ref - multiline
-if !(&Tmp-String-0 =~ /^bar%{Tmp-String-8}$/m) {
+if !(&test_string =~ /^bar%{dummy_string}$/m) {
        test_fail
 }
 
 # uncompiled - ref - multiline - sensitive
-if (&Tmp-String-0 =~ /^BAR%{Tmp-String-8}$/m) {
+if (&test_string =~ /^BAR%{dummy_string}$/m) {
        test_fail
 }
 
 # uncompiled - ref - multiline - insensitive
-if !(&Tmp-String-0 =~ /^BAR%{Tmp-String-8}$/mi) {
+if !(&test_string =~ /^BAR%{dummy_string}$/mi) {
        test_fail
 }
 
 # uncompiled - ref - multiline - insensitive (flag order reversed)
-if !(&Tmp-String-0 =~ /^BAR%{Tmp-String-8}$/im) {
+if !(&test_string =~ /^BAR%{dummy_string}$/im) {
        test_fail
 }
index 524a14d388d634547c7c2b6a8249ca544950d7c9..566421a8662a1341be4ae50e8d3940c59fb7e395 100644 (file)
@@ -1,5 +1,6 @@
 # PRE: if
 #
+string test_string
 
 # Non matching on attribute ref
 if !(&User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])/) {
@@ -65,42 +66,42 @@ if (&Service-Type =~ /^framed-user$/) {
        test_fail
 }
 
-&Tmp-String-0 := "foo\nbar"
+&test_string := "foo\nbar"
 
 # compiled - ref - multiline
-if !(&Tmp-String-0 =~ /^foo$/m) {
+if !(&test_string =~ /^foo$/m) {
        test_fail
 }
 
 # compiled - ref - non-multiline
-if (&Tmp-String-0 =~ /^foo$/) {
+if (&test_string =~ /^foo$/) {
        test_fail
 }
 
 # compiled - ref - non-multiline
 # Not all POSIX implementations support the \n character classes
 # so only run this test if the server was built with libpcre.
-if ((('${feature.regex-pcre}' == 'yes') || ('${feature.regex-pcre2}' == 'yes')) && !(&Tmp-String-0 =~ /^foo\nbar$/)) {
+if ((('${feature.regex-pcre}' == 'yes') || ('${feature.regex-pcre2}' == 'yes')) && !(&test_string =~ /^foo\nbar$/)) {
        test_fail
 }
 
 # compiled - ref - multiline
-if !(&Tmp-String-0 =~ /^bar$/m) {
+if !(&test_string =~ /^bar$/m) {
        test_fail
 }
 
 # compiled - ref - multiline - sensitive
-if (&Tmp-String-0 =~ /^BAR$/m) {
+if (&test_string =~ /^BAR$/m) {
        test_fail
 }
 
 # compiled - ref - multiline - insensitive
-if !(&Tmp-String-0 =~ /^BAR$/mi) {
+if !(&test_string =~ /^BAR$/mi) {
        test_fail
 }
 
 # compiled - ref - multiline - insensitive (flag order reversed)
-if !(&Tmp-String-0 =~ /^BAR$/im) {
+if !(&test_string =~ /^BAR$/im) {
        test_fail
 }
 
index 31a6ef01063b764b0a10e169b45050ae60a44839..dbaa9f49b51417d4c0d8fa7e5efa837358c59abb 100644 (file)
@@ -1,9 +1,12 @@
 # PRE: if if-failed-xlat
 #
+string result_string
+string dummy_string
+
 if (('${feature.regex-pcre}' == 'yes') || ('${feature.regex-pcre2}' == 'yes')) {
        &request += {
-               &Tmp-Integer-0 = '123456789'
-               &Tmp-Integer-1 = 1
+               &NAS-Port = '123456789'
+               &Port-Limit = 1
        }
 
 # Check failure when no previous capture - full capture
@@ -29,7 +32,7 @@ if (!(&Module-Failure-Message[*] == "No previous named regex capture group")) {
 &request -= &Module-Failure-Message[*]
 
 # Check failure when no previous capture - numbered group
-if (%regex(%{Tmp-Integer-1})) {
+if (%regex(%{Port-Limit})) {
        test_fail
 }
 
@@ -40,9 +43,9 @@ if (!(&Module-Failure-Message[*] == "No previous numbered regex capture group"))
 &request -= &Module-Failure-Message[*]
 
 # uncompiled - ref - named capture groups
-if (&User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])%{Tmp-String-1}/) {
-       &Tmp-String-0 := "%regex(seven)_%regex(six)_%regex(five)_%regex(four)_%regex(three)_%regex(two)_%regex(one)_%{0}"
-       if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
+if (&User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])%{dummy_string}/) {
+       &result_string := "%regex(seven)_%regex(six)_%regex(five)_%regex(four)_%regex(three)_%regex(two)_%regex(one)_%{0}"
+       if (!(&result_string == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
                test_fail
        }
 }
@@ -51,9 +54,9 @@ else {
 }
 
 # Checking capture groups are cleared out correctly
-if (&User-Name =~ /^(?<one>[0-9])_%{Tmp-String-1}/) {
-       &Tmp-String-0 := "%{0}%regex(one)%regex(two)%regex(three)%regex(four)%regex(five)%regex(six)%regex(seven)"
-       if (!(&Tmp-String-0 == '1_1')) {
+if (&User-Name =~ /^(?<one>[0-9])_%{dummy_string}/) {
+       &result_string := "%{0}%regex(one)%regex(two)%regex(three)%regex(four)%regex(five)%regex(six)%regex(seven)"
+       if (!(&result_string == '1_1')) {
                test_fail
        }
 }
@@ -62,9 +65,9 @@ else {
 }
 
 # Checking capture groups are cleared out correctly when there are no matches
-if (&User-Name =~ /^.%{Tmp-String-1}/) {
-       &Tmp-String-0 := "%{0}%regex(one)%regex(two)%regex(three)%regex(four)%regex(five)%regex(six)%regex(seven)"
-       if (!(&Tmp-String-0 == '1')) {
+if (&User-Name =~ /^.%{dummy_string}/) {
+       &result_string := "%{0}%regex(one)%regex(two)%regex(three)%regex(four)%regex(five)%regex(six)%regex(seven)"
+       if (!(&result_string == '1')) {
                test_fail
        }
 }
@@ -74,8 +77,8 @@ else {
 
 # compiled - ref - named capture groups
 if (&User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
-       &Tmp-String-0 := "%regex(seven)_%regex(six)_%regex(five)_%regex(four)_%regex(three)_%regex(two)_%regex(one)_%{0}"
-       if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
+       &result_string := "%regex(seven)_%regex(six)_%regex(five)_%regex(four)_%regex(three)_%regex(two)_%regex(one)_%{0}"
+       if (!(&result_string == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
                test_fail
        }
 }
@@ -85,8 +88,8 @@ else {
 
 # compiled - xlat - named capture groups
 if ('1_2_3_4_5_6_7' =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
-       &Tmp-String-0 := "%regex(seven)_%regex(six)_%regex(five)_%regex(four)_%regex(three)_%regex(two)_%regex(one)_%{0}"
-       if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
+       &result_string := "%regex(seven)_%regex(six)_%regex(five)_%regex(four)_%regex(three)_%regex(two)_%regex(one)_%{0}"
+       if (!(&result_string == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
                test_fail
        }
 }
@@ -96,8 +99,8 @@ else {
 
 # compiled - ref - named capture groups (numeric indexes)
 if (&User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
-       &Tmp-String-0 := "%{7}_%{6}_%{5}_%{4}_%{3}_%{2}_%{1}_%{0}"
-       if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
+       &result_string := "%{7}_%{6}_%{5}_%{4}_%{3}_%{2}_%{1}_%{0}"
+       if (!(&result_string == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
                test_fail
        }
 
@@ -108,17 +111,25 @@ else {
 
 # compiled - ref - named capture groups (numeric indexes using expansion)
 if (&User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
-       &Tmp-Integer-0 := 0
-       &Tmp-Integer-1 := 1
-       &Tmp-Integer-2 := 2
-       &Tmp-Integer-3 := 3
-       &Tmp-Integer-4 := 4
-       &Tmp-Integer-5 := 5
-       &Tmp-Integer-6 := 6
-       &Tmp-Integer-7 := 7
-
-       &Tmp-String-0 := "%regex(%{Tmp-Integer-7})_%regex(%{Tmp-Integer-6})_%regex(%{Tmp-Integer-5})_%regex(%{Tmp-Integer-4})_%regex(%{Tmp-Integer-3})_%regex(%{Tmp-Integer-2})_%regex(%{Tmp-Integer-1})_%regex(%{Tmp-Integer-0})"
-       if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
+       uint32 a
+       uint32 b
+       uint32 c
+       uint32 d
+       uint32 e
+       uint32 f
+       uint32 g
+       uint32 h
+       &a := 0
+       &b := 1
+       &c := 2
+       &d := 3
+       &e := 4
+       &f := 5
+       &g := 6
+       &h := 7
+
+       &result_string := "%regex(%{h})_%regex(%{g})_%regex(%{f})_%regex(%{e})_%regex(%{d})_%regex(%{c})_%regex(%{b})_%regex(%{a})"
+       if (!(&result_string == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
                test_fail
        }
 }
index 82a5c522fa21104319d9dae418ace3cc33fa72cb..e0fe72e1f1e27b0081ac17b761b42917d5915f0c 100644 (file)
@@ -3,6 +3,8 @@
 #
 #  They can't be modified or deleted.
 #
+uint32 test_integer
+
 &NAS-Port := 1812
 
 #
@@ -42,13 +44,13 @@ if !(&NAS-Port == 1813) {
 #
 #  We can copy the immutable value.  The copy is mutable.
 #
-&Tmp-Integer-0 := &NAS-Port
-if !(&Tmp-Integer-0 == 1813) {
+&test_integer := &NAS-Port
+if !(&test_integer == 1813) {
        test_fail
 }
 
-&Tmp-Integer-0 += 1
-if !(&Tmp-Integer-0 == 1814) {
+&test_integer += 1
+if !(&test_integer == 1814) {
        test_fail
 }
 
index 4cb7a10a102d583264be35b568d3467b42148f60..e42f8513ef2298de18fe302e33905eefc6a6e6a4 100644 (file)
@@ -1,38 +1,33 @@
 #
 #  PRE: if
 #
-
-&request += {
-       # Dotted Quad
-       &Tmp-IP-Address-0 = 127.0.0.1
-
-       # Dotted Quad with prefix
-       &Tmp-IP-Address-1 = 127.0.0.2/32
-
-       # Hex (0x)
-       &Tmp-IP-Address-2 = 0x7f000003
-
-       # Decimal
-       &Tmp-IP-Address-3 = 2130706436
-}
+ipaddr result_ipaddr
 
 if (!(&NAS-IP-Address == 127.0.0.1)) {
        test_fail
 }
 
-if (!(&Tmp-IP-Address-0 == 127.0.0.1)) {
+# Dotted Quad
+&result_ipaddr := 127.0.0.1
+if (!(&result_ipaddr == 127.0.0.1)) {
        test_fail
 }
 
-if (!(&Tmp-IP-Address-1 == 127.0.0.2)) {
+# Dotted Quad with prefix
+&result_ipaddr := 127.0.0.2/32
+if (!(&result_ipaddr == 127.0.0.2)) {
        test_fail
 }
 
-if (!(&Tmp-IP-Address-2 == 127.0.0.3)) {
+# Hex (0x)
+&result_ipaddr := 0x7f000003
+if (!(&result_ipaddr == 127.0.0.3)) {
        test_fail
 }
 
-if (!(&Tmp-IP-Address-3 == 127.0.0.4)) {
+# Decimal
+&result_ipaddr := 2130706436
+if (!(&result_ipaddr == 127.0.0.4)) {
        test_fail
 }
 
index 402ee6e2a031be6226b1c769d2bf30c893e345b9..cac67927607f34b4f4116b4c4d278a4f74f26097 100644 (file)
@@ -1,33 +1,34 @@
 #
 #  PRE: if
 #
-&control += {
-       &Tmp-Cast-IPv4Prefix = 198.51.100.255/16
-       &Tmp-Cast-IPv6Prefix = ::198.51.100.255/112
-       &Framed-IP-Address = 198.51.0.1
-}
+ipv4prefix test_ipv4prefix
+ipv6prefix test_ipv6prefix
+
+&test_ipv4prefix := 198.51.100.255/16
+&test_ipv6prefix := ::198.51.100.255/112
+&Framed-IP-Address := 198.51.0.1
 
-if (!(&control.Tmp-Cast-IPv6Prefix == '::198.51.0.0/112')) {
+if (!(&test_ipv6prefix == '::198.51.0.0/112')) {
        test_fail
 }
 
-if (!(&control.Tmp-Cast-IPv4Prefix == '198.51.0.0/16')) {
+if (!(&test_ipv4prefix == '198.51.0.0/16')) {
        test_fail
 }
 
-if (!(&control.Tmp-Cast-IPv6Prefix == ::198.51.0.0/112)) {
+if (!(&test_ipv6prefix == ::198.51.0.0/112)) {
        test_fail
 }
 
-if (!(&control.Tmp-Cast-IPv4Prefix == 198.51.0.0/16)) {
+if (!(&test_ipv4prefix == 198.51.0.0/16)) {
        test_fail
 }
 
-if (!(&control.Tmp-Cast-IPv4Prefix < 198.0.0.0/8)) {
+if (!(&test_ipv4prefix < 198.0.0.0/8)) {
        test_fail
 }
 
-if (!(&control.Framed-IP-Address < 198.51.0.0/16)) {
+if (!(&Framed-IP-Address < 198.51.0.0/16)) {
        test_fail
 }
 
index 7946e96f03bde47c8b58a05804fa5a4c7ae2f0c4..8a79688459f02c09c870cfcca7cb77626966ea3a 100644 (file)
@@ -1,17 +1,19 @@
 #
 # PRE: if concat
 #
+string result_string
+
 &control -= &Password[*]
 
 &control += {
        &User-Name = &request.User-Name
        &User-Password = &request.User-Password
-       &Tmp-String-0 = "ab c"
-       &Tmp-String-0 = "de fg"
-       &Tmp-Integer-0 = 123
+       &Filter-Id = "ab c"
+       &Filter-Id = "de fg"
+       &NAS-Port = 123
 }
 
-&request.Tmp-IP-Address-0 := 192.168.1.254
+&request.Framed-IP-Address := 192.168.1.254
 
 debug_control
 debug_request
@@ -28,14 +30,14 @@ debug_request
 #
 #  @todo - fix this...
 #
-&control.Tmp-String-1 := %concat(%join(%{control.[*]}, %{request.Tmp-IP-Address-0}), '. ')
+&result_string := %concat(%join(%{control.[*]}, %{request.Framed-IP-Address}), '. ')
 
-if (!(&control.Tmp-String-1 == "bob. hello. ab c. de fg. 123. 192.168.1.254")) {
+if (!(&result_string == "bob. hello. ab c. de fg. 123. 192.168.1.254")) {
        test_fail
 }
 
-&control.Tmp-String-2 := %concat(%join(%{control.Tmp-String-0[*]}, %{control.Tmp-Integer-0}), ',')
-if (!(&control.Tmp-String-2 == "ab c,de fg,123")) {
+&result_string := %concat(%join(%{control.Filter-Id[*]}, %{control.NAS-Port}), ',')
+if (!(&result_string == "ab c,de fg,123")) {
        test_fail
 }
 
index eacec187912281ccd87062ddaa6ed52d7b5e8857..62a346a62c5978af3f4de9ff099430a9699df8eb 100644 (file)
 #
 # PRE: hex
 #
-&request += {
-       &Tmp-String-0   = '\
+string test_string
+octets test_octets
+ipaddr test_ipaddr
+uint32 test_integer
+ifid test_ifid
+ipv6addr test_ipv6addr
+ipv6prefix test_ipv6prefix
+byte test_byte
+uint16 test_short
+ether test_ether
+uint64 test_int64
+ipv4prefix test_ipv4prefix
+uint32 result_int
+
+&test_string := '\
 abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\
 abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\
 abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
-       &Tmp-String-2   = '9870'
-       &Tmp-Octets-0   = 0x39383731
-       &Tmp-IP-Address-0       = 57.56.55.50
-       &Tmp-Integer-0  = 959985460
-       &Tmp-Cast-IfId  = '0000:0000:3938:3737'
-       &Tmp-Cast-IPv6Addr      = '::3938:3738'
-       &Tmp-Cast-IPv6Prefix = '::3938:3739/128'
-       &Tmp-Cast-Byte  = 58
-       &Tmp-Cast-Short = 14139
-       &Tmp-Cast-Ether = 00:00:39:38:37:3c
-       &Tmp-Cast-Integer64  = 1152921505566832445
-       &Tmp-Cast-IPv4Prefix = 57.56.55.62/32
-}
 
-if (!(%length(%{Tmp-String-0}) == 260)) {
+if (!(%length(%{test_string}) == 260)) {
        test_fail
 }
 
-&request += {
-       &Tmp-uint64-0   = %length(%{Tmp-String-2})  # Tmp-Integer-0 is defined and used below for Tmp-Integer-4
-       &Tmp-Integer-1  = %length(%{Tmp-Octets-0})
-       &Tmp-Integer-2  = %length(%{Tmp-IP-Address-0})
-       &Tmp-Integer-3  = %length('hello, world')
-       &Tmp-Integer-4  = %length(%{Tmp-Integer-0})
-       &Tmp-Integer-6  = %length(%{Tmp-Cast-Ifid})
-       &Tmp-Integer-7  = %length(%{Tmp-Cast-IPv6Addr})
-       &Tmp-Integer-8  = %length(%{Tmp-Cast-IPv6Prefix})
-       &Tmp-Integer-9  = %length(%{Tmp-Cast-Byte})
-}
+&test_string := '9870'
+&test_octets := 0x39383731
+&test_ipaddr := 57.56.55.50
+&test_integer := 959985460
+&test_ifid := '0000:0000:3938:3737'
+&test_ipv6addr := '::3938:3738'
+&test_ipv6prefix = '::3938:3739/128'
+&test_byte := 58
+&test_short := 14139
+&test_ether := 00:00:39:38:37:3c
+&test_int64 := 1152921505566832445
+&test_ipv4prefix := 57.56.55.62/32
 
 # String - bin 0x39383730
-if (!(&Tmp-uint64-0 == 4)) {
+&result_int := %length(%{test_string})
+if (!(&result_int == 4)) {
        test_fail
 }
 
 # Octets - bin 0x39383731
-if (!(&Tmp-Integer-1 == 4)) {
+&result_int := %length(%{test_octets})
+if (!(&result_int == 4)) {
        test_fail
 }
 
 # IP Address - bin 0x39383732
-if (!(&Tmp-Integer-2 == 4)) {
+&result_int := %length(%{test_ipaddr})
+if (!(&result_int == 4)) {
        test_fail
 }
 
 # String - "hello, world"
-if (!(&Tmp-Integer-3 == 12)) {
+&result_int := %length('hello, world')
+if (!(&result_int == 12)) {
        test_fail
 }
 
 # Integer - bin 0x39383734
-if (!(&Tmp-Integer-4 == 4)) {
+&result_int := %length(%{test_integer})
+if (!(&result_int == 4)) {
        test_fail
 }
 
 # ifid - bin 0x0000000039383737
-if (!(&Tmp-Integer-6 == 8)) {
+&result_int := %length(%{test_ifid})
+if (!(&result_int == 8)) {
        test_fail
 }
 
 # ipv6addr - bin 0x00000000000000000000000039383738
-if (!(&Tmp-Integer-7 == 16)) {
+&result_int := %length(%{test_ipv6addr})
+if (!(&result_int == 16)) {
        test_fail
 }
 
 # ipv6addrprefix - bin 0x8000000000000000000000000039383739
-if (!(&Tmp-Integer-8 == 17)) {
+&result_int := %length(%{test_ipv6prefix})
+if (!(&result_int == 17)) {
        test_fail
 }
 
 # byte - bin 0x3a
-if (!(&Tmp-Integer-9 == 1)) {
+&result_int := %length(%{test_byte})
+if (!(&result_int == 1)) {
        test_fail
 }
 
-&Tmp-Integer-0 := %length(%{Tmp-Cast-Short})
-&Tmp-Integer-1 := %length(%{Tmp-Cast-Ether})
-&Tmp-Integer-2 := %length(%{Tmp-Cast-Integer64})
-&Tmp-Integer-3 := %length(%{Tmp-Cast-IPv4Prefix})
-
 # short - bin 0x373b
-if (!(&Tmp-Integer-0 == 2)) {
+&result_int := %length(%{test_short})
+if (!(&result_int == 2)) {
        test_fail
 }
 
 # ethernet - bin 0x00003938373c
-if (!(&Tmp-Integer-1 == 6)) {
+&result_int := %length(%{test_ether})
+if (!(&result_int == 6)) {
        test_fail
 }
 
 # integer64 - bin 0x100000003938373d
-if (!(&Tmp-Integer-2 == 8)) {
+&result_int := %length(%{test_int64})
+if (!(&result_int == 8)) {
        test_fail
 }
 
 # ipv4prefix - bin 0x203938373e
-if (!(&Tmp-Integer-3 == 5)) {
+&result_int := %length(%{test_ipv4prefix})
+if (!(&result_int == 5)) {
        test_fail
 }
 
index 8925bfd24490523ad467b1c5375141259f25b2a5..021ef1a11340888d4aaf7fd5cf361c81213a1301 100644 (file)
@@ -5,78 +5,81 @@
 #
 #  Should distribute load between the modules.
 #
-&request += {
-       &Tmp-Integer-0 = 0
-       &Tmp-Integer-1 = 0
+uint32 count1
+uint32 count2
+
+&count1 := 0
+&count2 := 0
 
-       &Tmp-Integer-2 = 0              # 0
-       &Tmp-Integer-2 = 1
-       &Tmp-Integer-2 = 2
-       &Tmp-Integer-2 = 3
-       &Tmp-Integer-2 = 4
-       &Tmp-Integer-2 = 5
-       &Tmp-Integer-2 = 6
-       &Tmp-Integer-2 = 7
-       &Tmp-Integer-2 = 8
-       &Tmp-Integer-2 = 9              # 10
-       &Tmp-Integer-2 = 0
-       &Tmp-Integer-2 = 1
-       &Tmp-Integer-2 = 2
-       &Tmp-Integer-2 = 3
-       &Tmp-Integer-2 = 4
-       &Tmp-Integer-2 = 5
-       &Tmp-Integer-2 = 6
-       &Tmp-Integer-2 = 7
-       &Tmp-Integer-2 = 8
-       &Tmp-Integer-2 = 9              # 20
-       &Tmp-Integer-2 = 0
-       &Tmp-Integer-2 = 1
-       &Tmp-Integer-2 = 2
-       &Tmp-Integer-2 = 3
-       &Tmp-Integer-2 = 4
-       &Tmp-Integer-2 = 5
-       &Tmp-Integer-2 = 6
-       &Tmp-Integer-2 = 7
-       &Tmp-Integer-2 = 8
-       &Tmp-Integer-2 = 9              # 30
-       &Tmp-Integer-2 = 0
-       &Tmp-Integer-2 = 1
-       &Tmp-Integer-2 = 2
-       &Tmp-Integer-2 = 3
-       &Tmp-Integer-2 = 4
-       &Tmp-Integer-2 = 5
-       &Tmp-Integer-2 = 6
-       &Tmp-Integer-2 = 7
-       &Tmp-Integer-2 = 8
-       &Tmp-Integer-2 = 9              # 40
-       &Tmp-Integer-2 = 0
-       &Tmp-Integer-2 = 1
-       &Tmp-Integer-2 = 2
-       &Tmp-Integer-2 = 3
-       &Tmp-Integer-2 = 4
-       &Tmp-Integer-2 = 5
-       &Tmp-Integer-2 = 6
-       &Tmp-Integer-2 = 7
-       &Tmp-Integer-2 = 8
-       &Tmp-Integer-2 = 9              # 49
+&request += {
+       &NAS-Port = 0           # 0
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 3
+       &NAS-Port = 4
+       &NAS-Port = 5
+       &NAS-Port = 6
+       &NAS-Port = 7
+       &NAS-Port = 8
+       &NAS-Port = 9           # 10
+       &NAS-Port = 0
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 3
+       &NAS-Port = 4
+       &NAS-Port = 5
+       &NAS-Port = 6
+       &NAS-Port = 7
+       &NAS-Port = 8
+       &NAS-Port = 9           # 20
+       &NAS-Port = 0
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 3
+       &NAS-Port = 4
+       &NAS-Port = 5
+       &NAS-Port = 6
+       &NAS-Port = 7
+       &NAS-Port = 8
+       &NAS-Port = 9           # 30
+       &NAS-Port = 0
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 3
+       &NAS-Port = 4
+       &NAS-Port = 5
+       &NAS-Port = 6
+       &NAS-Port = 7
+       &NAS-Port = 8
+       &NAS-Port = 9           # 40
+       &NAS-Port = 0
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 3
+       &NAS-Port = 4
+       &NAS-Port = 5
+       &NAS-Port = 6
+       &NAS-Port = 7
+       &NAS-Port = 8
+       &NAS-Port = 9           # 49
 }
 
 #
 #  Loop 0..9
 #
-foreach &Tmp-Integer-2 {
+foreach &NAS-Port {
        load-balance {
                group {
-                       &Tmp-Integer-0 += 1
+                       &count1 += 1
                        &request += {
-                               &Tmp-String-0 = "Picked group 1 - %{Tmp-Integer-0} time(s)"
+                               &Reply-Message = "Picked group 1 - %{count1} time(s)"
                        }
                        ok
                }
                group {
-                       &Tmp-Integer-1 += 1
+                       &count2 += 1
                        &request += {
-                               &Tmp-String-1 = "Picked group 2 %{Tmp-Integer-1} Time(s)"
+                               &Reply-Message = "Picked group 2 %{count2} Time(s)"
                        }
                        ok
                }
@@ -86,11 +89,11 @@ foreach &Tmp-Integer-2 {
 # The chances of one group being used over another 50 times by random occurrence
 # is quite small, and if this happens repeatedly, it's likely there's a bug in
 # the load-balance code or random number generator.
-if ((&Tmp-Integer-0 == 0) || (&Tmp-Integer-1 == 0)) {
+if ((&count1 == 0) || (&count2 == 0)) {
        test_fail
 }
 
-if !(&Tmp-Integer-0 + &Tmp-Integer-1 == 50) {
+if !(&count1 + &count2 == 50) {
        test_fail
 }
 
index 52ff61c0bdd7c8e02895b74c60a2971236b02ecb..28575b3492855e259cbadb2725294dd1599abae9 100644 (file)
@@ -1,37 +1,38 @@
 #
 #  PRE: edit
 #
-&request += {
-       &Tmp-Integer-0 = 0
-       &Tmp-Integer-1 = 1
-}
+uint32 test_integer1
+uint32 test_integer2
+
+&test_integer1 := 0
+&test_integer2 := 1
 
 #
 #  (true && true) --> true
 #
 #  But if it's false, then we have an issue.
 #
-if !((&Tmp-Integer-0 == 0) && (&Tmp-Integer-1 == 1)) {
+if !((&test_integer1 == 0) && (&test_integer2 == 1)) {
        test_fail
 }
 
 #
 #  false && true --> false
 #
-if ((&Tmp-Integer-0 == 1) && (&Tmp-Integer-1 == 1)) {
+if ((&test_integer1 == 1) && (&test_integer2 == 1)) {
        test_fail
 }
 
 #
 #  true && false -> false
 #
-if ((&Tmp-Integer-0 == 0) && (&Tmp-Integer-1 == 0)) {
+if ((&test_integer1 == 0) && (&test_integer2 == 0)) {
        test_fail
 }
 
-&control.Tmp-String-0 := { "bob", "oof" }
+&control.Filter-Id := { "bob", "oof" }
 
-if ((&control.Tmp-String-0[0] == 'bob') && (&control.Tmp-String-0[1] == 'oof')) {
+if ((&control.Filter-Id[0] == 'bob') && (&control.Filter-Id[1] == 'oof')) {
        # OK
 } else {
        test_fail
index 653b664716074f30ab41c840a67ef4fd6a76dbf1..bd804879ed0376e270e7c9f8fb5179faa43a6843 100644 (file)
@@ -1,25 +1,26 @@
 #
 #  PRE: edit
 #
-&request += {
-       &Tmp-Integer-0 = 0
-       &Tmp-Integer-1 = 1
-}
+uint32 test_integer1
+uint32 test_integer2
+
+&test_integer1 := 0
+&test_integer2 := 1
 
-if !((&Tmp-Integer-0 == 1) || (&Tmp-Integer-1 == 1)) {
+if !((&test_integer1 == 1) || (&test_integer2 == 1)) {
        test_fail
 }
 
-if !((&Tmp-Integer-1 == 1) || (&Tmp-Integer-0 == 1)) {
+if !((&test_integer2 == 1) || (&test_integer1 == 1)) {
        test_fail
 }
 
 #
 #  Neither of these exists, so the resulting string should be empty
 #
-&Tmp-String-0 := "%{&Tmp-String-1 || &Tmp-String-1}"
+&Filter-Id := "%{&NAS-Port-Id || &NAS-Port-Id}"
 
-if !(&Tmp-String-0 == '') {
+if !(&Filter-Id == '') {
        test_fail
 }
 
index 1a28c782ee620df27d8dc0231f444f36b9ffb4ff..170ac8b24f8461d72a7154149850daac10c1509e 100644 (file)
@@ -2,21 +2,21 @@
 #  PRE: map
 #
 
-&control.Tmp-String-0 := "fail"
+&control.Filter-Id := "fail"
 
 map csv &User-Name {
-       &control.Tmp-String-0 ^= 'field3'
+       &control.Filter-Id ^= 'field3'
 }
 
-if (!(&control.Tmp-String-0[0] == 'success')) {
+if (!(&control.Filter-Id[0] == 'success')) {
        test_fail
 }
 
-if (!(&control.Tmp-String-0[1] == "fail")) {
+if (!(&control.Filter-Id[1] == "fail")) {
        test_fail
 }
 
-if (!(%{control.Tmp-String-0[#]} == 2)) {
+if (!(%{control.Filter-Id[#]} == 2)) {
        test_fail
 }
 
index 8f96a7bd936e3296d5d06b6d6fbfe375bb8728dd..55a7f3cd7561277603b3fe4a5ef242f539a081a4 100644 (file)
@@ -4,20 +4,20 @@
 #  Test the map xlat
 #
 &request += {
-       &Tmp-String-0 = '&control.Tmp-String-0 := \'testing123\''
-       &Tmp-String-1 = "request.Vendor-Specific.Nokia-SR.MSAP-Interface = 'UNICAST_7360OLT3'"
-       &Tmp-String-1 = "request.Vendor-Specific.Nokia-SR.MSAP-Interface += 'UNICAST_7360OLT4'"
+       &Filter-Id = '&control.Filter-Id := \'testing123\''
+       &NAS-Port-Id = "request.Vendor-Specific.Nokia-SR.MSAP-Interface = 'UNICAST_7360OLT3'"
+       &NAS-Port-Id = "request.Vendor-Specific.Nokia-SR.MSAP-Interface += 'UNICAST_7360OLT4'"
 }
 
-if (!("%map(%{Tmp-String-0})" == 1)) {
+if (!("%map(%{Filter-Id})" == 1)) {
        test_fail
 }
 
-if (!(&control.Tmp-String-0 == 'testing123')) {
+if (!(&control.Filter-Id == 'testing123')) {
        test_fail
 }
 
-foreach &Tmp-String-1[*] {
+foreach &NAS-Port-Id[*] {
        if (!("%map(%{Foreach-Variable-0})" == 1)) {
                test_fail
        }
index 1dd72bf7a92f8096c5985b5f63e65f773294d4c3..7f0c71f7baaca577160178832bf8060cef4b499f 100644 (file)
@@ -3,9 +3,9 @@
 #
 #  Test the map xlat
 #
-&Tmp-String-0 := "request.Tmp-Group-0.Tmp-String-1 = 'testing123'"
+&Filter-Id := "request.Tmp-Group-0.User-Name = 'testing123'"
 
-if (!("%map(%{Tmp-String-0})" == 1)) {
+if (!("%map(%{Filter-Id})" == 1)) {
        test_fail
 }
 
index e32c597ce025cc0d169e0e45dc0ee33f77c68ff9..f2b00e7df8e15e487ff67fc6b46fb5279b10cf26 100644 (file)
@@ -3,25 +3,25 @@
 #
 #  Test the map xlat
 #
-&Tmp-String-0 := "request.Tmp-Group-0.Tmp-String-0 := 'testing123'"
+&Filter-Id := "request.Tmp-Group-0.Filter-Id := 'testing123'"
 
-if (!(%map("%{Tmp-String-0}") == 1)) {
+if (!(%map("%{Filter-Id}") == 1)) {
        test_fail
 }
 
-if (!(%map("%{Tmp-String-0}") == 1)) {
+if (!(%map("%{Filter-Id}") == 1)) {
        test_fail
 }
 
-if (!(%map("request.Tmp-Group-0.Tmp-String-1 := 'testing000'") == 1)) {
+if (!(%map("request.Tmp-Group-0.User-Name := 'testing000'") == 1)) {
        test_fail
 }
 
-if (!&Tmp-Group-0[0].Tmp-String-0 || (!(&Tmp-Group-0[0].Tmp-String-0 == 'testing123'))) {
+if (!&Tmp-Group-0[0].Filter-Id || (!(&Tmp-Group-0[0].Filter-Id == 'testing123'))) {
        test_fail
 }
 
-if (!&Tmp-Group-0[0].Tmp-String-1 || (!(&Tmp-Group-0[0].Tmp-String-1 == 'testing000'))) {
+if (!&Tmp-Group-0[0].User-Name || (!(&Tmp-Group-0[0].User-Name == 'testing000'))) {
        test_fail
 }
 
index d798227598827b7a70989a835510ac77174da86c..8f0b298532ce83d1751c9b87b0a92c2991472fed 100644 (file)
@@ -4,9 +4,11 @@
 #
 #  Test the map xlat
 #
-&Tmp-String-0 := "IA-PD.IAID = 11"
+string test_string
 
-if (!("%map(%{Tmp-String-0})" == 1)) {
+&test_string := "IA-PD.IAID = 11"
+
+if (!("%map(%{test_string})" == 1)) {
        test_fail
 }
 
index ddc03f84078df51ac69e57d331f345e9f7b938dd..a095fb6de73c81d31f03ccf52465477cc838968c 100644 (file)
@@ -1,50 +1,41 @@
 #
 # PRE: if
 #
-&request += {
-       &Tmp-String-0 = "This is a string\n"
-       &Tmp-Octets-0 = 0x000504030201
-       &Tmp-String-1 = "what do ya want for nothing?"
-       &Tmp-String-2 = "Jefe"
-       &Tmp-String-3 = ""
-}
-
+string test_string
+string dummy_string
+octets test_octets
+octets result_octets
 
-&request += {
-       &Tmp-Octets-1 = %md4("This is a string\n")
-       &Tmp-Octets-2 = %md4("%{Tmp-String-0}")
-       &Tmp-Octets-3 = %md4("%{request.Tmp-String-0}")
-       &Tmp-Octets-4 = %md4("%{request.Tmp-Octets-0}")
-       &Tmp-Octets-5 = %md4("%{Tmp-String-9}")
-}
+&test_string := "This is a string\n"
+&test_octets := 0x000504030201
 
 #
 #  Put "This is a string" into a file and call "md4sum" on it.
 #  You should get this string.
 #
-if (!(&Tmp-Octets-1 == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
-       test_fail
-}
-
-if (!(&Tmp-Octets-2 == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
+&result_octets := %md4("This is a string\n")
+if (!(&result_octets == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
        test_fail
 }
 
-if (!(&Tmp-Octets-3 == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
+&result_octets := %md4("%{test_string}")
+if (!(&result_octets == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
        test_fail
 }
 
 #
-#  MD5 should also be able to cope with references to octet attributes
+#  MD4 should also be able to cope with references to octet attributes
 #
-if (!(&Tmp-Octets-4 == 0xac3ed17b3cf19ec38352ec534a932fc6)) {
+&result_octets := %md4("%{test_octets}")
+if (!(&result_octets == 0xac3ed17b3cf19ec38352ec534a932fc6)) {
        test_fail
 }
 
 #
-#  MD5 of null string is d41d8cd98f00b204e9800998ecf8427e
+#  MD4 of null string is d41d8cd98f00b204e9800998ecf8427e
 #
-if (!(&Tmp-Octets-5 == 0x31d6cfe0d16ae931b73c59d7e0c089c0)) {
+&result_octets := %md4("%{dummy_string}")
+if (!(&result_octets == 0x31d6cfe0d16ae931b73c59d7e0c089c0)) {
        test_fail
 }
 
index 58ee07ca711063f62f521c14ad71a903595fbdf6..591edba21872eda4446f298394c5daddc43af120 100644 (file)
@@ -1,66 +1,62 @@
 #
 # PRE: if
 #
-&request += {
-       &Tmp-String-0 = "This is a string\n"
-       &Tmp-Octets-0 = 0x000504030201
-       &Tmp-String-1 = "what do ya want for nothing?"
-       &Tmp-String-2 = "Jefe"
-       &Tmp-String-3 = ""
-}
-
+string test_string
+string dummy_string
+string test_hmac_key
+string test_hmac_data
+octets test_octets
+octets result_octets
 
-&request += {
-       &Tmp-Octets-1 = %md5("This is a string\n")
-       &Tmp-Octets-2 = %md5("%{Tmp-String-0}")
-       &Tmp-Octets-3 = %md5("%{request.Tmp-String-0}")
-       &Tmp-Octets-4 = %md5("%{request.Tmp-Octets-0}")
-       &Tmp-Octets-5 = %md5("%{Tmp-String-9}")
-       &Tmp-Octets-6 = %hmacmd5("%{Tmp-String-1}", "%{Tmp-String-2}")
-       &Tmp-Octets-7 = %hmacmd5("%{Tmp-String-3}", "%{Tmp-String-3}")
-}
+&test_string := "This is a string\n"
+&test_octets := 0x000504030201
+&test_hmac_key := "what do ya want for nothing?"
+&test_hmac_data := "Jefe"
 
 #
 #  Put "This is a string" into a file and call "md5sum" on it.
 #  You should get this string.
 #
-if (!(&Tmp-Octets-1 == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
-       test_fail
-}
-
-if (!(&Tmp-Octets-2 == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
+&result_octets := %md5("This is a string\n")
+if (!(&result_octets == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
        test_fail
 }
 
-if (!(&Tmp-Octets-3 == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
+&result_octets := %md5("%{test_string}")
+if (!(&result_octets == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
        test_fail
 }
 
 #
 #  MD5 should also be able to cope with references to octet attributes
 #
-if (!(&Tmp-Octets-4 == 0xc1e7fa505b2fc1fd0da6cac3db6f6f44)) {
+&result_octets := %md5("%{test_octets}")
+if (!(&result_octets == 0xc1e7fa505b2fc1fd0da6cac3db6f6f44)) {
        test_fail
 }
 
 #
 #  MD5 of null string is d41d8cd98f00b204e9800998ecf8427e
 #
-if (!(&Tmp-Octets-5 == 0xd41d8cd98f00b204e9800998ecf8427e)) {
+&result_octets := %md5("%{dummy_string}")
+if (!(&result_octets == 0xd41d8cd98f00b204e9800998ecf8427e)) {
        test_fail
 }
 
 #
 #  MD5 HMAC with attribute references
 #
-if (!(&Tmp-Octets-6 == 0x750c783e6ab0b503eaa86e310a5db738)) {
+&result_octets := %hmacmd5("%{test_hmac_key}", "%{test_hmac_data}")
+if (!(&result_octets == 0x750c783e6ab0b503eaa86e310a5db738)) {
        test_fail
 }
 
 #
 #  MD5 HMAC with empty key and data
 #
-if (!(&Tmp-Octets-7 == 0x74e6f7298a9c2d168935f58c001bad88)) {
+&dummy_string := ''
+&result_octets := %hmacmd5("%{dummy_string}", "%{dummy_string}")
+if (!(&result_octets == 0x74e6f7298a9c2d168935f58c001bad88)) {
        test_fail
 }
 
index 309f4a7f575c0612094b161faf5bc05b9fa6f0f0..68f166c3434c45b492d70406e2a76932db3fd639 100644 (file)
@@ -1,14 +1,16 @@
 #
 # PRE: md5
 #
+string test_string
+octets result_octets
 
-&Tmp-String-1 := "hello"
+&test_string := "hello"
 
 #
 #  MD5 HMAC with missing key should fail
 #
-&Tmp-Octets-1 := %hmacmd5(%{Tmp-String-1}, )
-if &Tmp-Octets-1 {
+&result_octets := %hmacmd5(%{test_string}, )
+if &result_octets {
        test_fail
 }
 success
index 2ad8e84146b92a80950b9b243e6714837e9abe93..2080105bf38ab26e4f3dc955ea09754116c486e7 100644 (file)
@@ -1,6 +1,8 @@
 #
 #  PRE: if
 #
+string result_string
+octets result_octets
 
 #
 #  over-write the existing User-Name
        &Vendor-Specific.Microsoft.CHAP-Response = 0x00010000000000000000000000000000000000000000000000008860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f
 }
 
-&request += {
-       &Tmp-Octets-0 = %mschap(Challenge)
-       &Tmp-Octets-1 = %mschap(NT-Response)
-       &Tmp-String-0 = %mschap(NT-Domain)
-       &Tmp-String-1 = %mschap(User-Name)
-}
-
-if !(&Tmp-Octets-0 == 0xe96e4fff2955c4f1) {
+&result_octets := %mschap(Challenge)
+if !(&result_octets == 0xe96e4fff2955c4f1) {
        test_fail
 }
 
-if !(&Tmp-Octets-1 == 0x8860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f) {
+&result_octets := %mschap(NT-Response)
+if !(&result_octets == 0x8860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f) {
        test_fail
 }
 
-if !(&Tmp-String-0 == 'EXAMPLE') {
+&result_string := %mschap(NT-Domain)
+if !(&result_string == 'EXAMPLE') {
        test_fail
 }
 
-if !(&Tmp-String-1 == 'bob') {
+&result_string := %mschap(User-Name)
+if !(&result_string == 'bob') {
        test_fail
 }
 
 &request.Vendor-Specific.Microsoft.CHAP-Response := 0x00006937d7935bb28a4c1dafe6a193bdea7a853a74d8bcf6db158860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f
 
-&Tmp-Octets-0 := %mschap(LM-Response)
+&result_octets := %mschap(LM-Response)
 
-if !(&Tmp-Octets-0 == 0x6937d7935bb28a4c1dafe6a193bdea7a853a74d8bcf6db15) {
+if !(&result_octets == 0x6937d7935bb28a4c1dafe6a193bdea7a853a74d8bcf6db15) {
        test_fail
 }
 
 # Hashing
-&Tmp-Octets-0 := %mschap(NT-Hash, 'testing_123')
-&Tmp-Octets-1 := %mschap(LM-Hash, 'testing_123')
-
-if !(&Tmp-Octets-0 == 0xfa782604f85eb3564f555648341b53e4) {
+&result_octets := %mschap(NT-Hash, 'testing_123')
+if !(&result_octets == 0xfa782604f85eb3564f555648341b53e4) {
        test_fail
 }
 
-if !(&Tmp-Octets-1 == 0x2d5545077d7b7d2ae4343f96ab15c596) {
+&result_octets := %mschap(LM-Hash, 'testing_123')
+if !(&result_octets == 0x2d5545077d7b7d2ae4343f96ab15c596) {
        test_fail
 }
 
@@ -62,22 +60,21 @@ if !(&Tmp-Octets-1 == 0x2d5545077d7b7d2ae4343f96ab15c596) {
 &Vendor-Specific.Microsoft.CHAP-Challenge := 0x04408dc2a98dae1ce351dfc53f57d08e
 &Vendor-Specific.Microsoft.CHAP2-Response := 0x00010e93cfbfcef8d5b6af42d2b2ca5b43180000000000000000bc068d1e8c54de5e9db78e6736d686eb88a999dd7fa239b200
 
-&Tmp-Octets-0 := %mschap(Challenge)
-&Tmp-Octets-1 := %mschap(NT-Response)
-
-if !(&Tmp-Octets-0 == 0xad18b6b8e1478b4c) {
+&result_octets := %mschap(Challenge)
+if !(&result_octets == 0xad18b6b8e1478b4c) {
        test_fail
 }
 
-if !(&Tmp-Octets-1 == 0xbc068d1e8c54de5e9db78e6736d686eb88a999dd7fa239b2) {
+&result_octets := %mschap(NT-Response)
+if !(&result_octets == 0xbc068d1e8c54de5e9db78e6736d686eb88a999dd7fa239b2) {
        test_fail
 }
 
 # Invalid
 &Vendor-Specific.Microsoft.CHAP-Challenge := 0xf0eac4151d5346662ba8c5e428
-&Tmp-String-0 := %mschap(Challenge)
+&result_string := %mschap(Challenge)
 
-if (&Tmp-String-0) {
+if (&result_string) {
        test_fail
 }
 
@@ -85,4 +82,4 @@ if (!(&Module-Failure-Message == "Invalid MS-CHAP challenge length")) {
        test_fail
 }
 
-success
\ No newline at end of file
+success
index f05a062f5fb66aa909e3c8ae60b85a3a32b036a6..69c567b6613dc8496410393dc44fbdd80a552ef0 100644 (file)
@@ -1,32 +1,33 @@
 #
 #  PRE: expr
 #
+uint32 result_integer
 
 #
 #  Calculations based on month and year are not consistent due to
 #  different numbers of days involved.  Check hour / day / week
 #
 
-&Tmp-Integer-0 := "%{%nexttime(2h) - %nexttime(1h)}"
+&result_integer := "%{%nexttime(2h) - %nexttime(1h)}"
 
 # We have a fudge factor of 1 second either way
-if ((&Tmp-Integer-0 < 3599) || (&Tmp-Integer-0 > 3601)) {
+if ((&result_integer < 3599) || (&result_integer > 3601)) {
        test_fail
 }
 
 #
 #  Day
 #
-&Tmp-Integer-0 := "%{%nexttime(3d) - %nexttime(1d)}"
-if ((&Tmp-Integer-0 < 172799) || (&Tmp-Integer-0 > 172801)) {
+&result_integer := "%{%nexttime(3d) - %nexttime(1d)}"
+if ((&result_integer < 172799) || (&result_integer > 172801)) {
        test_fail
 }
 
 #
 #  Week
 #
-&Tmp-Integer-0 := "%{%nexttime(4w) - %nexttime(2w)}"
-if ((&Tmp-Integer-0 < 1209599) || (&Tmp-Integer-0 > 1209601)) {
+&result_integer := "%{%nexttime(4w) - %nexttime(2w)}"
+if ((&result_integer < 1209599) || (&result_integer > 1209601)) {
        test_fail
 }
 
index 169e90082c318a5f3b721e2064365d5e8e52a564..1247b53e9207e95943638f931b01c016797a732a 100644 (file)
@@ -1,11 +1,12 @@
 #
 #  PRE: if
 #
+string dummy_string
 
 #
 #  This doesn't exist, so  the condition shouldn't match.
 #
-if (&Tmp-String-0 == "foo") {
+if (&dummy_string == "foo") {
        test_fail
 }
 else {
@@ -15,7 +16,7 @@ else {
 #
 # Since the middle part doesn't match, "NOT" the middle part SHOULD match.
 #
-if (!(&Tmp-String-0 == "foo")) {
+if (!(&dummy_string == "foo")) {
        ok
 }
 else {
index 72bcdfa662ca66afaf1474b240a5de6c7099f558..935be8a12242b143a1c681e5fbce717fd1e8833e 100644 (file)
@@ -1,6 +1,8 @@
 #
 #  PRE: if
 #
+octets result_octets
+
 &request += {
        &Framed-IP-Address = 127.0.0.1
        &NAS-Port = 2112
 }
 
 
-&Tmp-Octets-0 := (octets) &Framed-IP-Address + (octets) &NAS-Port + (octets) &NAS-IP-Address
+&result_octets := (octets) &Framed-IP-Address + (octets) &NAS-Port + (octets) &NAS-IP-Address
 
-if (!(&Tmp-Octets-0 == 0x7f000001000008407f000002)) {
+if (!(&result_octets == 0x7f000001000008407f000002)) {
        test_fail
 }
 
 #
 #  With octet addition, we don't need %pack() any more!
 #
-&Tmp-Octets-0 := (octets) &Framed-IP-Address + (octets) &NAS-Port + (octets) &NAS-IP-Address
+&result_octets := (octets) &Framed-IP-Address + (octets) &NAS-Port + (octets) &NAS-IP-Address
 
-if (!(&Tmp-Octets-0 == 0x7f000001000008407f000002)) {
+if (!(&result_octets == 0x7f000001000008407f000002)) {
        test_fail
 }
 
index 529a94039688daf177ccc308a2a0bf58018ad568..38fa63754b78954aa77378df2e8f96147cf0515c 100644 (file)
@@ -1,44 +1,45 @@
 #
 #  PRE: if return
 #
+string test_string
 
-&Tmp-String-0 = "test"
+&test_string = "test"
 
 #
 #      rpad tests
 #
-if (!(%rpad(%{Tmp-String-0}, 7) == "test   ")) {
+if (!(%rpad(%{test_string}, 7) == "test   ")) {
        test_fail
 }
 
-if (!(%rpad(%{Tmp-String-0}, 2) == "test")) {
+if (!(%rpad(%{test_string}, 2) == "test")) {
        test_fail
 }
 
-if (!(%rpad(%{Tmp-String-0}, 7, 'x') == "testxxx")) {
+if (!(%rpad(%{test_string}, 7, 'x') == "testxxx")) {
        test_fail
 }
 
-if (!(%rpad(%{Tmp-String-0}, 7, 'xy') == "testxyx")) {
+if (!(%rpad(%{test_string}, 7, 'xy') == "testxyx")) {
        test_fail
 }
 
 #
 #      lpad tests
 #
-if (!(%lpad(%{Tmp-String-0}, 7) == "   test")) {
+if (!(%lpad(%{test_string}, 7) == "   test")) {
        test_fail
 }
 
-if (!(%lpad(%{Tmp-String-0}, 2) == "test")) {
+if (!(%lpad(%{test_string}, 2) == "test")) {
        test_fail
 }
 
-if (!(%lpad(%{Tmp-String-0}, 7, 'x') == "xxxtest")) {
+if (!(%lpad(%{test_string}, 7, 'x') == "xxxtest")) {
        test_fail
 }
 
-if (!(%lpad(%{Tmp-String-0}, 7, 'xy') == "xyxtest")) {
+if (!(%lpad(%{test_string}, 7, 'xy') == "xyxtest")) {
        test_fail
 }
 
index bba8f332fcec4a608bc0e627a69f91f6dd870992..ea06846410a257ca38a5edc32dc1f12313c89d8f 100644 (file)
@@ -1,14 +1,15 @@
 #
 # PRE: update if
 #
+string result_string
 
 &request -= &Packet-Type[*]
 
 &Tmp-Group-0 += {
-       &Tmp-String-0 = "This is a string"
-       &Tmp-String-0 = "This is another one"
-       &Tmp-Octets-0 = 0x000504030201
-       &Tmp-Integer-0 = 7331
+       &Filter-Id = "This is a string"
+       &Filter-Id = "This is another one"
+       &Class = 0x000504030201
+       &NAS-Port = 7331
 }
 
 #
 #
 #&pairs := %cast('string', %{Tmp-Group-0.[*]})
 
-&request += {
-       &Tmp-String-1 = "%concat(%pairs(Tmp-Group-0.[*]), ', ')"
-       &Tmp-String-2 = "%pairs(Tmp-Group-0.Tmp-String-0)"
-       &Tmp-String-3 = "%concat(%pairs(Tmp-Group-0.Tmp-String-0[*]), ', ')"
-       &Tmp-String-4 = "%concat(%pairs(control.[*]), ', ')"
-       &Tmp-String-5 = "%pairs(control.User-Name)"
-       &Tmp-String-6 = "%pairs(request.Tmp-Group-0)"
-}
-
-if !(&Tmp-String-1 == 'Tmp-String-0 = "This is a string", Tmp-String-0 = "This is another one", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331') {
+&result_string := "%concat(%pairs(Tmp-Group-0.[*]), ', ')"
+if !(&result_string == 'Filter-Id = "This is a string", Filter-Id = "This is another one", Class = 0x000504030201, NAS-Port = 7331') {
        test_fail
 }
 
-if !(&Tmp-String-2 == 'Tmp-String-0 = "This is a string"') {
+&result_string := "%pairs(Tmp-Group-0.Filter-Id)"
+if !(&result_string == 'Filter-Id = "This is a string"') {
        test_fail
 }
 
-if !(&Tmp-String-3 == 'Tmp-String-0 = "This is a string", Tmp-String-0 = "This is another one"') {
+&result_string := "%concat(%pairs(Tmp-Group-0.Filter-Id[*]), ', ')"
+if !(&result_string == 'Filter-Id = "This is a string", Filter-Id = "This is another one"') {
        test_fail
 }
 
 #
 #  Must be nested
 #
-if !(&Tmp-String-4 == 'Password = { Cleartext = "hello" }') {
+&result_string := "%concat(%pairs(control.[*]), ', ')"
+if !(&result_string == 'Password = { Cleartext = "hello" }') {
        test_fail
 }
 
-if (!(&Tmp-String-5 == '')) {
+&result_string := "%pairs(control.User-Name)"
+if (!(&result_string == '')) {
        test_fail
 }
 
-if !(&Tmp-String-6 == 'Tmp-Group-0 = { Tmp-String-0 = "This is a string", Tmp-String-0 = "This is another one", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331 }') {
+&result_string := "%pairs(request.Tmp-Group-0)"
+if !(&result_string == 'Tmp-Group-0 = { Filter-Id = "This is a string", Filter-Id = "This is another one", Class = 0x000504030201, NAS-Port = 7331 }') {
        test_fail
 }
 
 &request -= &Tmp-Group-0[*]
-if (&request.Tmp-Group-0.Tmp-String-0) {
+if (&request.Tmp-Group-0.Filter-Id) {
        test_fail
 }
 
 #
 #  Parse pairs from a string!
 #
-&request += "%{Tmp-String-6}"
-if !(&request.Tmp-Group-0.Tmp-String-0 == 'This is a string') {
+&request += "%{result_string}"
+if !(&request.Tmp-Group-0.Filter-Id == 'This is a string') {
        test_fail
 }
 
index 9e802bb1a9405cc94467dae3aa81129bfb8e0284..f535839930c2ea37e6c6906289e88b230b582e6c 100644 (file)
@@ -1,8 +1,12 @@
 #
 # PRE: edit-list-remove if
 #
+string salt
+string result_string
+octets result_octets
+
 &control := {}
-&Tmp-String-0 := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK"        # 60 byte salt
+&salt := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK"        # 60 byte salt
 
 #
 #  Unencoded Password.Cleartext in password with header
@@ -22,9 +26,9 @@ if (reject) {
 #
 #  Base64 encoded Password.Cleartext in password with header
 #
-&Tmp-String-1 := "{clear}%{User-Password}"
+&result_string := "{clear}%{User-Password}"
 &control := {
-       &Password.With-Header = %base64.encode(%{Tmp-String-1})
+       &Password.With-Header = %base64.encode(%{result_string})
 }
 
 pap.authorize
@@ -39,7 +43,7 @@ if (reject) {
 #  Hex encoded SSHA password
 #
 &control := {
-       &Password.With-Header = "{ssha}%hex(%sha1(%{User-Password}%{Tmp-String-0}))%hex(%{Tmp-String-0})"
+       &Password.With-Header = "{ssha}%hex(%sha1(%{User-Password}%{salt}))%hex(%{salt})"
 }
 
 pap.authorize
@@ -53,20 +57,19 @@ if (reject) {
 #
 #  Base64 encoded SSHA password
 #
-&control := {
-        &Tmp-String-1 = "%hex(%sha1(%{User-Password}%{Tmp-String-0}))%hex(%{Tmp-String-0})"
-}
+&result_string := "%hex(%sha1(%{User-Password}%{salt}))%hex(%{salt})"
 
 # To Binary
-&control.Tmp-Octets-0 := "%bin(%{control.Tmp-String-1})"
+&result_octets := "%bin(%{result_string})"
 
 # To Base64
-&control.Tmp-String-1 := "%base64.encode(%{control.Tmp-Octets-0})"
-&control.Password.With-Header := "{ssha}%{control.Tmp-String-1}"
+&result_string := "%base64.encode(%{result_octets})"
+&control.Password.With-Header := "{ssha}%{result_string}"
 
 pap.authorize
 pap.authenticate {
        reject = 1
+       fail = 2
 }
 if (reject) {
        test_fail
@@ -75,16 +78,14 @@ if (reject) {
 #
 #  Base64 of Base64 encoded SSHA password
 #
-&control := {
-       &Tmp-String-1 = "%hex(%sha1(%{User-Password}%{Tmp-String-0}))%hex(%{Tmp-String-0})"
-}
+&result_string := "%hex(%sha1(%{User-Password}%{salt}))%hex(%{salt})"
 
 # To Binary
-&control.Tmp-Octets-0 := "%bin(%{control.Tmp-String-1})"
+&result_octets := "%bin(%{result_string})"
 
 # To Base64
-&control.Tmp-String-1 := "{ssha}%base64.encode(%{control.Tmp-Octets-0})"
-&control.Password.With-Header := "%base64.encode(%{control.Tmp-String-1})"
+&result_string := "{ssha}%base64.encode(%{result_octets})"
+&control.Password.With-Header := "%base64.encode(%{result_string})"
 
 pap.authorize
 pap.authenticate {
index 0919ac7d467628b57d7a98b8a3933f2c2210dc1b..ef7a8879df5fb733002596c7c939e621df1d5bc5 100644 (file)
@@ -1,6 +1,9 @@
 #
 # PRE: update if pap
 #
+string salt
+string result_string
+octets result_octets
 
 #
 #  @todo - When fully converted, this crashes on ubsan issues.
@@ -15,13 +18,13 @@ if (!('${feature.tls}' == 'yes')) {
 }
 
 &control := {}
-&Tmp-String-0 := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK"        # 60 byte salt
+&salt := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK"        # 60 byte salt
 
 #
 #  Hex encoded SSHA2-512 password
 #
 &control += {
-       &Password.With-Header = "{ssha512}%hex(%sha2_512(%{User-Password}%{Tmp-String-0}))%hex(%{Tmp-String-0})"
+       &Password.With-Header = "{ssha512}%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})"
 }
 
 pap.authorize
@@ -37,16 +40,16 @@ if (reject) {
 #
 #  Base64 encoded SSHA2-512 password
 #
-&control.Tmp-String-1 := "%hex(%sha2_512(%{User-Password}%{Tmp-String-0}))%hex(%{Tmp-String-0})"
+&result_string := "%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})"
 
 # To Binary
-&control.Tmp-Octets-0 := "%bin(%{control.Tmp-String-1})"
+&result_octets := "%bin(%{result_string})"
 
 # To Base64
-&control.Tmp-String-1 := "%base64.encode(%{control.Tmp-Octets-0})"
+&result_string := "%base64.encode(%{result_octets})"
 
 &control += {
-       &Password.With-Header = "{ssha512}%{control.Tmp-String-1}"
+       &Password.With-Header = "{ssha512}%{result_string}"
 }
 
 pap.authorize
@@ -62,16 +65,16 @@ if (reject) {
 #
 #  Base64 of Base64 encoded SSHA2-512 password
 #
-&control.Tmp-String-1 := "%hex(%sha2_512(%{User-Password}%{Tmp-String-0}))%hex(%{Tmp-String-0})"
+&result_string := "%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})"
 
 # To Binary
-&control.Tmp-Octets-0 := "%bin(%{control.Tmp-String-1})"
+&result_octets := "%bin(%{result_string})"
 
 # To Base64
-&control.Tmp-String-1 := "{ssha512}%base64.encode(%{control.Tmp-Octets-0})"
+&result_string := "{ssha512}%base64.encode(%{result_octets})"
 
 &control += {
-       &Password.With-Header = "%base64.encode(%{control.Tmp-String-1})"
+       &Password.With-Header = "%base64.encode(%{result_string})"
 }
 
 pap.authorize
index ffe4afd8c95cb27991ee43d8f11d4a4a17358aec..b169b2161a2aa550815f5b28a79dac542e684b94 100644 (file)
@@ -1,27 +1,27 @@
 parallel {
        group {
                &parent.control += {
-                       &Tmp-Integer-0 = 1
+                       &NAS-Port = 1
                }
        }
        group {
                &parent.control += {
-                       &Tmp-Integer-0 = 3
+                       &NAS-Port = 3
                }
        }
        group {
                &parent.control += {
-                       &Tmp-Integer-0 = 5
+                       &NAS-Port = 5
                }
        }
        group {
                &parent.control += {
-                       &Tmp-Integer-0 = 7
+                       &NAS-Port = 7
                }
        }
 }
 
-if (!(%{control.Tmp-Integer-0[#]} == 4)) {
+if (!(%{control.NAS-Port[#]} == 4)) {
        test_fail
 }
 
index bdba288db1f78bff14a26b7725b4795274fcd8f9..7ef5dda7ba105b1f3ef204d504ad722faa8ab5c2 100644 (file)
@@ -27,7 +27,7 @@ group {
        parallel {
                fail
                group { # This should *NOT* be dispatched
-                       &Tmp-String-0 := 'foo'
+                       &Filter-Id := 'foo'
                }
        }
        actions {
@@ -37,7 +37,7 @@ group {
 if (!fail) {
        test_fail
 }
-if (&Tmp-String-0) {
+if (&Filter-Id) {
        test_fail
 }
 
@@ -51,7 +51,7 @@ group {
                        fail = 10       # Higher priority than ok and no longer action return
                }
                group { # This should now be dispatched
-                       &parent.request.Tmp-String-0 := 'foo'
+                       &parent.request.Filter-Id := 'foo'
                }
        }
        actions {
@@ -61,7 +61,7 @@ group {
 if (!fail) {
        test_fail
 }
-if (!(&Tmp-String-0 == 'foo')) {
+if (!(&Filter-Id == 'foo')) {
        test_fail
 }
 
index 8fa9bacf21b6f2259ec526045ee906aad4de5f93..55ef6ecfd76faaba2285a4e885f915c9ef7ee920 100644 (file)
@@ -6,11 +6,11 @@
 parallel {
        reschedule
        group {
-               &parent.request.Tmp-String-0 := 'foo'
+               &parent.request.Filter-Id := 'foo'
        }
 }
 
-if (!(&Tmp-String-0 == 'foo')) {
+if (!(&Filter-Id == 'foo')) {
        test_fail
 }
 
index 94b67e7699631ae79ac8dd31041e18cba976136e..058c8fd3380ab086a7644cbcbaf16ac1dd59d2c3 100644 (file)
@@ -1,31 +1,34 @@
-&Tmp-String-0 := "%rand('-1')"
+string result_string
+uint32 result_integer
+
+&result_string := "%rand('-1')"
 
 #
 #  Negative limit should have failed assignment
 #
-if !(&Tmp-String-0 == "") {
+if !(&result_string == "") {
        test_fail
 }
 
-&Tmp-String-0 := "%rand('hello world')"
+&result_string := "%rand('hello world')"
 
 #
 #  Invalid limit should have failed assignment
 #
-if !(&Tmp-String-0 == "") {
+if !(&result_string == "") {
        test_fail
 }
 
-&Tmp-Integer-0 := %rand('123')
+&result_integer := %rand('123')
 
-if (!&Tmp-Integer-0) {
+if (!&result_integer) {
        test_fail
 }
 
 #
 #  Make sure random number is within limit
 #
-if (&Tmp-Integer-0 < 0 || &Tmp-Integer-0 > 123) {
+if (&result_integer < 0 || &result_integer > 123) {
        test_fail
 }
 
index 34dc40670097750d652bfe69ae73fa26a1d54163..1d59df385e6176bb2f3041854c2d53a3a1d079b4 100644 (file)
@@ -1,53 +1,47 @@
-&request += {
-       &Tmp-String-1 = "%randstr(nnn)"
-       &Tmp-String-2 = "%randstr(24a)"
-       &Tmp-String-3 = "%randstr(1030aa)"
-       &Tmp-String-5 = "%randstr(10b)"
-}
-
-#
-#  This next assignment fails, so it can't go into the above list.  If
-#  it was there, then the entire list assignment would fail.
-#
-&Tmp-String-0 := "%randstr(%{Tmp-String-0})"
+string result_string
 
 #
 #  Empty output on empty input
 #
-if !(&Tmp-String-0 == "") {
+&result_string := "%randstr(%{result_string})"
+if !(&result_string == "") {
        test_fail
 }
 
 #
 #  Check length of output
 #
-if (!(%length(%{Tmp-String-1}) == 3)) {
+&result_string := "%randstr(nnn)"
+if (!(%length(%{result_string}) == 3)) {
        test_fail
 }
 
-if (!(%length(%{Tmp-String-2}) == 24)) {
+&result_string := "%randstr(24a)"
+if (!(%length(%{result_string}) == 24)) {
        test_fail
 }
 #
 #  Check maximum repetition
 #
-if (!(%length(%{Tmp-String-3}) == 1025)) {
+&result_string := "%randstr(1030aa)"
+if (!(%length(%{result_string}) == 1025)) {
        test_fail
 }
 
 #
 #  Check invalid character class
 #
-&Tmp-String-4 := "%randstr(G)"
+&result_string := "%randstr(G)"
 
-if !(&Tmp-String-4 == "") {
+if !(&result_string == "") {
        test_fail
 }
 
 #
 #  Check repetition of binary output
 #
-if (!(%length(%{Tmp-String-5}) == 10)) {
+&result_string := "%randstr(10b)"
+if (!(%length(%{result_string}) == 10)) {
        test_fail
 }
 
index 019604ae521fb7c9fb4fce89d8363290d7411f81..be43c2e9e04555d685bb03e50fd3ca63c24ac71c 100644 (file)
@@ -4,18 +4,20 @@
 #
 #  The first one fails, so the second one is used
 #
+uint32 count
+
+&count := 0
 &request += {
-       &Tmp-Integer-0 = 0
-       &Tmp-Integer-1 = 0
-       &Tmp-Integer-1 = 1
-       &Tmp-Integer-1 = 2
-       &Tmp-Integer-1 = 3
-       &Tmp-Integer-1 = 4
-       &Tmp-Integer-1 = 5
-       &Tmp-Integer-1 = 6
-       &Tmp-Integer-1 = 7
-       &Tmp-Integer-1 = 8
-       &Tmp-Integer-1 = 9
+       &NAS-Port = 0
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 3
+       &NAS-Port = 4
+       &NAS-Port = 5
+       &NAS-Port = 6
+       &NAS-Port = 7
+       &NAS-Port = 8
+       &NAS-Port = 9
 }
 
 redundant {
@@ -41,7 +43,7 @@ if (!&reply.Result-Status) {
 #
 #  Loop 0..9
 #
-foreach &Tmp-Integer-1 {
+foreach &NAS-Port {
        redundant {
                group {
                        # fail on even numbered values, succeed on odd numbered ones
@@ -49,9 +51,9 @@ foreach &Tmp-Integer-1 {
                                fail
                        }
                        else {
-                               &Tmp-Integer-0 += 1
+                               &count += 1
                                &request += {
-                                       &Tmp-String-0 = "Succeed odd %{Foreach-Variable-0} %{Tmp-Integer-0}"
+                                       &Reply-Message = "Succeed odd %{Foreach-Variable-0} %{count}"
                                }
                                ok
                        }
@@ -62,9 +64,9 @@ foreach &Tmp-Integer-1 {
                                fail
                        }
                        else {
-                               &Tmp-Integer-0 += 1
+                               &count += 1
                                &request += {
-                                       &Tmp-String-0 = "Succeed even %{Foreach-Variable-0} %{Tmp-Integer-0}"
+                                       &Reply-Message = "Succeed even %{Foreach-Variable-0} %{count}"
                                }
                                ok
                        }
@@ -72,7 +74,7 @@ foreach &Tmp-Integer-1 {
        }
 }
 
-if (!(&Tmp-Integer-0 == %{Tmp-Integer-1[#]})) {
+if (!(&count == %{NAS-Port[#]})) {
        test_fail
 }
 
index 6f190053b33e8f39ab14ef064c5e4d5962a2e7bb..9a0dbe9521af4a76790d040527bfbaea32e85f53 100644 (file)
@@ -4,24 +4,26 @@
 #
 #  The first one fails, so the second one is used
 #
+uint32 count
+
+&count := 0;
 &request += {
-       &Tmp-Integer-0 = 0
-       &Tmp-Integer-1 = 0
-       &Tmp-Integer-1 = 1
-       &Tmp-Integer-1 = 2
-       &Tmp-Integer-1 = 3
-       &Tmp-Integer-1 = 4
-       &Tmp-Integer-1 = 5
-       &Tmp-Integer-1 = 6
-       &Tmp-Integer-1 = 7
-       &Tmp-Integer-1 = 8
-       &Tmp-Integer-1 = 9
+       &NAS-Port = 0
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 3
+       &NAS-Port = 4
+       &NAS-Port = 5
+       &NAS-Port = 6
+       &NAS-Port = 7
+       &NAS-Port = 8
+       &NAS-Port = 9
 }
 
 #
 #  Loop 0..9
 #
-foreach &Tmp-Integer-1 {
+foreach &NAS-Port {
        redundant-load-balance {
                group {
                        # fail on even numbered values, succeed on odd numbered ones
@@ -29,9 +31,9 @@ foreach &Tmp-Integer-1 {
                                fail
                        }
                        else {
-                               &Tmp-Integer-0 += 1
+                               &count += 1
                                &request += {
-                                       &Tmp-String-0 = "Succeed odd %{Foreach-Variable-0} %{Tmp-Integer-0}"
+                                       &Reply-Message = "Succeed odd %{Foreach-Variable-0} %{count}"
                                }
                                ok
                        }
@@ -42,9 +44,9 @@ foreach &Tmp-Integer-1 {
                                fail
                        }
                        else {
-                               &Tmp-Integer-0 += 1
+                               &count += 1
                                &request += {
-                                       &Tmp-String-0 = "Succeed even %{Foreach-Variable-0} %{Tmp-Integer-0}"
+                                       &Reply-Message = "Succeed even %{Foreach-Variable-0} %{count}"
                                }
                                ok
                        }
@@ -52,7 +54,7 @@ foreach &Tmp-Integer-1 {
        }
 }
 
-if (!(&Tmp-Integer-0 == %{Tmp-Integer-1[#]})) {
+if (!(&count == %{NAS-Port[#]})) {
        test_fail
 }
 
index fb24a75b6609e4c6463d6e6ddd0aea8245dcc3b3..cf300335d082462ee42e6f9d17bd41907f8397b8 100644 (file)
@@ -1,11 +1,11 @@
 redundant {
-       map test-fail &Tmp-String-0 {
-               &Tmp-Integer-0 := '$[3][2]'
+       map test-fail &Filter-Id {
+               &NAS-Port := '$[3][2]'
        }
        noop
 }
 
-if (noop || (&Tmp-Integer-0 == 4294967295)) {
+if (noop || (&NAS-Port == 4294967295)) {
        success
 } else {
        fail
index 1001ac1ab9d7f8a159c9f724741b6253f2bfad9a..9730014cd28b662bb5cf7cb17bc5685eab41c891 100644 (file)
@@ -3,29 +3,32 @@
 #  Nested redundant blocks.
 #
 #
-&request += {
-       &Tmp-Integer-2 = 0
-       &Tmp-Integer-3 = 0
-       &Tmp-Integer-4 = 0
-       &Tmp-Integer-5 = 0
-}
+uint32 count1
+uint32 count2
+uint32 count3
+uint32 count4
+
+&count1 = 0
+&count2 = 0
+&count3 = 0
+&count4 = 0
 
 redundant {
        redundant-load-balance {
                group {
-                       &Tmp-Integer-2 += 1
+                       &count1 += 1
                        fail
                }
                group {
-                       &Tmp-Integer-3 += 1
+                       &count2 += 1
                        fail
                }
                group {
-                       &Tmp-Integer-4 += 1
+                       &count3 += 1
                        fail
                }
                group {
-                       &Tmp-Integer-5 += 1
+                       &count4 += 1
                        fail
                }
        }
@@ -41,21 +44,21 @@ if (!ok) {
        return
 }
 
-if (!(&Tmp-Integer-2 == 1)) {
+if (!(&count1 == 1)) {
        test_fail
 }
 
-if (!(&Tmp-Integer-3 == 1)) {
+if (!(&count2 == 1)) {
        test_fail
        return
 }
 
-if (!(&Tmp-Integer-4 == 1)) {
+if (!(&count3 == 1)) {
        test_fail
        return
 }
 
-if (!(&Tmp-Integer-5 == 1)) {
+if (!(&count4 == 1)) {
        test_fail
        return
 }
index 4d70b2a29efd77f101f68056c73da64c1e542341..5f469cbbdf088aa33581b469858373869a44e33e 100644 (file)
@@ -1,21 +1,21 @@
 #
 #  PRE: if
 #
+string test_string1
+string test_string2
 
 #
 #  Strings which are expanded in a regex have regex special
 #  characters escaped.  Because the input strings are unsafe.
 #
-&request += {
-       &Tmp-String-0 = "%taint(example.com)"
-       &Tmp-String-1 = "%taint(exampleXcom)"
-}
+&test_string1 := "%taint(example.com)"
+&test_string2 := "%taint(exampleXcom)"
 
-if ("exampleXcom" =~ /%{Tmp-String-0}/) {
+if ("exampleXcom" =~ /%{test_string1}/) {
        test_fail
 }
 
-elsif (&Tmp-String-1 =~ /%{Tmp-String-0}/) {
+if (&test_string2 =~ /%{test_string1}/) {
        test_fail
 }
 
index e763c92a43c6687aa050b71b82599baeccad995d..17c4ccc527423bdc6d9bbc2f0be5ad4bbe5ca367 100644 (file)
@@ -1,20 +1,20 @@
 #
 #  PRE: if regex-escape
 #
+string test_string1
+string test_string2
 
 #
 #  Strings which are expanded in a regex have regex special
 #  characters escaped.  Because the input strings are unsafe.
 #
-&request += {
-       &Tmp-String-0 = "example.com"
-       &Tmp-String-1 = "^foo$bar"
-}
+&test_string1 = "example.com"
+&test_string2 = "^foo$bar"
 
-if !(&Tmp-String-0 =~ /example\.com$/) {
+if !(&test_string1 =~ /example\.com$/) {
        test_fail
 }
-elsif !(&Tmp-String-1 =~ /\^foo\$bar/) {
+elsif !(&test_string2 =~ /\^foo\$bar/) {
        test_fail
 }
 
index cd848655d6ab6c789c7f443df88fd421ead57849..48085c65eb7cfc334129e99836e6f3a301bc9bdc 100644 (file)
@@ -1,9 +1,10 @@
 # PRE: if
+uint32 count
 
-&Tmp-Integer-0 := 0
+&count := 0
 
 group {
-       &Tmp-Integer-0 += 1
+       &count += 1
 
        noop
        actions {
@@ -15,7 +16,7 @@ group {
        }
 }
 
-if (!(&Tmp-Integer-0 == 3)) {
+if (!(&count == 3)) {
        test_fail
 }
 
index 7fa33d6a20b538dbe261c58dd06969934e8a2ab5..fef36587efea504fd5f3311fc4b8889e5cb0c373 100644 (file)
@@ -2,13 +2,13 @@
 #  PRE: if return foreach
 #
 &control += {
-       &Tmp-Integer-0 = 0
-       &Tmp-Integer-0 = 1
-       &Tmp-Integer-0 = 2
-       &Tmp-Integer-0 = 3
+       &NAS-Port = 0
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 3
 }
 
-foreach &control.Tmp-Integer-0 {
+foreach &control.NAS-Port {
        policy_return
 
        # Should continue executing
@@ -17,16 +17,16 @@ foreach &control.Tmp-Integer-0 {
        }
 
        &control -= {
-               &Tmp-Integer-0 == "%{Foreach-Variable-0}"
+               &NAS-Port == "%{Foreach-Variable-0}"
        }
 }
 
 # Everything should have been removed except
-# the last incidence of &Tmp-Integer-0
-if (!&control.Tmp-Integer-0) {
+# the last incidence of &NAS-Port
+if (!&control.NAS-Port) {
        test_fail
 }
-if (!(&control.Tmp-Integer-0[0] == 2)) {
+if (!(&control.NAS-Port[0] == 2)) {
        test_fail
 }
 
index 3c2abb418fd7d87fc460b8329c38754555d119e7..6379675add9072023d396de73e901920fb19940b 100644 (file)
@@ -2,14 +2,14 @@
 #  PRE: if return foreach
 #
 &control += {
-       &Tmp-Integer-0 = 0
-       &Tmp-Integer-0 = 1
-       &Tmp-Integer-0 = 2
-       &Tmp-Integer-0 = 3
+       &NAS-Port = 0
+       &NAS-Port = 1
+       &NAS-Port = 2
+       &NAS-Port = 3
 }
 
 group {
-       foreach &control.Tmp-Integer-0 {
+       foreach &control.NAS-Port {
                if ("%{Foreach-Variable-0}" == '2') {
                        accept
                        success
index ddb4476e60eb783becc25f5e37d0ca62e252479c..570b80c3349a753f5f376bbc1e034fdc9362076b 100644 (file)
@@ -1,57 +1,53 @@
 #
 # PRE: if
 #
-&request += {
-       &Tmp-String-0 = "This is a string\n"
-       &Tmp-Octets-0 = 0x000504030201
-       &Tmp-String-1 = "what do ya want for nothing?"
-       &Tmp-String-2 = "Jefe"
-       &Tmp-String-3 = ""
-}
+string test_string
+string test_hmac_key
+string test_hmac_data
+string dummy_string
 
-&request += {
-       &Tmp-Octets-2 = %sha1("This is a string\n")
-       &Tmp-Octets-3 = %sha1("%{Tmp-String-0}")
-       &Tmp-Octets-4 = %sha1("%{request.Tmp-String-0}")
-       &Tmp-Octets-5 = %sha1("%{request.Tmp-Octets-9}")
-       &Tmp-Octets-6 = %hmacsha1("%{Tmp-String-1}", "%{Tmp-String-2}")
-       &Tmp-Octets-7 = %hmacsha1("%{Tmp-String-3}", "%{Tmp-String-3}")
-}
+octets result_octets
+
+&test_string := "This is a string\n"
+&test_hmac_key := "what do ya want for nothing?"
+&test_hmac_data := "Jefe"
 
 #
 #  Put "This is a string" into a file and call "sha1sum" on it.
 #  You should get this string.
 #
-if (!(&Tmp-Octets-2 == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) {
-       test_fail
-}
-
-if (!(&Tmp-Octets-3 == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) {
+&result_octets := %sha1("This is a string\n")
+if (!(&result_octets == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) {
        test_fail
 }
 
-if (!(&Tmp-Octets-4 == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) {
+&result_octets := %sha1("%{test_string}")
+if (!(&result_octets == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) {
        test_fail
 }
 
 #
 # SHA1 of empty string
 #
-if (!(&Tmp-Octets-5 == 0xda39a3ee5e6b4b0d3255bfef95601890afd80709)) {
+&result_octets := %sha1("%{dummy_string}")
+if (!(&result_octets == 0xda39a3ee5e6b4b0d3255bfef95601890afd80709)) {
        test_fail
 }
 
 #
 #  SHA1 HMAC with attribute references
 #
-if (!(&Tmp-Octets-6 == 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79)) {
+&result_octets := %hmacsha1("%{test_hmac_key}", "%{test_hmac_data}")
+if (!(&result_octets == 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79)) {
        test_fail
 }
 
 #
 #  SHA1 HMAC with empty key and data
 #
-if (!(&Tmp-Octets-7 == 0xfbdb1d1b18aa6c08324b7d64b71fb76370690e1d)) {
+&dummy_string := ''
+&result_octets := %hmacsha1("%{dummy_string}", "%{dummy_string}")
+if (!(&result_octets == 0xfbdb1d1b18aa6c08324b7d64b71fb76370690e1d)) {
        test_fail
 }
 
index ed54f99c37753c05fa8e11ba122f0f3d9fc5f989..28fc7120192229d3a40f2241d93cc1441d891400 100644 (file)
@@ -1,10 +1,12 @@
-&Tmp-String-1 := "hello"
+string test_string
+octets result_octets
+&test_string := "hello"
 
 #
 #  SHA1 HMAC with missing key should fail
 #
-&Tmp-Octets-1 := %hmacsha1(%{Tmp-String-1}, ) # ERROR
-if &Tmp-Octets-1 {
+&result_octets := %hmacsha1(%{test_string}, ) # ERROR
+if &result_octets {
        test_fail
 }
 success
index 9c4c1ccb1b43caa2888795c10bcf78a7d6348e9c..a91d4bb08622574a36f41e1c277749cb001fbaaa 100644 (file)
@@ -1,42 +1,41 @@
 #
 # PRE: update if
 #
-&Tmp-String-0 := "This is a string\n"
-&Tmp-Octets-0 := 0x000504030201
+string test_string
+octets test_octets
+octets dummy_octets
+octets result_octets
 
-&Tmp-Octets-1 := %sha2_256("This is a string\n")
-&Tmp-Octets-2 := %sha2_256(%{Tmp-String-0})
-&Tmp-Octets-3 := %sha2_256(%{request.Tmp-String-0})
-&Tmp-Octets-4 := %sha2_256(%{request.Tmp-Octets-0})
-&Tmp-Octets-5 := %sha2_256(%{request.Tmp-Octets-9})
+&test_string := "This is a string\n"
+&test_octets := 0x000504030201
 
 #
 #  Put "This is a string" into a file and call "sha2_256sum" on it.
 #  You should get this string.
 #
-if (!(&Tmp-Octets-1 == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
+&result_octets := %sha2_256("This is a string\n")
+if (!(&result_octets == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
        test_fail
 }
 
-if (!(&Tmp-Octets-2 == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
-       test_fail
-}
-
-if (!(&Tmp-Octets-3 == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
+&result_octets := %sha2_256(%{test_string})
+if (!(&result_octets == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
        test_fail
 }
 
 #
 #  SHA256 should also be able to cope with references to octet attributes
 #
-if (!(&Tmp-Octets-4 == 0xf307e202b881fded70e58017aa0c4d7b29c76ab25d02bf078301a5f6635187eb)) {
+&result_octets := %sha2_256(%{test_octets})
+if (!(&result_octets == 0xf307e202b881fded70e58017aa0c4d7b29c76ab25d02bf078301a5f6635187eb)) {
        test_fail
 }
 
 #
 # SHA256 of empty string
 #
-if (!(&Tmp-Octets-5 == 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)) {
+&result_octets := %sha2_256(%{dummy_octets})
+if (!(&result_octets == 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)) {
        test_fail
 }
 
@@ -44,19 +43,18 @@ if (!(&Tmp-Octets-5 == 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991
 #  SHA512 and SHA256 share common code paths, so the tests don't need to be
 #  as exhaustive.
 #
-&Tmp-Octets-1 := %sha2_512("This is a string\n")
-&Tmp-Octets-2 := %sha2_512(%{Tmp-String-0})
-&Tmp-Octets-3 := %sha2_512(%{request.Tmp-Octets-0})
-
-if (!(&Tmp-Octets-1 == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) {
+&result_octets := %sha2_512("This is a string\n")
+if (!(&result_octets == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) {
        test_fail
 }
 
-if (!(&Tmp-Octets-2 == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) {
+&result_octets := %sha2_512(%{test_string})
+if (!(&result_octets == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) {
        test_fail
 }
 
-if (!(&Tmp-Octets-3 == 0xde80271eb5e03a1c24dd0cd823a22305a743ee3a54f1de5bf97adbf56984561154bfb6928b1da4ccc3f5dde9f4032ad461937b60b9ace4ad3898cf45c90596d7)) {
+&result_octets := %sha2_512(%{test_octets})
+if (!(&result_octets == 0xde80271eb5e03a1c24dd0cd823a22305a743ee3a54f1de5bf97adbf56984561154bfb6928b1da4ccc3f5dde9f4032ad461937b60b9ace4ad3898cf45c90596d7)) {
        test_fail
 }
 
index 7577887ae1bf3bc519ae03a9f9acb371401fffa1..d5c1eaed0f9fce42a9a5acaf6dc10806c1a86591 100644 (file)
@@ -1,3 +1,3 @@
-&Tmp-Integer-0 := -1000  # ERROR
+&NAS-Port := -1000  # ERROR
 
 test_fail
index 8f1f01338c9cf021d4f84a801827f02596f41123..4d0cead3409ca690d62e0742877d51fdbdcd38e8 100644 (file)
@@ -1,12 +1,12 @@
 #
 #  PRE: subrequest
 #
-&control.Tmp-String-0 := "Access-Request"
+&control.Filter-Id := "Access-Request"
 
 #
 #  Subrequest with an attribute reference
 #
-subrequest &control.Tmp-String-0 {
+subrequest &control.Filter-Id {
        &parent.control.User-Name := 'bob'
 
        success
index fd1848847cedbc51bd4d62053fb7a4863ac7f983..40df3c3d45989c78526429085fad6eb3a0d850a1 100644 (file)
@@ -1,25 +1,25 @@
 #
 #  PRE: subrequest
 #
-&Tmp-String-1 := 'testing'
+&Filter-Id := 'testing'
 
 # Cancel in subrequest
 subrequest Access-Request {
        detach
 
        # Smoke test, check for crashes
-       if (&parent.Tmp-String-1 == 'testing') {
+       if (&parent.Filter-Id == 'testing') {
                test_fail
        }
 
-       &parent.Tmp-String-2 = 'testing'
+       &parent.Reply-Message = 'testing'
 
        # As we're detached this failure doesn't do anything
        test_fail
 }
 
 # Should not have been set from detached child
-if (&Tmp-String-2 && (&Tmp-String-2 == 'testing')) {
+if (&Reply-Message && (&Reply-Message == 'testing')) {
        test_fail
 }
 
index 6c38de1e4b515826cda5e0687d6a23840a317fab..c398218de0e2d979106fd8e54f2b2a95a07d6c9b 100644 (file)
@@ -13,15 +13,15 @@ subrequest Access-Request {
                        &User-Name := "joe"
 
                        &outer.request += {
-                               &Tmp-String-0 = &current.User-Name
-                               &Tmp-String-1 = &parent.User-Name
-                               &Tmp-String-2 = &parent.parent.User-Name
-                               &Tmp-String-3 = &parent.parent.parent.User-Name
-                               &Tmp-String-4 = &outer.User-Name
-                               &Tmp-String-5 = &current.outer.User-Name
-                               &Tmp-String-6 = &parent.current.outer.User-Name
-                               &Tmp-String-7 = "%{parent.parent.parent.parent.User-Name}"
-                               &Tmp-String-8 = "%{outer.parent.User-Name}"
+                               &Filter-Id = &current.User-Name
+                               &Filter-Id = &parent.User-Name
+                               &Filter-Id = &parent.parent.User-Name
+                               &Filter-Id = &parent.parent.parent.User-Name
+                               &Filter-Id = &outer.User-Name
+                               &Filter-Id = &current.outer.User-Name
+                               &Filter-Id = &parent.current.outer.User-Name
+                               &Filter-Id = "%{parent.parent.parent.parent.User-Name}"
+                               &Filter-Id = "%{outer.parent.User-Name}"
                        }
                }
        }
@@ -31,39 +31,39 @@ if !(&Outer-Realm-Name == 'testing123') {
        test_fail
 }
 
-if !(&Tmp-String-0 == 'joe') {
+if !(&Filter-Id[0] == 'joe') {
        test_fail
 }
 
-if !(&Tmp-String-1 == 'jim') {
+if !(&Filter-Id[1] == 'jim') {
        test_fail
 }
 
-if !(&Tmp-String-2 == 'obo') {
+if !(&Filter-Id[2] == 'obo') {
        test_fail
 }
 
-if !(&Tmp-String-3 == 'bob') {
+if !(&Filter-Id[3] == 'bob') {
        test_fail
 }
 
-if !(&Tmp-String-4 == 'bob') {
+if !(&Filter-Id[4] == 'bob') {
        test_fail
 }
 
-if !(&Tmp-String-5 == 'bob') {
+if !(&Filter-Id[5] == 'bob') {
        test_fail
 }
 
-if !(&Tmp-String-6 == 'bob') {
+if !(&Filter-Id[6] == 'bob') {
        test_fail
 }
 
-if !(&Tmp-String-7 == "") {
+if !(&Filter-Id[7] == "") {
        test_fail
 }
 
-if !(&Tmp-String-8 == "") {
+if !(&Filter-Id[8] == "") {
        test_fail
 }
 
index de8e098f2c8e9863008502c6b4925f00d4072163..9254bdfab1f7c5cfa0de88fc4d3dd0fb04ee6385 100644 (file)
@@ -1,19 +1,19 @@
 subrequest Access-Request {
-       &parent.request.Tmp-String-0 := "testing1234"
+       &parent.request.Filter-Id := "testing1234"
 
        return
 
        #
        #  Should be ignored
        #
-       &parent.request.Tmp-String-1 := "testing1234"
+       &parent.request.Reply-Message := "testing1234"
 }
 
-if (&Tmp-String-1) {
+if (&Reply-Message) {
        test_fail
 }
 
-if (!(&Tmp-String-0 == "testing1234")) {
+if (!(&Filter-Id == "testing1234")) {
        test_fail
 }
 
index 33162169e9c340bc74d12228397b270b21606ef7..e8bc15b46934c66dc831868107d9ac6c6f851579 100644 (file)
@@ -10,18 +10,18 @@ subrequest Access-Request &request &reply.Tmp-Group-0 {
                test_fail
        }
 
-       &reply.Tmp-String-0 := 'hello from subrequest'
+       &reply.Filter-Id := 'hello from subrequest'
 }
 
 if (!&reply.Tmp-Group-0) {
        test_fail
 }
 
-if (!&reply.Tmp-Group-0.Tmp-String-0) {
+if (!&reply.Tmp-Group-0.Filter-Id) {
        test_fail
 }
 
-if !(&reply.Tmp-Group-0.Tmp-String-0 == 'hello from subrequest') {
+if !(&reply.Tmp-Group-0.Filter-Id == 'hello from subrequest') {
        test_fail
 }
 
index 29121b9b95c0c0b7b050f83041d259738c86278f..23ee615728054e9a7ff8e956da477251119fb691 100644 (file)
@@ -11,7 +11,7 @@ subrequest Access-Request &request &reply.Tmp-Group-0 {
                        test_fail
                }
 
-               &reply.Tmp-String-0 := 'hello from subrequest'
+               &reply.Filter-Id := 'hello from subrequest'
        }
 }
 
@@ -19,11 +19,11 @@ if (!&reply.Tmp-Group-0.Tmp-Group-0) {
        test_fail
 }
 
-if (!&reply.Tmp-Group-0.Tmp-Group-0.Tmp-String-0) {
+if (!&reply.Tmp-Group-0.Tmp-Group-0.Filter-Id) {
        test_fail
 }
 
-if !(&reply.Tmp-Group-0.Tmp-Group-0.Tmp-String-0 == 'hello from subrequest') {
+if !(&reply.Tmp-Group-0.Tmp-Group-0.Filter-Id == 'hello from subrequest') {
        test_fail
 }
 
index 7e9087bb5bda4d0aac53d5863bc2e1cdf1958588..d505ea9981b8dcf1a650d4f4d26a2bb656364d85 100644 (file)
@@ -9,5 +9,5 @@ User-Password = "hello"
 #  Expected answer
 #
 Packet-Type == Access-Accept
-Tmp-Group-0 == { Tmp-Group-0 == { Tmp-String-0 == 'hello from subrequest' } }
+Tmp-Group-0 == { Tmp-Group-0 == { Filter-Id == 'hello from subrequest' } }
 Result-Status == "success"
index 055e3fb202b1a24671881d4613ed3eac7703c882..8892f32a75b4d4c1e79334d077df28828cfad27c 100644 (file)
@@ -9,5 +9,5 @@ User-Password = "hello"
 #  Expected answer
 #
 Packet-Type == Access-Accept
-Tmp-Group-0 == { Tmp-String-0 == 'hello from subrequest' }
+Tmp-Group-0 == { Filter-Id == 'hello from subrequest' }
 Result-Status == "success"
index c511904401a0c03d6fb0695b71cbf80241a8c55f..8491b41d632e9809c1b3feae28a4949cb70cab8f 100644 (file)
@@ -1,6 +1,7 @@
-&Tmp-String-0 := 'foo'
+string test_string
+&test_string := 'foo'
 
-switch "%tolower(%{Tmp-String-0})" {
+switch "%tolower(%{test_string})" {
        case 'foo' {
                success
        }
@@ -14,7 +15,7 @@ switch "%tolower(%{Tmp-String-0})" {
        }
 }
 
-switch "%{Tmp-String-0}" {
+switch "%{test_string}" {
        case 'foo' {
                success
        }
index 54b1e2d4b891c85c7ab26300c3cdc8350133f1f1..776b91a36bfaaf853f06bcdf2a791050a8fb27a2 100644 (file)
@@ -1,13 +1,14 @@
 #
 # PRE: xlat-delay
 #
+float32 a
 
 #
 #  Set a timeout which will fire, and cause the block to fail.
 #
 redundant {
        timeout 0.01s {
-               &Tmp-Float-0 := %delay_10s(0.1)
+               &a := %delay_10s(0.1)
                test_fail
        }
 
@@ -18,7 +19,7 @@ redundant {
 
 redundant {
        timeout "0.01" {
-               &Tmp-Float-0 := %delay_10s(0.1)
+               &a := %delay_10s(0.1)
                test_fail
        }
 
index d7bb22732fe1ede3efc440909c5e4493d277984a..c7c1eaf13f7bdf446dbd9b1b658b791b39b2661f 100644 (file)
@@ -1,25 +1,26 @@
 #
 # PRE: if
 #
-&Tmp-String-0  := "AbCdE"
-&Tmp-String-0  := %tolower(%{Tmp-String-0})
-&Tmp-String-1  := %tolower(AAbbCCdd)
-
-#
-#  Doesn't exist
-#
-&Tmp-String-2  := "%tolower(%{Tmp-String-9})"
+string test_string
+string dummy_string
 
+&test_string   := "AbCdE"
+&test_string   := %tolower(%{test_string})
 
-if (!(&Tmp-String-0 == "abcde")) {
+if !(&test_string == "abcde") {
        test_fail
 }
 
-if (!(&Tmp-String-1 == "aabbccdd")) {
+&test_string   := %tolower(AAbbCCdd)
+if !(&test_string == "aabbccdd") {
        test_fail
 }
 
-if !(&Tmp-String-2 == "") {
+#
+#  Doesn't exist
+#
+&test_string   := "%tolower(%{dummy_string})"
+if !(&test_string == "") {
        test_fail
 }
 
index 5bc1bea1d17502a137ad5dfe6b0e1e23a0a57263..9dd8fa981ee4d6c4aabb0efc3c874e217a479826 100644 (file)
@@ -1,21 +1,22 @@
 #
 # PRE: if
 #
-&Tmp-String-0  := "AbCdE"
+string test_string
+string dummy_string
 
-&Tmp-String-0  := %toupper(%{Tmp-String-0})
-&Tmp-String-1  := %toupper(AAbbCCdd)
-&Tmp-String-2  := "%toupper(%{Tmp-String-9})"
-
-if (!(&Tmp-String-0 == "ABCDE")) {
+&test_string   := "AbCdE"
+&test_string   := %toupper(%{test_string})
+if (!(&test_string == "ABCDE")) {
        test_fail
 }
 
-if (!(&Tmp-String-1 == "AABBCCDD")) {
+&test_string   := %toupper(AAbbCCdd)
+if (!(&test_string == "AABBCCDD")) {
        test_fail
 }
 
-if !(&Tmp-String-2 == "") {
+&test_string   := "%toupper(%{dummy_string})"
+if !(&test_string == "") {
        test_fail
 }
 
index edcfc93f979c70a84c4bf22e7dfaaae0ecb3bc81..1267a04425eda14b57cd41b804c391338676a254 100644 (file)
@@ -1,7 +1,10 @@
 # cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-f0-9' | head -c <n>
 
 # 8192 - 0x (2) - '' (2) there are unlikely to be any static buffers this big outside of the conffile parser
-&Tmp-Octets-0 := 0x\
+octets test_octets
+string result_string
+
+&test_octets := 0x\
 d8abccb7834711af1de1812be2579febe946f5d7beef6fa5c7074c0cb917e9b91e23e14b016f27610097c16c0e0fad88176e077b24198c770746159\
 05b8810d1c8b774d98889fa5c6027cde5e9c56dd4f7c48298c7713aeca5ba5dcfd506032ad05b1396f50e825b633d5a6af0dce6181b640287e03a65\
 8734df46a86341556f28455b3f377313a5a2ac8c8267b8a5de559b95f9b493a68b9e0278485f9e3914d702b2b7b90ee85ff393461f197386d09b836\
@@ -73,18 +76,18 @@ a02f4a3ab98d75992d68a15d393387fe9ef01041569570ad6fe884764e55567311bcacfcffae7655
 3ae4bcef324b9a3f47ba5c835b54a010ca42f3b9cc5368278c148c9b02ea8c4c9f244fd49f
 
 # Actual length of octet string is 4083 bytes
-if (!(%length(%{Tmp-Octets-0}) == 4083)) {
+if (!(%length(%{test_octets}) == 4083)) {
        test_fail
 }
 
 # Octets are expanded to 8168 hexits
-if !("0x%hex(%{Tmp-Octets-0})" =~ /^0x([0-9a-f]+)$/) {
+if !("0x%hex(%{test_octets})" =~ /^0x([0-9a-f]+)$/) {
        test_fail
 }
 
-&Tmp-String-0 := "%{1}"
+&result_string := "%{1}"
 
-if (!("%length(%{Tmp-String-0})" == 8166)) {
+if (!("%length(%{result_string})" == 8166)) {
        test_fail
 }
 
index f9f9a34682fe6d1d32a1c3cdf577cf4485b62261..8449f314db48960f085da8d832a3acad19a65f8c 100644 (file)
@@ -1,46 +1,51 @@
 #
 #  PRE: if edit
 #
+octets test_octets
+string test_string
+ipaddr result_ipaddr
+uint32 result_integer
+string result_string
+
 &Framed-IP-Address := 127.0.0.1
-&Tmp-Octets-0 := &Framed-IP-Address
+&test_octets := &Framed-IP-Address
 
-&Tmp-String-0 := "%unpack(%{Tmp-Octets-0}, 0, 'ipaddr')"
-&Tmp-IP-Address-0 := "%unpack(%{Tmp-Octets-0}, 0, 'ipaddr')"
+&test_string := "%unpack(%{test_octets}, 0, 'ipaddr')"
+&result_ipaddr := "%unpack(%{test_octets}, 0, 'ipaddr')"
 
-if !(&Tmp-String-0 == "127.0.0.1") {
+if !(&test_string == "127.0.0.1") {
        test_fail
 }
 
-if !(&Tmp-IP-Address-0 == 127.0.0.1) {
+if !(&result_ipaddr == 127.0.0.1) {
        test_fail
 }
 
-&Tmp-Octets-0 := 0x000001020304
-&Tmp-Integer-0 := "%unpack(%{Tmp-Octets-0}, 4, 'uint16')"
+&test_octets := 0x000001020304
+&result_integer := "%unpack(%{test_octets}, 4, 'uint16')"
 
 # Octets 4 and 5 == 0x0304 == 772
-if ~(&Tmp-Integer-0 == 772) {
+if ~(&result_integer == 772) {
        test_fail
 }
 
 # truncation
-&Tmp-String-0 := "0x0011223344556677"
-&Tmp-String-1 := "%unpack(%{Tmp-String-0}, 0, 'ether')"
-if !(&Tmp-String-1 == "00:11:22:33:44:55") {
+&test_string := "0x0011223344556677"
+&result_string := "%unpack(%{test_string}, 0, 'ether')"
+if !(&result_string == "00:11:22:33:44:55") {
        test_fail
 }
 
-&Tmp-String-0 := "0x48656C6C6F"
-&Tmp-String-1 := "%unpack(%{Tmp-String-0}, 0, 'string')"
-if !(&Tmp-String-1 == "Hello") {
+&test_string := "0x48656C6C6F"
+&result_string := "%unpack(%{test_string}, 0, 'string')"
+if !(&result_string == "Hello") {
        test_fail
 }
 
 # Offset beyond data length
-&request -= &Tmp-String-1[*]
-&Tmp-String-1 := "%unpack(%{Tmp-String-0}, 10, 'string')"
+&result_string := "%unpack(%{test_string}, 10, 'string')"
 
-if !(&Tmp-String-1 == "") {
+if !(&result_string == "") {
        test_fail
 }
 
@@ -50,8 +55,8 @@ if (!(&Module-Failure-Message == "unpack offset 10 is larger than input data len
 &request -= &Module-Failure-Message[*]
 
 # Invalid destination data type
-&Tmp-String-1 := "%unpack(%{Tmp-String-0}, 0, 'thing')"
-if !(&Tmp-String-1 == "") {
+&result_string := "%unpack(%{test_string}, 0, 'thing')"
+if !(&result_string == "") {
        test_fail
 }
 
@@ -60,8 +65,8 @@ if (!(&Module-Failure-Message == "Invalid data type 'thing'")) {
 }
 
 # Invalid source data type
-&Tmp-String-1 := "%unpack(%{Tmp-Integer-0}, 0, 'string')"
-if !(&Tmp-String-1 == "") {
+&result_string := "%unpack(%{result_integer}, 0, 'string')"
+if !(&result_string == "") {
        test_fail
 }
 
@@ -71,10 +76,10 @@ if (!(&Module-Failure-Message == "unpack requires the input attribute to be 'str
 &request -= &Module-Failure-Message[*]
 
 # Invalid hex string
-&Tmp-String-0 := '0x014sdgw'
-&Tmp-String-1 := "%unpack(%{Tmp-String-0}, 0, 'string')"
+&test_string := '0x014sdgw'
+&result_string := "%unpack(%{test_string}, 0, 'string')"
 
-if !(&Tmp-String-1 == "") {
+if !(&result_string == "") {
        test_fail
 }
 
@@ -84,10 +89,10 @@ if (!(&Module-Failure-Message == "Invalid hex string in '0x014sdgw'")) {
 &request -= &Module-Failure-Message[*]
 
 # Zero length hex string
-&Tmp-String-0 := '0x'
-&Tmp-String-1 := "%unpack(%{Tmp-String-0}, 0, 'string')"
+&test_string := '0x'
+&result_string := "%unpack(%{test_string}, 0, 'string')"
 
-if !(&Tmp-String-1 == "") {
+if !(&result_string == "") {
        test_fail
 }
 
index 25188d4b6e68c32ca5c53c0569c424aa0e79b601..9b43a096d63865f833d397644570fdfbbf8509fc 100644 (file)
@@ -3,12 +3,12 @@
 #
 
 update request {
-       &Tmp-String-0 := 'foobarbaz'
-       &Tmp-Integer-0 := 123456789
-       &Tmp-IP-Address-0 := 192.0.2.1
+       &Filter-Id := 'foobarbaz'
+       &NAS-Port := 123456789
+       &Framed-IP-Address := 192.0.2.1
 }
 
-if (!((&Tmp-String-0 == 'foobarbaz')) || (!(&Tmp-Integer-0 == 123456789)) || (!(&Tmp-IP-Address-0 == 192.0.2.1))) {
+if (!((&Filter-Id == 'foobarbaz')) || (!(&NAS-Port == 123456789)) || (!(&Framed-IP-Address == 192.0.2.1))) {
        test_fail
 }
 
@@ -18,9 +18,9 @@ update {
 }
 
 # All attributes should now of been removed
-if ((&Tmp-String-0 && (&Tmp-String-0 == 'foobarbaz')) || \
-       (&Tmp-Integer-0 && (&Tmp-Integer-0 == 123456789)) || \
-       (&Tmp-IP-Address-0 && (&Tmp-IP-Address-0 == 192.0.2.1))) {
+if ((&Filter-Id && (&Filter-Id == 'foobarbaz')) || \
+       (&NAS-Port && (&NAS-Port == 123456789)) || \
+       (&Framed-IP-Address && (&Framed-IP-Address == 192.0.2.1))) {
        test_fail
 }
 
index fb76eeab1e9d2b830c1cb58859534b741e30eb84..b02901833875d92561f12332440ea2486e449887 100644 (file)
@@ -2,13 +2,13 @@
 #  PRE: update
 #
 update control {
-       &Tmp-Integer-0 := 5
-       &Tmp-Integer-0 += 10
-       &Tmp-Integer-0 += 15
-       &Tmp-Integer-0 += 20
-       &Tmp-String-0 := 'foo'
-       &Tmp-String-0 += 'baz'
-       &Tmp-String-0 += 'boink'
+       &NAS-Port := 5
+       &NAS-Port += 10
+       &NAS-Port += 15
+       &NAS-Port += 20
+       &Filter-Id := 'foo'
+       &Filter-Id += 'baz'
+       &Filter-Id += 'boink'
 }
 
 # Reset the request list
@@ -22,18 +22,18 @@ update control {
 #  Integer ==
 #
 update request {
-       &Tmp-Integer-0 == 10
+       &NAS-Port == 10
 }
 
-if (!(&Tmp-Integer-0[0] == 10)) {
+if (!(&NAS-Port[0] == 10)) {
        test_fail
 }
 
-if (!(%{Tmp-Integer-0[#]} == 1)) {
+if (!(%{NAS-Port[#]} == 1)) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 3)) {
+if (!(%{Filter-Id[#]} == 3)) {
        test_fail
 }
 
@@ -44,14 +44,14 @@ if (!(%{Tmp-String-0[#]} == 3)) {
 #  String ==
 #
 update request {
-       &Tmp-String-0 == 'baz'
+       &Filter-Id == 'baz'
 }
 
-if (!(&Tmp-String-0[0] == 'baz')) {
+if (!(&Filter-Id[0] == 'baz')) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 1)) {
+if (!(%{Filter-Id[#]} == 1)) {
        test_fail
 }
 
@@ -62,18 +62,18 @@ if (!(%{Tmp-String-0[#]} == 1)) {
 #  Integer <
 #
 update request {
-       &Tmp-Integer-0 < 10
+       &NAS-Port < 10
 }
 
-if (!(&Tmp-Integer-0[0] == 5)) {
+if (!(&NAS-Port[0] == 5)) {
        test_fail
 }
 
-if (!(%{Tmp-Integer-0[#]} == 1)) {
+if (!(%{NAS-Port[#]} == 1)) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 3)) {
+if (!(%{Filter-Id[#]} == 3)) {
        test_fail
 }
 
@@ -84,23 +84,23 @@ if (!(%{Tmp-String-0[#]} == 3)) {
 #  Integer >
 #
 update request {
-       &Tmp-Integer-0 > 10
+       &NAS-Port > 10
 }
 
-if (!(&Tmp-Integer-0[0] == 15)) {
+if (!(&NAS-Port[0] == 15)) {
        test_fail
 }
 
-if (!(&Tmp-Integer-0[1] == 20)) {
+if (!(&NAS-Port[1] == 20)) {
        test_fail
 }
 
 
-if (!(%{Tmp-Integer-0[#]} == 2)) {
+if (!(%{NAS-Port[#]} == 2)) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 3)) {
+if (!(%{Filter-Id[#]} == 3)) {
        test_fail
 }
 
@@ -112,22 +112,22 @@ if (!(%{Tmp-String-0[#]} == 3)) {
 #  Integer <=
 #
 update request {
-       &Tmp-Integer-0 <= 10
+       &NAS-Port <= 10
 }
 
-if (!(&Tmp-Integer-0[0] == 5)) {
+if (!(&NAS-Port[0] == 5)) {
        test_fail
 }
 
-if (!(&Tmp-Integer-0[1] == 10)) {
+if (!(&NAS-Port[1] == 10)) {
        test_fail
 }
 
-if (!(%{Tmp-Integer-0[#]} == 2)) {
+if (!(%{NAS-Port[#]} == 2)) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 3)) {
+if (!(%{Filter-Id[#]} == 3)) {
        test_fail
 }
 
@@ -138,26 +138,26 @@ if (!(%{Tmp-String-0[#]} == 3)) {
 #  Integer >=
 #
 update request {
-       &Tmp-Integer-0 >= 10
+       &NAS-Port >= 10
 }
 
-if (!(&Tmp-Integer-0[0] == 10)) {
+if (!(&NAS-Port[0] == 10)) {
        test_fail
 }
 
-if (!(&Tmp-Integer-0[1] == 15)) {
+if (!(&NAS-Port[1] == 15)) {
        test_fail
 }
 
-if (!(&Tmp-Integer-0[2] == 20)) {
+if (!(&NAS-Port[2] == 20)) {
        test_fail
 }
 
-if (!(%{Tmp-Integer-0[#]} == 3)) {
+if (!(%{NAS-Port[#]} == 3)) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 3)) {
+if (!(%{Filter-Id[#]} == 3)) {
        test_fail
 }
 
@@ -168,26 +168,26 @@ if (!(%{Tmp-String-0[#]} == 3)) {
 #  Integer !=
 #
 update request {
-       &Tmp-Integer-0 != 10
+       &NAS-Port != 10
 }
 
-if (!(&Tmp-Integer-0[0] == 5)) {
+if (!(&NAS-Port[0] == 5)) {
        test_fail
 }
 
-if (!(&Tmp-Integer-0[1] == 15)) {
+if (!(&NAS-Port[1] == 15)) {
        test_fail
 }
 
-if (!(&Tmp-Integer-0[2] == 20)) {
+if (!(&NAS-Port[2] == 20)) {
        test_fail
 }
 
-if (!(%{Tmp-Integer-0[#]} == 3)) {
+if (!(%{NAS-Port[#]} == 3)) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 3)) {
+if (!(%{Filter-Id[#]} == 3)) {
        test_fail
 }
 
@@ -195,22 +195,22 @@ if (!(%{Tmp-String-0[#]} == 3)) {
 &request := &control
 
 update request {
-       &Tmp-String-1 := 'baz'
-       &Tmp-String-1 += 'boink'
+       &Callback-Id := 'baz'
+       &Callback-Id += 'boink'
 }
 
 #
 #  String (Intersection)
 #
 update request {
-       &Tmp-String-0 == &Tmp-String-1[0]
+       &Filter-Id == &Callback-Id[0]
 }
 
-if (!(&Tmp-String-0[0] == &Tmp-String-1[0])) {
+if (!(&Filter-Id[0] == &Callback-Id[0])) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 1)) {
+if (!(%{Filter-Id[#]} == 1)) {
        test_fail
 }
 
index 4299cf70c1fe08391c7a068d0a3abe9b59f8d5f4..fd9ae0ba3f5551c22d7801e0dfcc02a878d138b1 100644 (file)
@@ -8,11 +8,11 @@ update reply {
        #  This was parsed in the old edit code, but never did anything!
        #
        &Tmp-Group-0 := {       # ERROR
-               Tmp-String-0 = "foo"
+               Filter-Id = "foo"
        }
 }
 
-if !&reply.Tmp-Group-0.Tmp-String-0 {
+if !&reply.Tmp-Group-0.Filter-Id {
        test_fail
 }
 
index 36d10bbc05581ebb047a163d7c2b5cb4cf9aa999..148ddcd19a2fed9f47ecb98a8fec0cd2814466f1 100644 (file)
@@ -2,12 +2,11 @@
 #  PRE: update
 #
 update reply {
-#      &Tmp-String-0 := "foo"
 
        #
        #  This is a string, so it's NOT allowed.
        #
-       &Tmp-String-1 := { # ERROR
-               Tmp-String-2 := "1.0"
+       &Filter-Id := { # ERROR
+               Reply-Message := "1.0"
        }
 }
index 884ca5591c93f9955f058e24bea2b223c132acb7..bf22e41b43f457f19c33016bddac3dae44c9f7b9 100644 (file)
@@ -5,18 +5,18 @@
 #
 
 update {
-       &Tmp-String-0 := 0x626f62
+       &Filter-Id := 0x626f62
 }
 
-if (!(&Tmp-String-0 == 'bob')) {
+if (!(&Filter-Id == 'bob')) {
        test_fail
 }
 
 update {
-       &Tmp-String-0 := '0x626f62'
+       &Filter-Id := '0x626f62'
 }
 
-if (!(&Tmp-String-0 == '0x626f62')) {
+if (!(&Filter-Id == '0x626f62')) {
        test_fail
 }
 
index 8956c8be5023f176f3bdae6c120842c1f2c8888a..1e835da8e4b32877fa7009a449e66381ee9d6807 100644 (file)
@@ -4,9 +4,9 @@
 #  Form attribute references with xlats
 #
 update request {
-       &Tmp-String-0 += 'foo'
-       &Tmp-String-0 += 'bar'
-       &Tmp-String-1 += 'baz'
+       &Filter-Id += 'foo'
+       &Filter-Id += 'bar'
+       &Reply-Message += 'baz'
 
        #
        #  @fixme - EDIT - how the heck did this ever work?
@@ -14,7 +14,7 @@ update request {
        &control !* ANY
 }
 
-if (!(&Tmp-String-0[0] == 'foo')) {
+if (!(&Filter-Id[0] == 'foo')) {
        test_fail
 }
 
@@ -23,7 +23,7 @@ update {
        &request := &control
 }
 
-if (&Tmp-String-0 || &Tmp-String-1) {
+if (&Filter-Id || &Reply-Message) {
        test_fail
 }
 
index f59f18bd09efd11dda3eaedad07e7d2e2814d682..e99a3ad8f021810c1d1a0b7c893485c1385840ab 100644 (file)
@@ -4,12 +4,12 @@
 
 
 #
-#  Tmp-Octets-1 doesn't exist, so Tmp-Octets-0 shouldn't be created
+#  State doesn't exist, so Class shouldn't be created
 #
 update request {
-       &Tmp-Octets-0 := &Tmp-Octets-1
+       &Class := &State
 }
-if (&Tmp-Octets-0) {
+if (&Class) {
        test_fail
 }
 
@@ -18,12 +18,12 @@ if (&Tmp-Octets-0) {
 #
 #
 update request {
-       &Tmp-String-0 := "%{Reply-Message}"
+       &Filter-Id := "%{Reply-Message}"
 }
-if (!&Tmp-String-0) {
+if (!&Filter-Id) {
        test_fail
 }
-if (!(&Tmp-String-0 == '')) {
+if (!(&Filter-Id == '')) {
        test_fail
 }
 
@@ -33,9 +33,9 @@ if (!(&Tmp-String-0 == '')) {
 #  @fixme - EDIT - the new method is to simply omit the assignment
 #
 update request {
-       &Tmp-Octets-0 := "%{Reply-Message}"
+       &Class := "%{Reply-Message}"
 }
-if (!(&Tmp-Octets-0 == "")) {
+if (!(&Class == "")) {
        test_fail
 }
 
index 72d0005623d9d5ddc672ac1dfff0bd40d37a8564..e431a580fc5fb8fc3d670ecc8f3747c77bdd56ce 100644 (file)
@@ -4,41 +4,41 @@
 
 # Define initial test strings
 update control {
-       &Tmp-String-0 := 'foo'
-       &Tmp-String-0 += 'baz'
+       &Filter-Id := 'foo'
+       &Filter-Id += 'baz'
 }
 
 # Reset the request list and add the test strings
 # FIXME:
 # Temporary way to add multiple copies of an attribute - this should become
-# &Tmp-String-0 += &control.Tmp-String-0 when multi copies of attributes
+# &Filter-Id += &control.Filter-Id when multi copies of attributes
 # are copied again.  Currently the desired syntax won't work due to tmpl_t only holding
 # a single value_box - so when mapt_to_list_mod() builds the list of value for the rhs
 # of the expression only the first one is copied to the tmpl_t.  See around line 780
 # of map_async.c
 update {
-       &Tmp-String-0 !* ANY
-       &Tmp-String-0 += &control.Tmp-String-0[0]
-       &Tmp-String-0 += &control.Tmp-String-0[1]
+       &Filter-Id !* ANY
+       &Filter-Id += &control.Filter-Id[0]
+       &Filter-Id += &control.Filter-Id[1]
 }
 
 # Prepend a single value
 update request {
-       &Tmp-String-0 ^= 'boink'
+       &Filter-Id ^= 'boink'
 }
 
 # The prepended value should be first followed by the other two
-if (!((&Tmp-String-0[0] == 'boink')) || (!(&Tmp-String-0[1] == 'foo')) || (!(%{Tmp-String-0[2]} == 'baz'))) {
+if (!((&Filter-Id[0] == 'boink')) || (!(&Filter-Id[1] == 'foo')) || (!(%{Filter-Id[2]} == 'baz'))) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 3)) {
+if (!(%{Filter-Id[#]} == 3)) {
        test_fail
 }
 
 # Add an extra element to the start of control
 update control {
-       &Tmp-String-0 ^= 'wibble'
+       &Filter-Id ^= 'wibble'
 }
 
 # Prepend control to request
@@ -47,22 +47,22 @@ update {
 }
 
 # The attributes should now be "wibble", "foo", "baz", "boink", "foo", "baz"
-if (!((&Tmp-String-0[0] == 'wibble')) || (!(&Tmp-String-0[1] == 'foo')) || (!(%{Tmp-String-0[2]} == 'baz')) || (!(&Tmp-String-0[3] == 'boink')) || (!(&Tmp-String-0[4] == 'foo')) || (!(&Tmp-String-0[5] == 'baz'))) {
+if (!((&Filter-Id[0] == 'wibble')) || (!(&Filter-Id[1] == 'foo')) || (!(%{Filter-Id[2]} == 'baz')) || (!(&Filter-Id[3] == 'boink')) || (!(&Filter-Id[4] == 'foo')) || (!(&Filter-Id[5] == 'baz'))) {
        test_fail
 }
 
-if (!(%{Tmp-String-0[#]} == 6)) {
+if (!(%{Filter-Id[#]} == 6)) {
        test_fail
 }
 
 # Set up an attribute in control with a single value
 update control {
-       &Tmp-String-0 := 'initial'
+       &Filter-Id := 'initial'
 }
 
-# Prepend the list of Tmp-String-0 from request to the new attribute
+# Prepend the list of Filter-Id from request to the new attribute
 #update {
-#      &control.Tmp-String-0 ^= &Tmp-String-0
+#      &control.Filter-Id ^= &Filter-Id
 #}
 
 # (Temporary method to achieve the same - as per issue noted above)
@@ -71,11 +71,11 @@ update {
 }
 
 # The control attributes should now be "wibble", "foo", "baz", "boink", "foo", "baz", "initial"
-if (!((&control.Tmp-String-0[0] == 'wibble')) || (!(&control.Tmp-String-0[1] == 'foo')) || (!(&control.Tmp-String-0[2] == 'baz')) || (!(&control.Tmp-String-0[3] == 'boink')) || (!(&control.Tmp-String-0[4] == 'foo')) || (!(&control.Tmp-String-0[5] == 'baz')) || (!(&control.Tmp-String-0[6] == 'initial'))) {
+if (!((&control.Filter-Id[0] == 'wibble')) || (!(&control.Filter-Id[1] == 'foo')) || (!(&control.Filter-Id[2] == 'baz')) || (!(&control.Filter-Id[3] == 'boink')) || (!(&control.Filter-Id[4] == 'foo')) || (!(&control.Filter-Id[5] == 'baz')) || (!(&control.Filter-Id[6] == 'initial'))) {
        test_fail
 }
 
-if (!(%{control.Tmp-String-0[#]} == 7)) {
+if (!(%{control.Filter-Id[#]} == 7)) {
        test_fail
 }
 
index f8c6d7f8844dfcb0d79811d4c7215f02f67e44b1..c6d4bdc1f6fa44f2cadd76a6b98c70a8c8ddc4ae 100644 (file)
@@ -2,45 +2,45 @@
 # PRE: update
 #
 update {
-       &Tmp-String-0 := 'foobarbaz'
-       &Tmp-Integer-0 := 123456789
-       &Tmp-IP-Address-0 := 192.0.2.1
-       &Tmp-IP-Address-0 += 192.0.2.2
-       &control.Tmp-IP-Address-0 := 192.0.2.1
-       &control.Tmp-IP-Address-0 += 192.0.2.3
-       &control.Tmp-IP-Address-1 := 192.0.3.1
+       &Filter-Id := 'foobarbaz'
+       &NAS-Port := 123456789
+       &Framed-IP-Address := 192.0.2.1
+       &Framed-IP-Address += 192.0.2.2
+       &control.Framed-IP-Address := 192.0.2.1
+       &control.Framed-IP-Address += 192.0.2.3
+       &control.Login-IP-Host := 192.0.3.1
 }
 
-if (!((&Tmp-IP-Address-0[0] == 192.0.2.1)) || (!(&Tmp-IP-Address-0[1] == 192.0.2.2))) {
+if (!((&Framed-IP-Address[0] == 192.0.2.1)) || (!(&Framed-IP-Address[1] == 192.0.2.2))) {
        test_fail
 }
 
 # Remove all attributes in the request list
 update {
-       &Tmp-IP-Address-0 !* ANY
+       &Framed-IP-Address !* ANY
 }
 
-# Non Tmp-IP-Address-0 address attributes should still be in the request list
-if (!((&Tmp-String-0 == 'foobarbaz')) || (!(&Tmp-Integer-0 == 123456789))) {
+# Non Framed-IP-Address address attributes should still be in the request list
+if (!((&Filter-Id == 'foobarbaz')) || (!(&NAS-Port == 123456789))) {
        test_fail
 }
 
-# There should be no Tmp-IP-Address attributes in the request list
-if (&Tmp-IP-Address-0) {
+# There should be no Framed-IP-Address attributes in the request list
+if (&Framed-IP-Address) {
        test_fail
 }
 
 # But there should still be some in the control list
-if (!((&control.Tmp-IP-Address-0 == 192.0.2.1)) || (!(&control.Tmp-IP-Address-0[1] == 192.0.2.3))) {
+if (!((&control.Framed-IP-Address == 192.0.2.1)) || (!(&control.Framed-IP-Address[1] == 192.0.2.3))) {
        test_fail
 }
 
 update {
-       &control.Tmp-IP-Address-0 !* ANY
-       &control.Tmp-IP-Address-1 !* ANY
+       &control.Framed-IP-Address !* ANY
+       &control.Login-IP-Host !* ANY
 }
 
-if (&control.Tmp-IP-Address-0 || &control.Tmp-IP-Address-1) {
+if (&control.Framed-IP-Address || &control.Login-IP-Host) {
        test_fail
 }
 
index 25188d4b6e68c32ca5c53c0569c424aa0e79b601..9b43a096d63865f833d397644570fdfbbf8509fc 100644 (file)
@@ -3,12 +3,12 @@
 #
 
 update request {
-       &Tmp-String-0 := 'foobarbaz'
-       &Tmp-Integer-0 := 123456789
-       &Tmp-IP-Address-0 := 192.0.2.1
+       &Filter-Id := 'foobarbaz'
+       &NAS-Port := 123456789
+       &Framed-IP-Address := 192.0.2.1
 }
 
-if (!((&Tmp-String-0 == 'foobarbaz')) || (!(&Tmp-Integer-0 == 123456789)) || (!(&Tmp-IP-Address-0 == 192.0.2.1))) {
+if (!((&Filter-Id == 'foobarbaz')) || (!(&NAS-Port == 123456789)) || (!(&Framed-IP-Address == 192.0.2.1))) {
        test_fail
 }
 
@@ -18,9 +18,9 @@ update {
 }
 
 # All attributes should now of been removed
-if ((&Tmp-String-0 && (&Tmp-String-0 == 'foobarbaz')) || \
-       (&Tmp-Integer-0 && (&Tmp-Integer-0 == 123456789)) || \
-       (&Tmp-IP-Address-0 && (&Tmp-IP-Address-0 == 192.0.2.1))) {
+if ((&Filter-Id && (&Filter-Id == 'foobarbaz')) || \
+       (&NAS-Port && (&NAS-Port == 123456789)) || \
+       (&Framed-IP-Address && (&Framed-IP-Address == 192.0.2.1))) {
        test_fail
 }
 
index 8f045002e832e532c880965f9168cc9de3cea38f..3b5e83452e662fbdcd9f2191b5ae50f2437e6b82 100644 (file)
@@ -3,94 +3,94 @@
 #
 
 update {
-       &Tmp-String-0 := 'foobarbaz'
-       &Tmp-Integer-0 := 123456789
-       &Tmp-IP-Address-0 := 192.0.2.1
-       &Tmp-IP-Address-0 += 192.0.2.2
-       &Tmp-IP-Address-0 += 192.0.2.3
-       &Tmp-IP-Address-0 += 192.0.2.4
-       &control.Tmp-IP-Address-0 := 192.0.2.1
-       &control.Tmp-IP-Address-0 += 192.0.2.3
+       &Filter-Id := 'foobarbaz'
+       &NAS-Port := 123456789
+       &Framed-IP-Address := 192.0.2.1
+       &Framed-IP-Address += 192.0.2.2
+       &Framed-IP-Address += 192.0.2.3
+       &Framed-IP-Address += 192.0.2.4
+       &control.Framed-IP-Address := 192.0.2.1
+       &control.Framed-IP-Address += 192.0.2.3
 }
 
-if (!((&Tmp-IP-Address-0[0] == 192.0.2.1)) || \
-       (!(&Tmp-IP-Address-0[1] == 192.0.2.2)) || \
-       (!(&Tmp-IP-Address-0[2] == 192.0.2.3)) || \
-       (!(&Tmp-IP-Address-0[3] == 192.0.2.4))) {
+if (!((&Framed-IP-Address[0] == 192.0.2.1)) || \
+       (!(&Framed-IP-Address[1] == 192.0.2.2)) || \
+       (!(&Framed-IP-Address[2] == 192.0.2.3)) || \
+       (!(&Framed-IP-Address[3] == 192.0.2.4))) {
        test_fail
 }
 
-# Remove Tmp-IP-Address-0 with a specific value
+# Remove Framed-IP-Address with a specific value
 update {
-       &Tmp-IP-Address-0 -= 192.0.2.1
+       &Framed-IP-Address -= 192.0.2.1
 }
 
-# Only the 2nd, 3rd and 4th Tmp-IP-Address attributes should still be in the list
-if (!((&Tmp-IP-Address-0[0] == 192.0.2.2)) || \
-       (!(&Tmp-IP-Address-0[1] == 192.0.2.3)) || \
-       (!(&Tmp-IP-Address-0[2] == 192.0.2.4)) || \
-       (&Tmp-IP-Address-0[3])) {
+# Only the 2nd, 3rd and 4th Framed-IP-Address attributes should still be in the list
+if (!((&Framed-IP-Address[0] == 192.0.2.2)) || \
+       (!(&Framed-IP-Address[1] == 192.0.2.3)) || \
+       (!(&Framed-IP-Address[2] == 192.0.2.4)) || \
+       (&Framed-IP-Address[3])) {
        test_fail
 }
 
-# Remove Tmp-IP-Address-0 with a specific value (somewhere in the middle)
+# Remove Framed-IP-Address with a specific value (somewhere in the middle)
 update {
-       &Tmp-IP-Address-0 -= 192.0.2.3
+       &Framed-IP-Address -= 192.0.2.3
 }
 
-# Only the 1st, and 3rd Tmp-IP-Address attributes should still be in the list
-if (!((&Tmp-IP-Address-0[0] == 192.0.2.2)) || \
-       (!(&Tmp-IP-Address-0[1] == 192.0.2.4)) || \
-       (&Tmp-IP-Address-0[2])) {
+# Only the 1st, and 3rd Framed-IP-Address attributes should still be in the list
+if (!((&Framed-IP-Address[0] == 192.0.2.2)) || \
+       (!(&Framed-IP-Address[1] == 192.0.2.4)) || \
+       (&Framed-IP-Address[2])) {
        test_fail
 }
 
-# Remove Tmp-IP-Address-0 with a specific value (which doesn't exist)
+# Remove Framed-IP-Address with a specific value (which doesn't exist)
 update {
-       &Tmp-IP-Address-0 -= 192.0.2.3
+       &Framed-IP-Address -= 192.0.2.3
 }
 
-# Only the 1st, and 3rd Tmp-IP-Address attributes should still be in the list
-if (!((&Tmp-IP-Address-0[0] == 192.0.2.2)) || \
-       (!(&Tmp-IP-Address-0[1] == 192.0.2.4)) || \
-       (&Tmp-IP-Address-0[2])) {
+# Only the 1st, and 3rd Framed-IP-Address attributes should still be in the list
+if (!((&Framed-IP-Address[0] == 192.0.2.2)) || \
+       (!(&Framed-IP-Address[1] == 192.0.2.4)) || \
+       (&Framed-IP-Address[2])) {
        test_fail
 }
 
-# Remove Tmp-IP-Address-4 (which doesn't exist - more to check for SEGV/assert)
+# Remove NAS-IP-Address (which doesn't exist - more to check for SEGV/assert)
 update {
-       &Tmp-IP-Address-4 -= 192.0.2.3
+       &NAS-IP-Address -= 192.0.2.3
 }
 
-# Remove Tmp-IP-Address-0 with a specific value
+# Remove Framed-IP-Address with a specific value
 update {
-       &Tmp-IP-Address-0 -= 192.0.2.4
+       &Framed-IP-Address -= 192.0.2.4
 }
 
-# Only the 1st, and 3rd Tmp-IP-Address attributes should still be in the list
-if (!((&Tmp-IP-Address-0[0] == 192.0.2.2)) || \
-       (&Tmp-IP-Address-0[1])) {
+# Only the 1st, and 3rd Framed-IP-Address attributes should still be in the list
+if (!((&Framed-IP-Address[0] == 192.0.2.2)) || \
+       (&Framed-IP-Address[1])) {
        test_fail
 }
 
-# Remove Tmp-IP-Address-0 with a specific value
+# Remove Framed-IP-Address with a specific value
 update {
-       &Tmp-IP-Address-0 -= 192.0.2.2
+       &Framed-IP-Address -= 192.0.2.2
 }
 
-# Only the 1st, and 3rd Tmp-IP-Address attributes should still be in the list
-#  and the Tmp-IP-Addres-0 attribute should be deleted
-if (&Tmp-IP-Address-0) {
+# Only the 1st, and 3rd Framed-IP-Address attributes should still be in the list
+#  and the Framed-IP-Addres-0 attribute should be deleted
+if (&Framed-IP-Address) {
        test_fail
 }
 
-# Non Tmp-IP-Address-0 address attributes should still be in the request list
-if (!((&Tmp-String-0 == 'foobarbaz')) || (!(&Tmp-Integer-0 == 123456789))) {
+# Non Framed-IP-Address address attributes should still be in the request list
+if (!((&Filter-Id == 'foobarbaz')) || (!(&NAS-Port == 123456789))) {
        test_fail
 }
 
 # But there should still be some in the control list
-if (!((&control.Tmp-IP-Address-0[0] == 192.0.2.1)) || (!(&control.Tmp-IP-Address-0[1] == 192.0.2.3))) {
+if (!((&control.Framed-IP-Address[0] == 192.0.2.1)) || (!(&control.Framed-IP-Address[1] == 192.0.2.3))) {
        test_fail
 }
 
index 586d93277d51b8a1e7418b15dbdf796f3b55cb45..700cf5ddce85ff6bf3adc9ebb9bb7c46c2da2fd4 100644 (file)
@@ -1,46 +1,46 @@
-&Tmp-String-0 := "foo"
+&Filter-Id := "foo"
 
 update request {
-       &Tmp-String-0 !* ANY
+       &Filter-Id !* ANY
 }
 
-if (&Tmp-String-0) {
+if (&Filter-Id) {
        test_fail
 }
 
-&Tmp-String-0 := "foo"
-&reply.Tmp-String-0 := "bar"
+&Filter-Id := "foo"
+&reply.Filter-Id := "bar"
 
 update {
-       &request.Tmp-String-0 !* ANY
+       &request.Filter-Id !* ANY
        &reply.[*] !* ANY
 }
 
-if (&Tmp-String-0) {
+if (&Filter-Id) {
        test_fail
 }
 
-if (&reply.Tmp-String-0) {
+if (&reply.Filter-Id) {
        test_fail
 }
 
 update reply {
-       &Tmp-Integer-0 := 12
+       &NAS-Port := 12
 }
 
-if (!&reply.Tmp-Integer-0) {
+if (!&reply.NAS-Port) {
        test_fail
 }
 
 update reply {
-       &Tmp-Integer-0 += 13
+       &NAS-Port += 13
 }
 
-if (!(&reply.Tmp-Integer-0[0] == 12)) {
+if (!(&reply.NAS-Port[0] == 12)) {
        test_fail
 }
 
-if (!(&reply.Tmp-Integer-0[1] == 13)) {
+if (!(&reply.NAS-Port[1] == 13)) {
        test_fail
 }
 
index 575f48ea568627508d423573bf137411cc2ebe9e..584f7d2fe75eac8a8000c1989f3c52a19bb81055 100644 (file)
@@ -1,55 +1,54 @@
 #
 # PRE: if
 #
-&request += {
-       # Some encoders replace ~ with %7E RFC3986 Section 2.4 says this should not be done.
-       &Tmp-String-0 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.~'
-       &Tmp-String-2 = '±§!@#$%^&*()+={[}]:;"\'|\<,>?/`'
-       &Tmp-String-4 = '™œ¥¤'
-       &Tmp-String-6 = '%C2%B1%C2%A7%21%40%23%24%25%5E%26%2A%28%29%2B%3D%7B%5B%7D%5D%3A%3B%22%27%7C%5C%3C%2C%3E%3F%2F%60'
-       &Tmp-String-8 = '%E2%84%A2%C5%93%C2%A5%C2%A4'
-}
-
-&request += {
-       &Tmp-String-1 = "%urlquote(%{Tmp-String-0})"
-       &Tmp-String-3 = "%urlquote(%{Tmp-String-2})"
-       &Tmp-String-5 = "%urlquote(%{Tmp-String-4})"
-       &Tmp-String-7 = "%urlunquote(%{Tmp-String-6})"
-       &Tmp-String-9 = "%urlunquote(%{Tmp-String-8})"
-}
-
-
-if (!(&Tmp-String-1 == &Tmp-String-0)) {
+string test_string1
+string test_string2
+string test_string3
+string encoded_string2
+string encoded_string3
+string result_string
+
+# Some encoders replace ~ with %7E RFC3986 Section 2.4 says this should not be done.
+&test_string1 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.~'
+&test_string2 = '±§!@#$%^&*()+={[}]:;"\'|\<,>?/`'
+&test_string3 = '™œ¥¤'
+&encoded_string2 := '%C2%B1%C2%A7%21%40%23%24%25%5E%26%2A%28%29%2B%3D%7B%5B%7D%5D%3A%3B%22%27%7C%5C%3C%2C%3E%3F%2F%60'
+&encoded_string3 := '%E2%84%A2%C5%93%C2%A5%C2%A4'
+
+&result_string = "%urlquote(%{test_string1})"
+if (!(&result_string == &test_string1)) {
        test_fail
 }
 
-if (!(&Tmp-String-3 == &Tmp-String-6)) {
+&result_string := "%urlunquote(%{test_string1})"
+if (!(&result_string == &test_string1)) {
        test_fail
 }
 
-if (!(&Tmp-String-5 == &Tmp-String-8)) {
+&result_string := "%urlquote(%{test_string2})"
+if (!(&result_string == &encoded_string2)) {
        test_fail
 }
 
-if (!(&Tmp-String-7 == &Tmp-String-2)) {
+&result_string := "%urlquote(%{test_string3})"
+if (!(&result_string == &encoded_string3)) {
        test_fail
 }
 
-if (!(&Tmp-String-9 == &Tmp-String-4)) {
+&result_string := "%urlunquote(%{encoded_string2})"
+if (!(&result_string == &test_string2)) {
        test_fail
 }
 
-&Tmp-String-1 := "%urlunquote(%{Tmp-String-0})"
-
-&request -= &Tmp-String-2[*]
-&Tmp-String-2 := "%urlunquote(%%E,123)"
-
-if (!(&Tmp-String-1 == &Tmp-String-0)) {
+&result_string := "%urlunquote(%{encoded_string3})"
+if (!(&result_string == &test_string3)) {
        test_fail
 }
 
+&result_string := "%urlunquote(%%E,123)"
+
 # Test decoding invalid encoded string
-if !(&Tmp-String-2 == "") {
+if !(&result_string == "") {
        test_fail
 }
 
index 65dca9a515a36f9c9953465e8f153cf80cdb9d7c..26f950b14c7e8ad028babfe35051d0b7cdbc337a 100644 (file)
@@ -1,64 +1,62 @@
 #
 # PRE:
 #
+string result_string
 
-&Tmp-String-0 := "foo"
-&Tmp-String-1 := "bar"
+&Filter-Id := "foo"
+&NAS-Identifier := "bar"
 
 #
 #  First choice
 #
-&Tmp-String-2 := "%{&Tmp-String-0 || &Tmp-String-1}"
-if (!(&Tmp-String-2 == 'foo')) {
+&result_string := "%{&Filter-Id || &NAS-Identifier}"
+if (!(&result_string == 'foo')) {
        test_fail
 }
 
 #
 #  Second choice
 #
-&request -= &Tmp-String-0[*]
-&Tmp-String-2 := "%{&Tmp-String-0 || &Tmp-String-1}"
-if (!(&Tmp-String-2 == 'bar')) {
+&request -= &Filter-Id[*]
+&result_string := "%{&Filter-Id || &NAS-Identifier}"
+if (!(&result_string == 'bar')) {
        test_fail
 }
 
 #
 #  Multiple things in an alternation
 #
-&Tmp-String-2 := %{%{Tmp-String-0} || "%{Tmp-String-1} foo"}
-if (!(&Tmp-String-2 == 'bar foo')) {
+&result_string := %{%{Filter-Id} || "%{NAS-Identifier} foo"}
+if (!(&result_string == 'bar foo')) {
        test_fail
 }
 
 #
 #  Alternation is empty
 #
-&Tmp-String-2 := "%{&Tmp-String-0 || ''}"
-if (!(&Tmp-String-2 == '')) {
+&result_string := "%{&Filter-Id || ''}"
+if (!(&result_string == '')) {
        test_fail
 }
 
 #
 #  Everything null
 #
-&request -= &Tmp-String-1[*]
-&request -= &Tmp-String-2[*]
+&request -= &NAS-Identifier[*]
 
 #
 #  Both sides are failing, so the assignment returns a NULL string
 #
-&Tmp-String-2 := "%{&Tmp-String-0 || &Tmp-String-1}"
-if (!(&Tmp-String-2 == "")) {
+&result_string := "%{&Filter-Id || &NAS-Identifier}"
+if (!(&result_string == "")) {
        test_fail
 }
 
 #
 #  And unquoted results return nothing.
 #
-&request -= &Tmp-String-2[*]
-
-&Tmp-String-2 := %{&Tmp-String-0 || &Tmp-String-1}
-if (&Tmp-String-2) {
+&result_string := %{&Filter-Id || &NAS-Identifier}
+if (&result_string) {
        test_fail
 }
 
index a4acb78f349f321ba113dbca9505c7772d090757..c1697b0c2fdf4539403d678f7cb618b27216186f 100644 (file)
@@ -1,9 +1,10 @@
 #
 #  Everything null
 #
-&request -= &Tmp-String-0[*]
-&request -= &Tmp-String-1[*]
+string result_string
+&request -= &Filter-Id[*]
+&request -= &NAS-Identifier[*]
 
-&Tmp-String-2 := "%{&Tmp-String-0[0] || &Tmp-String-1[0]}%delay_10s()"
+&result_string := "%{&Filter-Id[0] || &NAS-Identifier[0]}%delay_10s()"
 
 success
index 3078a2f3f28a1113cd464baff7a4657900dd7276..db717b805c4d857b60feba6b4e76a2eecd63b2b4 100644 (file)
@@ -1,31 +1,34 @@
 #
 # PRE:
 #
+string test_string1
+string test_string2
+string dummy_string
 
-&Tmp-String-0 := "foo"
-&Tmp-String-1 := "bar"
+&test_string1 := "foo"
+&test_string2 := "bar"
 
-if (!(%{%test.passthrough(%{Tmp-String-0}) || %{Tmp-String-1}} == 'foo')) {
+if (!(%{%test.passthrough(%{test_string1}) || %{test_string2}} == 'foo')) {
        test_fail
 }
 
-if (!(%{%test.passthrough(%{Tmp-String-2}) || %{Tmp-String-1}} == 'bar')) {
+if (!(%{%test.passthrough(%{dummy_string}) || %{test_string2}} == 'bar')) {
        test_fail
 }
 
-if (!(%{%{Tmp-String-0} || %test.passthrough(%{Tmp-String-1})} == 'foo')) {
+if (!(%{%{test_string1} || %test.passthrough(%{test_string2})} == 'foo')) {
        test_fail
 }
 
-if (!(%{%{Tmp-String-2} || %test.passthrough(%{Tmp-String-1})} == 'bar')) {
+if (!(%{%{dummy_string} || %test.passthrough(%{test_string2})} == 'bar')) {
        test_fail
 }
 
-if (!(%{%test.passthrough(%{Tmp-String-0}) || %test.passthrough(%{Tmp-String-1})} == 'foo')) {
+if (!(%{%test.passthrough(%{test_string1}) || %test.passthrough(%{test_string2})} == 'foo')) {
        test_fail
 }
 
-if (!(%{%test.passthrough(%{Tmp-String-2}) || %test.passthrough(%{Tmp-String-1})} == 'bar')) {
+if (!(%{%test.passthrough(%{dummy_string}) || %test.passthrough(%{test_string2})} == 'bar')) {
        test_fail
 }
 
index bdbc1d238badc52bc3831bc953726908a6cec539..b403ec3d31b5d8738b2348aee4bc841edba56e94 100644 (file)
@@ -1,33 +1,33 @@
 &request += {
-       &Tmp-IP-Address-0 = 192.0.2.1
-       &Tmp-IP-Address-0 = 192.0.2.2
+       &Framed-IP-Address = 192.0.2.1
+       &Framed-IP-Address = 192.0.2.2
 }
-if (!(%{Tmp-IP-Address-0[#]} == 2)) {
+if (!(%{Framed-IP-Address[#]} == 2)) {
        test_fail
 }
 
-if (!((&Tmp-IP-Address-0[0] == 192.0.2.1)) || (!(&Tmp-IP-Address-0[1] == 192.0.2.2))) {
+if (!((&Framed-IP-Address[0] == 192.0.2.1)) || (!(&Framed-IP-Address[1] == 192.0.2.2))) {
        test_fail
 }
 
-if (!("%{Tmp-IP-Address-0[*]}" == '192.0.2.1192.0.2.2')) {
+if (!("%{Framed-IP-Address[*]}" == '192.0.2.1192.0.2.2')) {
        test_fail
 }
 
 # Try calling these xlats in mapping too, they may get optimised to VPTs which is a
 # different code path.
 &request += {
-       &Tmp-IP-Address-1 = &Tmp-IP-Address-0[1]
-       &Tmp-IP-Address-1 = &Tmp-IP-Address-0[0]
-       &Tmp-String-0 = "%concat(%{Tmp-IP-Address-0[*]}, ',')"
-       &Tmp-Integer-0 = %{Tmp-IP-Address-0[#]}
+       &NAS-IP-Address = &Framed-IP-Address[1]
+       &NAS-IP-Address = &Framed-IP-Address[0]
+       &Filter-Id = "%concat(%{Framed-IP-Address[*]}, ',')"
+       &NAS-Port = %{Framed-IP-Address[#]}
 }
 
-if (!(&Tmp-String-0 == '192.0.2.1,192.0.2.2')) {
+if (!(&Filter-Id == '192.0.2.1,192.0.2.2')) {
        test_fail
 }
 
-if (!(&Tmp-Integer-0 == 2)) {
+if (!(&NAS-Port == 2)) {
        test_fail
 }
 
index 93ebc005f614afa8248387dbaf946fa9c3d743e5..ec0fa3479c3d7bb648a2221d8ad59b2a9b250fdd 100644 (file)
@@ -1,11 +1,11 @@
 &request += {
-       &Tmp-IP-Address-0 = 192.0.2.1
-       &Tmp-IP-Address-0 = 192.0.2.2
-       &Tmp-IP-Address-0 = 192.0.2.3
-       &Tmp-IP-Address-0 = 192.0.2.4
+       &Framed-IP-Address = 192.0.2.1
+       &Framed-IP-Address = 192.0.2.2
+       &Framed-IP-Address = 192.0.2.3
+       &Framed-IP-Address = 192.0.2.4
 }
 
-if (%{Tmp-IP-Address-0[#]} != 4) {
+if (%{Framed-IP-Address[#]} != 4) {
        test_fail
 }
 
@@ -16,7 +16,7 @@ if (%{Tmp-IP-Address-0[#]} != 4) {
 #  for the existence of the attribute.  But... the syntax allows it, so
 #  it should work.
 #
-if !("%{Tmp-IP-Address-0[4]}" == '') {
+if !("%{Framed-IP-Address[4]}" == '') {
        test_fail
 }
 
index ab7dcf3b56da06b0002e85705feb198877710013..ef502d056b633dd902da5ad9e45d2fd47e0a9dd8 100644 (file)
@@ -1,16 +1,18 @@
 #
 # PRE: if
 #
+string result_string
+uint32 result_integer
 
-&Tmp-String-0 := "%config(modules.test.boolean)"
-if (!(&Tmp-String-0 == "no")) {
+&result_string := "%config(modules.test.boolean)"
+if (!(&result_string == "no")) {
        test_fail
 }
 
-&Tmp-String-0 := "test"
-&Tmp-Integer-0 := %config(modules.%{Tmp-String-0}.integer)
-if (!(&Tmp-Integer-0 == 1)) {
+&result_string := "test"
+&result_integer := %config(modules.%{result_string}.integer)
+if (!(&result_integer == 1)) {
        test_fail
 }
 
-success
\ No newline at end of file
+success
index bd6ff59fdf47ebd97f33096917f7b4b0697cf058..1bb59d9e798ec25e33573910ad264171f660aa9d 100644 (file)
@@ -1,20 +1,21 @@
 #
 # PRE: update
 #
+float32 result_float
 
 # This is mainly a smoke test... i.e. if it crashes there's smoke
 
 %delay_10s()   # Should 'blip' the request
 
-&Tmp-Float-0 := %delay_10s(0.1)
-if (!&Tmp-Float-0) {
+&result_float := %delay_10s(0.1)
+if (!&result_float) {
        fail
 }
 
 #
 # Check the delay was ~100ms
 #
-if (&Tmp-Float-0 < 0.1) {
+if (&result_float < 0.1) {
        fail
 }
 
index f06b186239ef8691367112266524b06982aa1c2c..b9565618e96ae4c00402ed2958489cbf4df4c940 100644 (file)
@@ -1,11 +1,12 @@
 #
 # PROTOCOL: dhcpv4
 #
+octets test_octets
 
-&Tmp-Octets-0 := 0x520d0103abcdef0206010203040506
+&test_octets := 0x520d0103abcdef0206010203040506
 
 # the protocol decoder puts the attributes into a flat namespace
-if (!(%dhcpv4.decode(%{Tmp-Octets-0}) == 1)) {
+if (!(%dhcpv4.decode(%{test_octets}) == 1)) {
        test_fail
 }
 
@@ -20,9 +21,9 @@ if !(&Relay-Agent-Information.Remote-Id == 0x010203040506) {
 #
 #  Encode all of the Relay-Agent-Information suboptions
 #
-&Tmp-Octets-1 := %dhcpv4.encode(&request.Relay-Agent-Information.[*])
+&test_octets := %dhcpv4.encode(&request.Relay-Agent-Information.[*])
 
-if !(&Tmp-Octets-1 == 0x520d0103abcdef0206010203040506) {
+if !(&test_octets == 0x520d0103abcdef0206010203040506) {
        test_fail
 }
 
index a883c9866d3a33df0694080f1222246cb2bc7da4..7138d646b77796efa55305e7cc6756b6ce573403 100644 (file)
@@ -1,6 +1,8 @@
 # Regression test for double consecutive alternations
-&Tmp-uint64-0 := "%{&Acct-Input-Octets || "2"}%{&Acct-Input-Gigawords || "1"}"
-if (!(&Tmp-uint64-0 == 21)) {
+uint64 result_int64
+
+&result_int64 := "%{&Acct-Input-Octets || "2"}%{&Acct-Input-Gigawords || "1"}"
+if (!(&result_int64 == 21)) {
        test_fail
 }
 
index a5bd870088f599cdfbd8369ca80eb6362e086dd0..e48806969c6290c55fa302dd19e1c489e7c502f0 100644 (file)
@@ -1,35 +1,35 @@
 &request += {
-       &Tmp-String-1  = 'foo'
-       &Tmp-String-1  = 'bar'
-       &Tmp-Integer-0 = '4'
-       &Tmp-Integer-0 = '8'
-       &Tmp-Integer-0 = '1'
+       &Filter-Id  = 'foo'
+       &Filter-Id  = 'bar'
+       &NAS-Port = '4'
+       &NAS-Port = '8'
+       &NAS-Port = '1'
 
-       &Tmp-String-0 = '%{Tmp-String-1}'
+       &Reply-Message = '%{Filter-Id}'
 }
 
 #
 #  Verify non string types are treated as literals
 #
-if (!("%eval(%{Tmp-Integer-0})" == 4)) {
+if (!("%eval(%{NAS-Port})" == 4)) {
        test_fail
 }
 
-if (!(%eval(%{Tmp-Integer-0[1]}) == 8)) {
+if (!(%eval(%{NAS-Port[1]}) == 8)) {
        test_fail
 }
 
 #
 #  Check double expansion works
 #
-if (!(%eval(%{Tmp-String-0}) == 'foo')) {
+if (!(%eval(%{Reply-Message}) == 'foo')) {
        test_fail
 }
 
 #
 #  Using an attribute as a dynamic index for another attribute
 #
-if (!(%eval("\%{Tmp-String-1[%{Tmp-Integer-0[2]}]}") == 'bar')) {
+if (!(%eval("\%{Filter-Id[%{NAS-Port[2]}]}") == 'bar')) {
        test_fail
 }
 
@@ -49,7 +49,7 @@ group {
 
        &idx := 1
 
-       if (!(%eval("\%{Tmp-String-1[%{idx}]}") == 'bar')) {
+       if (!(%eval("\%{Filter-Id[%{idx}]}") == 'bar')) {
                test_fail
        }
 
index e8467fc10f36a396cf658ebba5b3a6b38a996bed..41292107b9e97f655c14e8e62b887e5f3b1b8496 100644 (file)
@@ -1,18 +1,21 @@
-&Tmp-String-0 = "foo"
-&Tmp-String-1 := %exec('/bin/echo', "hello 1234:%{Tmp-String-0} world")
+string test_string
+string result_string
 
-if (!(&Tmp-String-1 == "hello 1234:foo world")) {
+&test_string = "foo"
+&result_string := %exec('/bin/echo', "hello 1234:%{test_string} world")
+
+if (!(&result_string == "hello 1234:foo world")) {
        test_fail
 }
 
-&Tmp-String-1 := %exec('/bin/echo', "hello %{Tmp-String-0}:1234 world")
-if (!(&Tmp-String-1 == "hello foo:1234 world")) {
+&result_string := %exec('/bin/echo', "hello %{test_string}:1234 world")
+if (!(&result_string == "hello foo:1234 world")) {
        test_fail
 }
 
 # User-Password contains characters that need escaping
-&Tmp-String-2 := %exec('/bin/echo', "%{User-Password}")
-if (!(&Tmp-String-2 == &User-Password)) {
+&result_string := %exec('/bin/echo', "%{User-Password}")
+if (!(&result_string == &User-Password)) {
        test_fail
 } else {
        &User-Password := "hello"
index 8c551557c2b5226eaf2ae5a3c7834d04d57b9f26..7b8d775180a608e5dbbf42804bb2421771c33b59 100644 (file)
@@ -3,6 +3,8 @@
 #
 #  Check explode works correctly
 #
+string result_string
+
 &request += {
        &Class = '1=1|my_attr=2|my_attr=hello|'
        &Calling-Station-ID = '|'
        &User-Name = '|hello|goodbye'
        &User-Name = '|morning|night|1|'
        &Reply-Message = 'Can\'t touch this'
-       &Tmp-String-0 = 'here.  are . some.  words. '
+       &Filter-Id = 'here.  are . some.  words. '
 }
 
-&request += {
-       &Tmp-String-1 = "%concat(%explode(%{Class}, '|'), ',')"
-       &Tmp-String-2 = "%concat(%explode(%{Calling-Station-ID}, '|'), ',')"
-       &Tmp-String-3 = "%concat(%explode(%{control.User-Name[*]}, |), ',')"
-       &Tmp-String-4 = "%concat(%explode(%{control.Reply-Message}, |), ',')"
-       &Tmp-String-5 = "%concat(%explode(%{control.Tmp-String-0}, '. '), ',')"
-}
-
-debug_all
-
-if (!(&Tmp-String-1 == "1=1,my_attr=2,my_attr=hello")) {
+&result_string := "%concat(%explode(%{Class}, '|'), ',')"
+if (!(&result_string == "1=1,my_attr=2,my_attr=hello")) {
        test_fail
 }
 
-if (!(&Tmp-String-2 == "")) {
+&result_string := "%concat(%explode(%{Calling-Station-ID}, '|'), ',')"
+if (!(&result_string == "")) {
        test_fail
 }
 
-if (!(&Tmp-String-3 == "hello,goodbye,morning,night,1")) {
+&result_string := "%concat(%explode(%{control.User-Name[*]}, |), ',')"
+if (!(&result_string == "hello,goodbye,morning,night,1")) {
        test_fail
 }
 
-if !(&Tmp-String-4 == 'Can\'t touch this') {
+&result_string := "%concat(%explode(%{control.Reply-Message}, |), ',')"
+if !(&result_string == 'Can\'t touch this') {
        test_fail
 }
 
-if !(&Tmp-String-5 == 'here, are ,some, words') {
+&result_string := "%concat(%explode(%{control.Filter-Id}, '. '), ',')"
+if !(&result_string == 'here, are ,some, words') {
        test_fail
 }
 
index 3a2f92da9cc667ace5ead7b929e373a65bab4c11..4194810f6010693d50ff8093e34811a17c24a5cc 100644 (file)
@@ -1,16 +1,18 @@
 # Set debug to something high, recording the old level
-&Tmp-Integer-0 := "%debug(4)"
+uint32 test_integer
+
+&test_integer := %debug(4)
 
 # Check debug level is now 4
-if (!("%debug(4)" == 4)) {
+if (!(%debug(4) == 4)) {
        test_fail
 }
 
 # Set debug back to the original level
-"%debug(%{Tmp-Integer-0})"
+%debug(%{test_integer})
 
 # Read out the current debug level to verify it changed
-if (!("%debug(%{Tmp-Integer-0})" == "%{Tmp-Integer-0}")) {
+if (!(%debug(%{test_integer}) == "%{test_integer}")) {
        test_fail
 }
 
index 0b4c886b07bf1d480d48435db46403c87ab9fd25..fa13c7f10674fde8ab2332eb6c03a3dcca50c0cb 100644 (file)
@@ -4,25 +4,27 @@
 #  Note the test for %interpreter(.line) is sensitive to the position of the
 #  instruction we're running.
 #
+string result_string
+uint32 result_integer
 
-&Tmp-String-0 := "%interpreter(.filename)"
-&Tmp-Integer-0 := "%interpreter(.line)"
-&Tmp-String-1 := "%interpreter(.name)"
-&Tmp-String-2 := "%interpreter(.type)"
+&result_string := "%interpreter(.filename)"
+&result_integer := "%interpreter(.line)"
 
-if (!(&Tmp-String-0 == "src/tests/keywords/xlat-interpreter")) {
+if (!(&result_string == "src/tests/keywords/xlat-interpreter")) {
        test_fail
 }
 
-if (!(&Tmp-String-1 == "&Tmp-String-1")) {
+&result_string := "%interpreter(.name)"
+if (!(&result_string == "&result_string")) {
        test_fail
 }
 
-if (!(&Tmp-String-2 == "edit")) {
+&result_string := "%interpreter(.type)"
+if (!(&result_string == "edit")) {
        test_fail
 }
 
-if (!(&Tmp-Integer-0 == 9)) {
+if (!(&result_integer == 11)) {
        test_fail
 }
 
index 05cf83d43ced7ddd975bc477954784b534bbdc1a..7426ac65c62cb038eef0dd5b2a90b4fc3df87d42 100644 (file)
@@ -1,6 +1,6 @@
 &control := {
-       &Tmp-IP-Address-0 = 192.0.2.1
-       &Tmp-IP-Address-0 = 192.0.2.2
+       &Framed-IP-Address = 192.0.2.1
+       &Framed-IP-Address = 192.0.2.2
 }
 
 if !(%{control.[#]} == 2) {
@@ -29,17 +29,17 @@ if !("%{control.[*]}" == '192.0.2.1192.0.2.2') {
 # Try calling these xlats in mapping too, they may get optimised to VPTs which is a
 # different code path.
 &request += {
-       &Tmp-IP-Address-1 = %{control.[1]}
-       &Tmp-IP-Address-1 = %{control.[0]}
-       &Tmp-String-0   = %concat(%{control.[*]}, ',')
-       &Tmp-Integer-0 = %{control.[#]}
+       &NAS-IP-Address = %{control.[1]}
+       &NAS-IP-Address = %{control.[0]}
+       &Filter-Id      = %concat(%{control.[*]}, ',')
+       &NAS-Port = %{control.[#]}
 }
 
-if !(&Tmp-String-0 == '192.0.2.1,192.0.2.2') {
+if !(&Filter-Id == '192.0.2.1,192.0.2.2') {
        test_fail
 }
 
-if !(&Tmp-Integer-0 == 2) {
+if !(&NAS-Port == 2) {
        test_fail
 }
 
index a6a403722ab9e41058001c5b4af7e297c8c14ea6..d04621893b8c8fe020ed75037c4602376143581f 100644 (file)
@@ -6,19 +6,19 @@
 #  octet strings must NOT have a 0x prefix added
 #
 &request += {
-       &Tmp-Octets-0 = 0x0001020304050607
-       &Tmp-Octets-0 = 0x0706050403020100
+       &Class = 0x0001020304050607
+       &Class = 0x0706050403020100
 }
 
-if (!(&Tmp-Octets-0 == 0x0001020304050607)) {
+if (!(&Class == 0x0001020304050607)) {
        test_fail
 }
 
-if (!(&Tmp-Octets-0[0] == 0x0001020304050607)) {
+if (!(&Class[0] == 0x0001020304050607)) {
        test_fail
 }
 
-if (!("%{Tmp-Octets-0[*]}" == 0x00010203040506070706050403020100)) {
+if (!("%{Class[*]}" == 0x00010203040506070706050403020100)) {
        test_fail
 }
 
index aebf8f7b86b03ff92d0e590cec6e2535f029df01..6bc5c89864b971fcc09748acc2fcbc289211852f 100644 (file)
@@ -1,71 +1,74 @@
 #
 # PRE: if
 #
-&request += {
-       &Tmp-Octets-0 = 0x5c5c
-       &Tmp-Octets-1 = 0x49206c696b6520636869636b656e2049206c696b65206c69766572
-       &Tmp-Octets-2 = 0x490049
-       &Tmp-Octets-3 = 0x00
-       &Tmp-Octets-4 = 0x7465737431
-       &Tmp-Octets-5 = 0x7465737432
-}
+octets test_octets1
+octets test_octets2
+octets test_octets3
+octets test_octets4
+octets test_octets5
+octets test_octets6
+string result_string
 
-&request += {
-       &Tmp-String-0 = %{(string) %{Tmp-Octets-0}}
-       &Tmp-String-1 = %{(string) %{Tmp-Octets-1}}
-       &Tmp-String-2 = %{(string) %{Tmp-Octets-2}}
-       &Tmp-String-3 = %{(string) %{Tmp-Octets-3}}
-}
+&test_octets1 := 0x5c5c
+&test_octets2 := 0x49206c696b6520636869636b656e2049206c696b65206c69766572
+&test_octets3 := 0x490049
+&test_octets4 = 0x00
+&test_octets5 = 0x7465737431
+&test_octets6 = 0x7465737432
 
-if (!(&Tmp-String-0 == "\\\\")) {
+&result_string := %{(string) %{test_octets1}}
+if (!(&result_string == "\\\\")) {
        test_fail
 }
 
 #
 #  Test interpolation between string expansions and strings
 #
-if (!("%{(string) %{Tmp-Octets-4}}%{(string) %{Tmp-Octets-5}}" == "test1test2")) {
+if (!("%{(string) %{test_octets5}}%{(string) %{test_octets6}}" == "test1test2")) {
        test_fail
 }
 
 #
 #  convert to string and then concatenate
 #
-if (!(%{(string) %{Tmp-Octets-4}} + %{(string) %{Tmp-Octets-5}} == "test1test2")) {
+if (!(%{(string) %{test_octets5}} + %{(string) %{test_octets6}} == "test1test2")) {
        test_fail
 }
 
 #
 #  concatenate, and then convert to string
 #
-if (!(%{(string) (%{Tmp-Octets-4} + %{Tmp-Octets-5})} == "test1test2")) {
+if (!(%{(string) (%{test_octets5} + %{test_octets6})} == "test1test2")) {
        test_fail
 }
 
 #
 #  We don't need %{(string) ...) either.
 #
-if !("%{(string) &Tmp-Octets-4}%{(string) &Tmp-Octets-5}" == "test1test2") {
+if !("%{(string) &test_octets5}%{(string) &test_octets6}" == "test1test2") {
        test_fail
 }
 
-if (!("test0%{(string) %{Tmp-Octets-4}}%{(string) %{Tmp-Octets-5}}" == "test0test1test2")) {
+if (!("test0%{(string) %{test_octets5}}%{(string) %{test_octets6}}" == "test0test1test2")) {
        test_fail
 }
 
-if (!("%{(string) %{Tmp-Octets-4}}%{(string) %{Tmp-Octets-5}}test3" == "test1test2test3")) {
+if (!("%{(string) %{test_octets5}}%{(string) %{test_octets6}}test3" == "test1test2test3")) {
        test_fail
 }
 
-if !(&Tmp-String-1 == 'I like chicken I like liver') {
+&result_string := %{(string) %{test_octets2}}
+if !(&result_string == 'I like chicken I like liver') {
        test_fail
 }
 
-if (!(&Tmp-String-2 == "I\000I")) {
+&result_string := %{(string) %{test_octets3}}
+if (!(&result_string == "I\000I")) {
        test_fail
 }
 
-if (!(&Tmp-String-3 == "\000")) {
+&result_string := %{(string) %{test_octets4}}
+if (!(&result_string == "\000")) {
        test_fail
 }
 
index dae2c30bd786445c07695508807320011a288c44..214edc2509934bff3594cfcfdb188a1b3e889c11 100644 (file)
@@ -1,74 +1,78 @@
-&Tmp-String-0 := 'aaa'
-&Tmp-String-1 := "\n\n\n"
-&Tmp-String-2 := "the quick brown fox jumped over the lazy dog"
+string test_string1
+string test_string2
+string test_string3
+
+&test_string1 := 'aaa'
+&test_string2 := "\n\n\n"
+&test_string3 := "the quick brown fox jumped over the lazy dog"
 
 #
 #  Non-regex base substitutions
 #
 
 # Global substitution
-if (!(%subst(%{Tmp-String-0}, 'a', 'b') == 'bbb')) {
+if (!(%subst(%{test_string1}, 'a', 'b') == 'bbb')) {
        test_fail
 }
 
 # No match
-if (!(%subst(%{Tmp-String-0}, 'c', 'b') == 'aaa')) {
+if (!(%subst(%{test_string1}, 'c', 'b') == 'aaa')) {
        test_fail
 }
 
 # Line ending rewrite
-if (!(%subst(%{Tmp-String-1}, "\n", "\r") == "\r\r\r")) {
+if (!(%subst(%{test_string2}, "\n", "\r") == "\r\r\r")) {
        test_fail
 }
 
 # Removal
-if (!(%subst(%{Tmp-String-0}, 'a', '') == "")) {
+if (!(%subst(%{test_string1}, 'a', '') == "")) {
        test_fail
 }
 
 # Removal of last word only
-if (!(%subst(%{Tmp-String-2}, 'dog', '') == "the quick brown fox jumped over the lazy ")) {
+if (!(%subst(%{test_string3}, 'dog', '') == "the quick brown fox jumped over the lazy ")) {
        test_fail
 }
 
 # Removal of first and subsequent word
-if (!(%subst(%{Tmp-String-2}, 'the', '') == " quick brown fox jumped over  lazy dog")) {
+if (!(%subst(%{test_string3}, 'the', '') == " quick brown fox jumped over  lazy dog")) {
        test_fail
 }
 
 # Removal of middle word
-if (!(%subst(%{Tmp-String-2}, 'jumped', '') == "the quick brown fox  over the lazy dog")) {
+if (!(%subst(%{test_string3}, 'jumped', '') == "the quick brown fox  over the lazy dog")) {
        test_fail
 }
 
 # Replacement of last word only
-if (!(%subst(%{Tmp-String-2}, 'dog', 'cat') == "the quick brown fox jumped over the lazy cat")) {
+if (!(%subst(%{test_string3}, 'dog', 'cat') == "the quick brown fox jumped over the lazy cat")) {
        test_fail
 }
 
 # Replacement of first and subsequent word
-if (!(%subst(%{Tmp-String-2}, 'the', 'cat') == "cat quick brown fox jumped over cat lazy dog")) {
+if (!(%subst(%{test_string3}, 'the', 'cat') == "cat quick brown fox jumped over cat lazy dog")) {
        test_fail
 }
 
 # Replacement of middle word
-if (!(%subst(%{Tmp-String-2}, 'jumped', 'cat') == "the quick brown fox cat over the lazy dog")) {
+if (!(%subst(%{test_string3}, 'jumped', 'cat') == "the quick brown fox cat over the lazy dog")) {
        test_fail
 }
 
 if ("${feature.regex-pcre2}" == 'yes') {
 # Basic substitutions
-if (!(%subst(%{Tmp-String-0}, /a/, 'b') == 'baa')) {
+if (!(%subst(%{test_string1}, /a/, 'b') == 'baa')) {
        test_fail
 }
 
 # Global substitution
-if (!(%subst(%{Tmp-String-0}, /a/g, 'b') == 'bbb')) {
+if (!(%subst(%{test_string1}, /a/g, 'b') == 'bbb')) {
        test_fail
 }
 
 # No match
-if (!(%subst(%{Tmp-String-0}, /z/, 'b') == 'aaa')) {
+if (!(%subst(%{test_string1}, /z/, 'b') == 'aaa')) {
        test_fail
 }
 
@@ -77,31 +81,31 @@ if (!(%subst(%{Tmp-String-0}, /z/, 'b') == 'aaa')) {
 #
 
 # Check that newlines really are newlines
-if (!(%length(%{Tmp-String-1}) == 3)) {
+if (!(%length(%{test_string2}) == 3)) {
        test_fail
 }
 
 # Strip out just the first newline
-if (!(%subst(%{Tmp-String-1}, /^./s, '') == "\n\n")) {
+if (!(%subst(%{test_string2}, /^./s, '') == "\n\n")) {
        test_fail
 }
 
-if (!(%subst(%{Tmp-String-1}, /\n/, '') == "\n\n")) {
+if (!(%subst(%{test_string2}, /\n/, '') == "\n\n")) {
        test_fail
 }
 
 # Strip out all the newlines
-if (!(%subst(%{Tmp-String-1}, /\n/g, '') == '')) {
+if (!(%subst(%{test_string2}, /\n/g, '') == '')) {
        test_fail
 }
 
 # Line ending switch
-if (!(%subst(%{Tmp-String-1}, /\n/g, "\r") == "\r\r\r")) {
+if (!(%subst(%{test_string2}, /\n/g, "\r") == "\r\r\r")) {
        test_fail
 }
 
 # Bad regex
-if (%subst(%{Tmp-String-0}, /***/g, '.')) {
+if (%subst(%{test_string1}, /***/g, '.')) {
        test_fail
 }
 
@@ -112,7 +116,7 @@ if !(&Module-Failure-Message[*] == 'Failed compiling regex: quantifier does not
 &request -= &Module-Failure-Message[*]
 
 # Empty regex
-if (%subst(%{Tmp-String-0}, //g, '.')) {
+if (%subst(%{test_string1}, //g, '.')) {
        test_fail
 }