From: Alan T. DeKok Date: Fri, 6 Sep 2024 15:24:03 +0000 (-0400) Subject: add migration flag to test runs, and remove "&" from tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3daf832da1eff4b18eeef78cbc2dff63b374414;p=thirdparty%2Ffreeradius-server.git add migration flag to test runs, and remove "&" from tests that's the result of a lot of work. --- diff --git a/src/tests/keywords/3gpp b/src/tests/keywords/3gpp index 1441968da87..86b469ee88c 100644 --- a/src/tests/keywords/3gpp +++ b/src/tests/keywords/3gpp @@ -1,13 +1,13 @@ string result_string1 string result_string2 -&Vendor-Specific.3GPP.IMSI := "hello" +Vendor-Specific.3GPP.IMSI := "hello" # # "request.[0-9]" should be parsed as a list followed # by an attribute. # -&result_string1 := &Vendor-Specific.3GPP.IMSI -&result_string2 := &request.Vendor-Specific.3GPP.IMSI +result_string1 := Vendor-Specific.3GPP.IMSI +result_string2 := request.Vendor-Specific.3GPP.IMSI success diff --git a/src/tests/keywords/acct_unique b/src/tests/keywords/acct_unique index c11895e72b7..8ef157297f2 100644 --- a/src/tests/keywords/acct_unique +++ b/src/tests/keywords/acct_unique @@ -4,9 +4,9 @@ # Test the acct_unique policy # # -&Acct-Unique-Session-Id := %hex(%md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{&NAS-IPv6-Address || &NAS-IP-Address},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}")) +Acct-Unique-Session-Id := %hex(%md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{NAS-IPv6-Address || NAS-IP-Address},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}")) -if &Acct-Unique-Session-Id != "159dccf021583d7413b0114a090529ca" { +if Acct-Unique-Session-Id != "159dccf021583d7413b0114a090529ca" { test_fail } diff --git a/src/tests/keywords/action-not-end-error b/src/tests/keywords/action-not-end-error index fb7ff71de79..de9ed558315 100644 --- a/src/tests/keywords/action-not-end-error +++ b/src/tests/keywords/action-not-end-error @@ -8,7 +8,7 @@ if (1) { # We're not running the 'pap' module, so # we have to set this ourselves. # - &control.Auth-Type := ::pap + control.Auth-Type := ::pap # not at the end of a section actions { # ERROR diff --git a/src/tests/keywords/action-return b/src/tests/keywords/action-return index 36841d94967..aff6b45f038 100644 --- a/src/tests/keywords/action-return +++ b/src/tests/keywords/action-return @@ -10,7 +10,7 @@ if (1) { # We're not running the 'pap' module, so # we have to set this ourselves. # - &control.Auth-Type := ::pap + control.Auth-Type := ::pap actions { ok = return diff --git a/src/tests/keywords/alias b/src/tests/keywords/alias index 6844c22f5f2..b75b605933a 100644 --- a/src/tests/keywords/alias +++ b/src/tests/keywords/alias @@ -1,9 +1,9 @@ -&Vendor-Specific.WiMAX.Capability.Release := "foo" +Vendor-Specific.WiMAX.Capability.Release := "foo" # # WiMAX is an alias to Vendor-Specific.WiMAX # -if !(&request.WiMAX.Capability.Release == "foo") { +if !(request.WiMAX.Capability.Release == "foo") { test_fail } diff --git a/src/tests/keywords/all.mk b/src/tests/keywords/all.mk index 1b53f84a4fa..74deb1baa28 100644 --- a/src/tests/keywords/all.mk +++ b/src/tests/keywords/all.mk @@ -154,7 +154,7 @@ KEYWORD_LIBS := $(addsuffix .la,$(addprefix rlm_,$(KEYWORD_MODULES))) rlm_csv.la # @todo - set "-S require_enum_prefix=yes" here, so that the flag is set _before_ we read the config files. # $(OUTPUT)/%: $(DIR)/% $(TEST_BIN_DIR)/unit_test_module | $(KEYWORD_RADDB) $(KEYWORD_LIBS) build.raddb rlm_test.la rlm_csv.la rlm_unpack.la - $(eval CMD:=KEYWORD=$(notdir $@) $(TEST_BIN)/unit_test_module $(NEW_COND) $(UNIT_TEST_KEYWORD_ARGS.$(subst -,_,$(notdir $@))) -D share/dictionary -d src/tests/keywords/ -i "$@.attrs" -f "$@.attrs" -r "$@" -xx $(KEYWORD_OPTS)) + $(eval CMD:=KEYWORD=$(notdir $@) $(TEST_BIN)/unit_test_module $(NEW_COND) $(UNIT_TEST_KEYWORD_ARGS.$(subst -,_,$(notdir $@))) -D share/dictionary -d src/tests/keywords/ -i "$@.attrs" -f "$@.attrs" -r "$@" -S require_enum_prefix=yes -xx ) @echo "KEYWORD-TEST $(notdir $@)" ${Q}if ! $(CMD) > "$@.log" 2>&1 || ! test -f "$@"; then \ if ! grep ERROR $< 2>&1 > /dev/null; then \ diff --git a/src/tests/keywords/alternation-error b/src/tests/keywords/alternation-error index cdd8ea9ee5c..a2410bb8553 100644 --- a/src/tests/keywords/alternation-error +++ b/src/tests/keywords/alternation-error @@ -1 +1 @@ -&request.Acct-Unique-Session-Id := %hex(%md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}")) # ERROR +request.Acct-Unique-Session-Id := %hex(%md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}")) # ERROR diff --git a/src/tests/keywords/array b/src/tests/keywords/array index 3b29090d226..53543943770 100644 --- a/src/tests/keywords/array +++ b/src/tests/keywords/array @@ -3,35 +3,35 @@ # # Tests for dereferencing the Nth attribute # -&request += { - &Class = 0x01020304, - &Class = 0x05060708, - &Class = 0x090a0b0c, +request += { + Class = 0x01020304, + Class = 0x05060708, + Class = 0x090a0b0c, } if (!(%{Class[#]} == 3)) { test_fail } -if (!(&Class[0] == 0x01020304)) { +if (!(Class[0] == 0x01020304)) { test_fail } -if (!(&Class[1] == 0x05060708)) { +if (!(Class[1] == 0x05060708)) { test_fail } -if (!(&Class[2] == 0x090a0b0c)) { +if (!(Class[2] == 0x090a0b0c)) { test_fail } # must not exist -if (&Class[3]) { +if (Class[3]) { test_fail } # Last element of the array -if (!(&Class[n] == 0x090a0b0c)) { +if (!(Class[n] == 0x090a0b0c)) { test_fail } diff --git a/src/tests/keywords/assign-star-error b/src/tests/keywords/assign-star-error index 3b0138d5d35..6a4e51902d3 100644 --- a/src/tests/keywords/assign-star-error +++ b/src/tests/keywords/assign-star-error @@ -1,4 +1,4 @@ # # We might allow this later. But for now, the code doesn't implement it, so we don't allow it. # -&User-Name[*] = "foo" # ERROR +User-Name[*] = "foo" # ERROR diff --git a/src/tests/keywords/attr-index b/src/tests/keywords/attr-index index 3442a42e19b..dcc1a146858 100644 --- a/src/tests/keywords/attr-index +++ b/src/tests/keywords/attr-index @@ -1,33 +1,33 @@ -&request += { - &Filter-Id = "foo" - &Filter-Id = "bar" - &Filter-Id = "baz" +request += { + Filter-Id = "foo" + Filter-Id = "bar" + Filter-Id = "baz" } -&Filter-Id[1] := "yellow" +Filter-Id[1] := "yellow" if (!("%{Filter-Id[*]}" == "fooyellowbaz")) { test_fail } -&Filter-Id[2] += "red" +Filter-Id[2] += "red" if (!("%{Filter-Id[*]}" == "fooyellowbazred")) { test_fail } -&Filter-Id[2] -= "red" +Filter-Id[2] -= "red" if (!("%{Filter-Id[*]}" == "fooyellowbaz")) { test_fail } -&Filter-Id[0] := "oof" +Filter-Id[0] := "oof" if (!("%{Filter-Id[*]}" == "oofyellowbaz")) { test_fail } -&Filter-Id[1] := "bar" +Filter-Id[1] := "bar" if (!("%{Filter-Id[*]}" == "oofbarbaz")) { test_fail } diff --git a/src/tests/keywords/attr-index-expr b/src/tests/keywords/attr-index-expr index c7e883c44e8..6149018a542 100644 --- a/src/tests/keywords/attr-index-expr +++ b/src/tests/keywords/attr-index-expr @@ -5,24 +5,24 @@ # uint32 index -&request += { - &Class = 0x01020304, - &Class = 0x05060708, - &Class = 0x090a0b0c, +request += { + Class = 0x01020304, + Class = 0x05060708, + Class = 0x090a0b0c, } # # Computed indexes, with some limitations # -&index := 1 +index := 1 -if (&Class[%{&index - 1}] != 0x01020304) { +if (Class[%{index - 1}] != 0x01020304) { test_fail } -&index := 4 +index := 4 -if (&Class[%{&index - 2}] != 0x090a0b0c) { +if (Class[%{index - 2}] != 0x090a0b0c) { test_fail } diff --git a/src/tests/keywords/attr-index-ref b/src/tests/keywords/attr-index-ref index 7aaf1146a72..79aedff0c1c 100644 --- a/src/tests/keywords/attr-index-ref +++ b/src/tests/keywords/attr-index-ref @@ -1,40 +1,40 @@ # # PRE: attr-index # -# Tests for using attribute references as array &index +# Tests for using attribute references as array index # uint32 index -&request += { - &Class = 0x01020304, - &Class = 0x05060708, - &Class = 0x090a0b0c, +request += { + Class = 0x01020304, + Class = 0x05060708, + Class = 0x090a0b0c, } -&index := 1 +index := 1 -if (&Class[&index] != 0x05060708) { +if (Class[index] != 0x05060708) { test_fail } -&index := 0 +index := 0 -if (&Class[&index] != 0x01020304) { +if (Class[index] != 0x01020304) { test_fail } -&index := 2 +index := 2 -if (&Class[&index] != 0x090a0b0c) { +if (Class[index] != 0x090a0b0c) { test_fail } # # This one doesn't exist. # -&index := 3 +index := 3 -if (&Class[&index]) { +if (Class[index]) { test_fail } diff --git a/src/tests/keywords/base64 b/src/tests/keywords/base64 index e6f6c5cfffd..673ffd5bf89 100644 --- a/src/tests/keywords/base64 +++ b/src/tests/keywords/base64 @@ -15,119 +15,119 @@ ether test_ether uint64 test_int64 ipv4prefix test_ipv4prefix -&test_string = '9870' -&test_octets = 0x39383731 -&test_ipaddr = 57.56.55.50 -&test_int = 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 +test_string = '9870' +test_octets = 0x39383731 +test_ipaddr = 57.56.55.50 +test_int = 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 -&test_output := %base64.encode(%{test_string}) -if (!(&test_output == 'OTg3MA==')) { +test_output := %base64.encode(%{test_string}) +if (!(test_output == 'OTg3MA==')) { test_fail } # Octets - bin 0x39383731 -&test_output := %base64.encode(%{test_octets}) -if (!(&test_output == 'OTg3MQ==')) { +test_output := %base64.encode(%{test_octets}) +if (!(test_output == 'OTg3MQ==')) { test_fail } # IP Address - bin 0x39383732 -&test_output := %base64.encode(%{test_ipaddr}) -if (!(&test_output == 'OTg3Mg==')) { +test_output := %base64.encode(%{test_ipaddr}) +if (!(test_output == 'OTg3Mg==')) { test_fail } # Integer - bin 0x39383734 -&test_output := %base64.encode(%{test_int}) -if (!(&test_output == 'OTg3NA==')) { +test_output := %base64.encode(%{test_int}) +if (!(test_output == 'OTg3NA==')) { test_fail } # ifid - bin 0x0000000039383737 -&test_output := %base64.encode(%{test_ifid}) -if (!(&test_output == 'AAAAADk4Nzc=')) { +test_output := %base64.encode(%{test_ifid}) +if (!(test_output == 'AAAAADk4Nzc=')) { test_fail } # ipv6addr - bin 0x00000000000000000000000039383738 -&test_output := %base64.encode(%{test_ipv6addr}) -if (!(&test_output == 'AAAAAAAAAAAAAAAAOTg3OA==')) { +test_output := %base64.encode(%{test_ipv6addr}) +if (!(test_output == 'AAAAAAAAAAAAAAAAOTg3OA==')) { test_fail } # ipv6addrprefix - bin 0x008000000000000000000000000039383739 -&test_output := %base64.encode(%{test_ipv6prefix}) -if (!(&test_output == 'AIAAAAAAAAAAAAAAAAA5ODc5')) { +test_output := %base64.encode(%{test_ipv6prefix}) +if (!(test_output == 'AIAAAAAAAAAAAAAAAAA5ODc5')) { test_fail } # byte - bin 0x3a -&test_output := %base64.encode(%{test_byte}) -if (!(&test_output == 'Og==')) { +test_output := %base64.encode(%{test_byte}) +if (!(test_output == 'Og==')) { test_fail } # short - bin 0x373b -&test_output := %base64.encode(%{test_short}) -if (!(&test_output == 'Nzs=')) { +test_output := %base64.encode(%{test_short}) +if (!(test_output == 'Nzs=')) { test_fail } # ethernet - bin 0x00003938373c -&test_output := %base64.encode(%{test_ether}) -if (!(&test_output == 'AAA5ODc8')) { +test_output := %base64.encode(%{test_ether}) +if (!(test_output == 'AAA5ODc8')) { test_fail } # integer64 - bin 0x100000003938373d -&test_output := %base64.encode(%{test_int64}) -if (!(&test_output == 'EAAAADk4Nz0=')) { +test_output := %base64.encode(%{test_int64}) +if (!(test_output == 'EAAAADk4Nz0=')) { test_fail } # ipv4prefix - bin 0x203938373e -&test_output := %base64.encode(%{test_ipv4prefix}) -if (!(&test_output == 'IDk4Nz4=')) { +test_output := %base64.encode(%{test_ipv4prefix}) +if (!(test_output == 'IDk4Nz4=')) { test_fail } # Something weird causes this test not to parse -# &test_octets := %base64.decode("") -#if (!(&test_octets == "")) { +# test_octets := %base64.decode("") +#if (!(test_octets == "")) { # test_fail #} # Regression test, this used to crash... -&test_octets := %base64.decode(Zm9v) -if (!(&test_octets == "foo")) { +test_octets := %base64.decode(Zm9v) +if (!(test_octets == "foo")) { debug_request test_fail } -&test_octets := %base64.decode(AIAAAAAAAAAAAAAAAAA5ODc5) -if (!(&test_octets == 0x008000000000000000000000000039383739)) { +test_octets := %base64.decode(AIAAAAAAAAAAAAAAAAA5ODc5) +if (!(test_octets == 0x008000000000000000000000000039383739)) { test_fail } # Regression tests -&test_octets := %base64.decode(5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK) +test_octets := %base64.decode(5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK) -if (!(&test_octets == 0xe5136a365f2260b6e409cec9851f1ab384ed0c3097ea8b6eb96b5c8daf2b213532c7dceb9c749ef6d4c71a628a)) { +if (!(test_octets == 0xe5136a365f2260b6e409cec9851f1ab384ed0c3097ea8b6eb96b5c8daf2b213532c7dceb9c749ef6d4c71a628a)) { test_fail } -&test_octets := %base64.decode(eHfXPKZ+2iv9cnMV1MOmE/moYYA1Uk5xTmw4aVlMYmtDYzdKaFI4YXM0VHRERENYNm90dXVXdGNqYThySVRVeXg5enJuSFNlOXRUSEdtS0s=) +test_octets := %base64.decode(eHfXPKZ+2iv9cnMV1MOmE/moYYA1Uk5xTmw4aVlMYmtDYzdKaFI4YXM0VHRERENYNm90dXVXdGNqYThySVRVeXg5enJuSFNlOXRUSEdtS0s=) -if (!(&test_octets == 0x7877d73ca67eda2bfd727315d4c3a613f9a8618035524e714e6c3869594c626b4363374a685238617334547444444358366f7475755774636a6138724954557978397a726e48536539745448476d4b4b)) { +if (!(test_octets == 0x7877d73ca67eda2bfd727315d4c3a613f9a8618035524e714e6c3869594c626b4363374a685238617334547444444358366f7475755774636a6138724954557978397a726e48536539745448476d4b4b)) { test_fail } success diff --git a/src/tests/keywords/bin b/src/tests/keywords/bin index 14a6ea7366e..02cdd07511d 100644 --- a/src/tests/keywords/bin +++ b/src/tests/keywords/bin @@ -3,53 +3,53 @@ # octets result_octets -&result_octets := %bin('39383730') -if !(&result_octets == 0x39383730) { +result_octets := %bin('39383730') +if !(result_octets == 0x39383730) { test_fail } -&result_octets := %bin('0x39383731') -if !(&result_octets == 0x39383731) { +result_octets := %bin('0x39383731') +if !(result_octets == 0x39383731) { test_fail } -&result_octets := %bin('012') -if (&result_octets) { +result_octets := %bin('012') +if (result_octets) { test_fail } -&result_octets := %bin('0x') -if (&result_octets) { +result_octets := %bin('0x') +if (result_octets) { test_fail } -&result_octets := %bin('0x234') -if (&result_octets) { +result_octets := %bin('0x234') +if (result_octets) { test_fail } -&result_octets := %bin('fg') -if (&result_octets) { +result_octets := %bin('fg') +if (result_octets) { test_fail } -&result_octets := %bin('0x23450x1234') -if (&result_octets) { +result_octets := %bin('0x23450x1234') +if (result_octets) { test_fail } -&request += { - &NAS-Identifier = '0001' - &NAS-Identifier = '0x030405' +request += { + NAS-Identifier = '0001' + NAS-Identifier = '0x030405' } -&Class := %bin(%{NAS-Identifier[*]}) +Class := %bin(%{NAS-Identifier[*]}) -if (&Class[#] != 2) { +if (Class[#] != 2) { test_fail } -if !((&Class[0] == 0x0001) && (&Class[1] == 0x030405)) { +if !((Class[0] == 0x0001) && (Class[1] == 0x030405)) { test_fail } diff --git a/src/tests/keywords/break-error b/src/tests/keywords/break-error index eca4c98e521..e2927131125 100644 --- a/src/tests/keywords/break-error +++ b/src/tests/keywords/break-error @@ -1,3 +1,3 @@ -if (&User-Name == "bob") { +if (User-Name == "bob") { break # ERROR } diff --git a/src/tests/keywords/call b/src/tests/keywords/call index f551670eb0e..38719e5600a 100644 --- a/src/tests/keywords/call +++ b/src/tests/keywords/call @@ -2,23 +2,23 @@ # PRE: if # call second { - &reply += { - &Reply-Message = 'call second post' + reply += { + Reply-Message = 'call second post' } } -if (!&reply.Reply-Message) { +if (!reply.Reply-Message) { test_fail } -if (!(&reply.Reply-Message[0] == "call second")) { +if (!(reply.Reply-Message[0] == "call second")) { test_fail } -if (!(&reply.Reply-Message[1] == "call second post")) { +if (!(reply.Reply-Message[1] == "call second post")) { test_fail } -&reply -= &Reply-Message[*] +reply -= Reply-Message[*] success diff --git a/src/tests/keywords/call-empty b/src/tests/keywords/call-empty index a25e56cd6c1..16654d38016 100644 --- a/src/tests/keywords/call-empty +++ b/src/tests/keywords/call-empty @@ -6,14 +6,14 @@ call second { } -if (!&reply.Reply-Message) { +if (!reply.Reply-Message) { test_fail } -if (!(&reply.Reply-Message[0] == "call second")) { +if (!(reply.Reply-Message[0] == "call second")) { test_fail } -&reply -= &Reply-Message +reply -= Reply-Message success diff --git a/src/tests/keywords/case-attr-error b/src/tests/keywords/case-attr-error index 2be0b1361f2..b1cd88fa3b3 100644 --- a/src/tests/keywords/case-attr-error +++ b/src/tests/keywords/case-attr-error @@ -2,12 +2,12 @@ # test_fail -switch &reply.Filter-Id { +switch reply.Filter-Id { # deliberately empty case "filter" { } - case &Not-Dynamically-Allocated { # ERROR + case Not-Dynamically-Allocated { # ERROR test_fail } diff --git a/src/tests/keywords/case-duplicate b/src/tests/keywords/case-duplicate index fc13854f715..a00963a6d88 100644 --- a/src/tests/keywords/case-duplicate +++ b/src/tests/keywords/case-duplicate @@ -1,6 +1,6 @@ # PRE: switch # -switch &reply.Filter-Id { +switch reply.Filter-Id { case "filter" { ok } diff --git a/src/tests/keywords/case-empty b/src/tests/keywords/case-empty index 36c5e970bd6..8c03558e098 100644 --- a/src/tests/keywords/case-empty +++ b/src/tests/keywords/case-empty @@ -1,6 +1,6 @@ # PRE: switch # -switch &reply.Filter-Id { +switch reply.Filter-Id { # deliberately empty case "filter" { } diff --git a/src/tests/keywords/case-empty-string b/src/tests/keywords/case-empty-string index 9f93b024caa..d5aa88959d2 100644 --- a/src/tests/keywords/case-empty-string +++ b/src/tests/keywords/case-empty-string @@ -1,17 +1,17 @@ # PRE: switch # -&Filter-Id := "" +Filter-Id := "" -switch &Filter-Id { +switch Filter-Id { case "" { success } case "doug" { - &reply.Filter-Id := "doug" + reply.Filter-Id := "doug" } case { - &reply.Filter-Id := "default" + reply.Filter-Id := "default" } } diff --git a/src/tests/keywords/cast-byte b/src/tests/keywords/cast-byte index 1696c5252ae..8991f64b579 100644 --- a/src/tests/keywords/cast-byte +++ b/src/tests/keywords/cast-byte @@ -1,16 +1,16 @@ # # PRE: if # -&Class := 0xad +Class := 0xad -if ((byte)&Class == 173) { +if ((byte)Class == 173) { success } -if ((byte)&Class < 173) { +if ((byte)Class < 173) { test_fail } -if ((byte)&Class > 173) { +if ((byte)Class > 173) { test_fail } diff --git a/src/tests/keywords/cast-integer b/src/tests/keywords/cast-integer index c5cd8f79e8c..12d0d2b8e49 100644 --- a/src/tests/keywords/cast-integer +++ b/src/tests/keywords/cast-integer @@ -4,35 +4,35 @@ uint32 zscore # # PRE: if # -&Class := 0x00000101 +Class := 0x00000101 -if ((integer)&Class[0] == 257) { +if ((integer)Class[0] == 257) { success } -if ((integer)&Class[0] < 256) { +if ((integer)Class[0] < 256) { test_fail } -if ((integer)&Class[0] > 257) { +if ((integer)Class[0] > 257) { test_fail } -&zscore := 1 +zscore := 1 -&foo := (uint64) 0x10000000000001 +foo := (uint64) 0x10000000000001 -if (&foo != (&zscore + %cast('uint64', 0x10000000000000))) { +if (foo != (zscore + %cast('uint64', 0x10000000000000))) { test_fail } -if (&foo != (&zscore + (uint64) 0x10000000000000)) { +if (foo != (zscore + (uint64) 0x10000000000000)) { test_fail } -&Service-Type := ::Framed-User +Service-Type := ::Framed-User -if ((uint32) &Service-Type != 2) { +if ((uint32) Service-Type != 2) { test_fail } @@ -40,6 +40,6 @@ if ((uint32) &Service-Type != 2) { # Cast Service-Type to it's underlying data type, # which means "don't print the enum name". # -if ("%{(uint32) &Service-Type}" != "2") { +if ("%{(uint32) Service-Type}" != "2") { test_fail } diff --git a/src/tests/keywords/cast-ipaddr b/src/tests/keywords/cast-ipaddr index f3873c5e591..87a130f8b13 100644 --- a/src/tests/keywords/cast-ipaddr +++ b/src/tests/keywords/cast-ipaddr @@ -17,12 +17,12 @@ ipv4prefix result_ipv4prefix ipv6addr result_ipv6addr ipv6prefix result_ipv6prefix -&NAS-IP-Address := 127.0.0.1 -&test_integer := 0x7f000001 +NAS-IP-Address := 127.0.0.1 +test_integer := 0x7f000001 -&test_string := &NAS-IP-Address +test_string := NAS-IP-Address -if (!((ipaddr)&test_integer == &NAS-IP-Address)) { +if (!((ipaddr)test_integer == NAS-IP-Address)) { test_fail } @@ -31,108 +31,108 @@ if (!((ipaddr)&test_integer == &NAS-IP-Address)) { # correct, by using the assignment to perform the cast, and looking # at the results. # -&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 +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 # -&result_ipv6addr := &test_ipaddr -if (!(&result_ipv6addr == ::ffff:203.0.113.1)) { +result_ipv6addr := test_ipaddr +if (!(result_ipv6addr == ::ffff:203.0.113.1)) { test_fail } # # IPv6 address to IPv4 address # -&result_ipaddr := &result_ipv6addr -if (!(&result_ipaddr == 203.0.113.1)) { +result_ipaddr := result_ipv6addr +if (!(result_ipaddr == 203.0.113.1)) { test_fail } # # IPv4 prefix to IPv6 prefix # -&result_ipv6prefix := &test_ipv4prefix1 -if (!(&result_ipv6prefix == ::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 # -&result_ipv4prefix := &result_ipv6prefix -if (!(&result_ipv4prefix == 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 # -&result_ipv6addr := &test_ipv4prefix2 -if (!(&result_ipv6addr == ::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 # -&result_ipaddr := &test_ipv6prefix2 -if (!(&result_ipaddr == 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) # -&result_ipv6prefix := &test_ipaddr -if (!(&result_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) # -&result_ipv4prefix := &test_ipv6addr2 -if (!(&result_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) # -&result_ipv4prefix := &test_ipaddr -if (!(&result_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) # -&result_ipv6prefix := &test_ipv6addr1 -if (!(&result_ipv6prefix == 2001:DB8::1/128)) { +result_ipv6prefix := test_ipv6addr1 +if (!(result_ipv6prefix == 2001:DB8::1/128)) { test_fail } # # IPv4 prefix (32) to IPv4 address # -&result_ipaddr := &test_ipv4prefix2 -if (!(&result_ipaddr == 203.0.113.1)) { +result_ipaddr := test_ipv4prefix2 +if (!(result_ipaddr == 203.0.113.1)) { test_fail } # # IPv6 prefix (128) to IPv6 address # -&result_ipv6addr := &test_ipv6prefix2 -if (!(&result_ipv6addr == ::ffff:203.0.113.1)) { +result_ipv6addr := test_ipv6prefix2 +if (!(result_ipv6addr == ::ffff:203.0.113.1)) { test_fail } @@ -145,14 +145,14 @@ if (!(&result_ipv6addr == ::ffff:203.0.113.1)) { # redundant { group { - &result_ipv6addr := &test_ipv6prefix1 + result_ipv6addr := test_ipv6prefix1 fail } group { - 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') { + 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[*] + request -= Module-Failure-Message[*] ok } } @@ -162,14 +162,14 @@ redundant { # redundant { group { - &result_ipaddr := &test_ipv6prefix3 + result_ipaddr := test_ipv6prefix3 fail } group { - 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') { + 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[*] + request -= Module-Failure-Message[*] ok } } @@ -179,14 +179,14 @@ redundant { # redundant { group { - &result_ipv4prefix := &test_ipv6prefix3 + result_ipv4prefix := test_ipv6prefix3 fail } group { - if !(&Module-Failure-Message == 'Assigning value to &result_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[*] + request -= Module-Failure-Message[*] ok } } @@ -196,14 +196,14 @@ redundant { # redundant { group { - &result_ipv6addr := &test_ipv4prefix1 + result_ipv6addr := test_ipv4prefix1 fail } group { - 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') { + 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[*] + request -= Module-Failure-Message[*] ok } } @@ -213,14 +213,14 @@ redundant { # redundant { group { - &result_ipaddr := &test_ipv4prefix1 + result_ipaddr := test_ipv4prefix1 fail } group { - 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') { + 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[*] + request -= Module-Failure-Message[*] ok } } @@ -230,14 +230,14 @@ redundant { # redundant { group { - &result_ipaddr := &test_ipv6prefix1 + result_ipaddr := test_ipv6prefix1 fail } group { - 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') { + 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[*] + request -= Module-Failure-Message[*] ok } } @@ -247,14 +247,14 @@ redundant { # redundant { group { - &result_ipv4prefix := &test_ipv6prefix1 + result_ipv4prefix := test_ipv6prefix1 fail } group { - if !(&Module-Failure-Message == 'Assigning value to &result_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[*] + request -= Module-Failure-Message[*] ok } } @@ -264,14 +264,14 @@ redundant { # redundant { group { - &result_ipaddr := &test_ipv6addr1 + result_ipaddr := test_ipv6addr1 fail } group { - if !(&Module-Failure-Message == 'Assigning value to &result_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[*] + request -= Module-Failure-Message[*] ok } } @@ -281,14 +281,14 @@ redundant { # redundant { group { - &result_ipv4prefix := &test_ipv6addr1 + result_ipv4prefix := test_ipv6addr1 fail } group { - if !(&Module-Failure-Message == 'Assigning value to &result_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[*] + request -= Module-Failure-Message[*] ok } } diff --git a/src/tests/keywords/cast-short b/src/tests/keywords/cast-short index 4f87e5b8afb..f5984846028 100644 --- a/src/tests/keywords/cast-short +++ b/src/tests/keywords/cast-short @@ -1,16 +1,16 @@ # # PRE: if # -&Class := 0x0101 +Class := 0x0101 -if ((short)&Class == 257) { +if ((short)Class == 257) { success } -if ((short)&Class < 256) { +if ((short)Class < 256) { test_fail } -if ((short)&Class > 257) { +if ((short)Class > 257) { test_fail } diff --git a/src/tests/keywords/cast-time_delta b/src/tests/keywords/cast-time_delta index 645b82094ae..e6720cf67b9 100644 --- a/src/tests/keywords/cast-time_delta +++ b/src/tests/keywords/cast-time_delta @@ -28,23 +28,23 @@ if (%cast("weeks", 8d) != 1.864) { # # These dates are one minute apart. # -&one = "2024-08-12T00:00:00Z" -&two = "2024-08-12T00:01:00Z" +one = "2024-08-12T00:00:00Z" +two = "2024-08-12T00:01:00Z" -&diff = &two - &one -if (&diff != 60s) { +diff = two - one +if (diff != 60s) { test_fail } # # Cast the time delta to milliseconds # -&num = %cast("ms", %{diff}) +num = %cast("ms", %{diff}) # # This results in 60, because the conversion to fr_value_box_cast() doesn't pass dst->enumv? # -if (&num != 60000) { +if (num != 60000) { test_fail } diff --git a/src/tests/keywords/change-proto b/src/tests/keywords/change-proto index 8779815d965..7c4262f06cb 100644 --- a/src/tests/keywords/change-proto +++ b/src/tests/keywords/change-proto @@ -3,7 +3,7 @@ # # Not really, but it's a way to test cross-protocol issues # -&Proto.radius.User-Name = 'uid' -&Password.With-Header = 'userPassword' +Proto.radius.User-Name = 'uid' +Password.With-Header = 'userPassword' success diff --git a/src/tests/keywords/cmp b/src/tests/keywords/cmp index 8ce2d0047ab..8adec0cc3a6 100644 --- a/src/tests/keywords/cmp +++ b/src/tests/keywords/cmp @@ -1,9 +1,9 @@ -&Called-Station-Id := "This is a test" -&Calling-Station-Id := "This is a test" +Called-Station-Id := "This is a test" +Calling-Station-Id := "This is a test" # # Check attribute references # -if (&Called-Station-Id == &Calling-Station-Id) { +if (Called-Station-Id == Calling-Station-Id) { success } diff --git a/src/tests/keywords/cmp-eq-ne b/src/tests/keywords/cmp-eq-ne index 7079302515e..13dc0679a24 100644 --- a/src/tests/keywords/cmp-eq-ne +++ b/src/tests/keywords/cmp-eq-ne @@ -4,22 +4,22 @@ uint32 result # # "foo" does not yet exist. So it doesn't have value "42" # -if (&foo != 42) { - &result += 1 +if (foo != 42) { + result += 1 } # # This should be the same as above. # -if !(&foo == 42) { - &result += 1 +if !(foo == 42) { + result += 1 } -if !&result { +if !result { test_fail } -if (&result != 2) { +if (result != 2) { test_fail } success diff --git a/src/tests/keywords/cmp-ipaddr b/src/tests/keywords/cmp-ipaddr index f5ecb5ef09d..b5cfedcace7 100644 --- a/src/tests/keywords/cmp-ipaddr +++ b/src/tests/keywords/cmp-ipaddr @@ -1,28 +1,28 @@ # # PRE: if # -&NAS-IP-Address := 127.0.0.1 -&Framed-IP-Address := 127.0.0.1 +NAS-IP-Address := 127.0.0.1 +Framed-IP-Address := 127.0.0.1 # # Check attribute references # -if (!(&NAS-IP-Address == &Framed-IP-Address)) { +if (!(NAS-IP-Address == Framed-IP-Address)) { test_fail } -&NAS-IP-Address := 0.0.0.0 -&Framed-IP-Address := 255.255.255.255 +NAS-IP-Address := 0.0.0.0 +Framed-IP-Address := 255.255.255.255 -if (!(!(&NAS-IP-Address == &Framed-IP-Address))) { +if (!(!(NAS-IP-Address == Framed-IP-Address))) { test_fail } -if (!(&NAS-IP-Address < &Framed-IP-Address)) { +if (!(NAS-IP-Address < Framed-IP-Address)) { test_fail } -if (&NAS-IP-Address > &Framed-IP-Address) { +if (NAS-IP-Address > Framed-IP-Address) { test_fail } diff --git a/src/tests/keywords/concat b/src/tests/keywords/concat index 1be67c9be30..11c4db3cfc3 100644 --- a/src/tests/keywords/concat +++ b/src/tests/keywords/concat @@ -4,79 +4,79 @@ # 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 - &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 +control -= Password + +control += { + User-Name = request.User-Name + User-Password = request.User-Password + 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 } # -# &ref could return a list. -# (&ref) means "treat the list as one value" -# (string) (&ref) casts that one value to a string +# ref could return a list. +# (ref) means "treat the list as one value" +# (string) (ref) casts that one value to a string # and returns one string # -&result_string := %{(string) (&control.NAS-Port[*])} -if !(&result_string == "456789") { +result_string := %{(string) (control.NAS-Port[*])} +if !(result_string == "456789") { test_fail } # -# &ref could return a list. +# ref could return a list. # # Which we then cast individually to the LHS # -&Called-Station-Id := &control.NAS-Port[*] -if !(&Called-Station-Id[0] == "456") { +Called-Station-Id := control.NAS-Port[*] +if !(Called-Station-Id[0] == "456") { test_fail } -if !(&Called-Station-Id[1] == "789") { +if !(Called-Station-Id[1] == "789") { test_fail } -&control -= &NAS-Port[*] +control -= NAS-Port[*] ok # separate updates -&result_string := %concat(%{control.[*]}, ', ') +result_string := %concat(%{control.[*]}, ', ') "%{result_string}" -if (!(&result_string == "bob, hello, ab c, de fg, 123")) { +if (!(result_string == "bob, hello, ab c, de fg, 123")) { test_fail } -&result_string := %concat(%{control.Calling-Station-Id[*]}, ', ') +result_string := %concat(%{control.Calling-Station-Id[*]}, ', ') -if (!(&result_string == "ab c, de fg")) { +if (!(result_string == "ab c, de fg")) { test_fail } # Empty separator -&result_string := %concat(%{control.Calling-Station-Id[*]}) +result_string := %concat(%{control.Calling-Station-Id[*]}) -if (!(&result_string == "ab cde fg")) { +if (!(result_string == "ab cde fg")) { test_fail } # Single character separator -&result_string := %concat(%{control.Calling-Station-Id[*]}, ',') +result_string := %concat(%{control.Calling-Station-Id[*]}, ',') -if (!(&result_string == "ab c,de fg")) { +if (!(result_string == "ab c,de fg")) { test_fail } # Multi character separator not delimited -&result_string := %concat(%{control.Calling-Station-Id[*]}, '|-') +result_string := %concat(%{control.Calling-Station-Id[*]}, '|-') -if !(&result_string == "ab c|-de fg") { +if !(result_string == "ab c|-de fg") { test_fail } diff --git a/src/tests/keywords/count-error b/src/tests/keywords/count-error index 1dfc6c383bb..5d3e5841ef5 100644 --- a/src/tests/keywords/count-error +++ b/src/tests/keywords/count-error @@ -1,2 +1,2 @@ string result_string -&result_string := &reply.Filter-Id[#] # ERROR +result_string := reply.Filter-Id[#] # ERROR diff --git a/src/tests/keywords/date b/src/tests/keywords/date index 81fbfad4656..aee33ed521e 100644 --- a/src/tests/keywords/date +++ b/src/tests/keywords/date @@ -8,86 +8,86 @@ string result_string2 date test_date # Use pre-defined date and time -&test_integer := 1506101100 +test_integer := 1506101100 # Convert to string representation -&result_string1 := %date(%{test_integer}) +result_string1 := %date(%{test_integer}) # Some systems report GMT some UTC... -if (!(&result_string1 == "Fri 22 Sep 17:25:00 GMT 2017")) && (!(&result_string1 == "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 -&result_integer := %date(%{result_string1}) +result_integer := %date(%{result_string1}) -if (!(&result_integer == &test_integer)) { +if (!(result_integer == test_integer)) { test_fail } # Compare two methods of reading request timestamp in local timezone -&result_string1 := %localdate(request) -&result_string2 := %S +result_string1 := %localdate(request) +result_string2 := %S -if (!(&result_string1 == &result_string2)) { +if (!(result_string1 == result_string2)) { test_fail } # Convert different string format -&result_string1 := "2017-09-22 17:25:00" +result_string1 := "2017-09-22 17:25:00" -&result_integer := %sqldate(%{result_string1}) +result_integer := %sqldate(%{result_string1}) -if (!(&result_integer == &test_integer)) { +if (!(result_integer == test_integer)) { test_fail } # Use a date attribute -&test_date := 1659985459 -&result_string1 := %sqldate(%{test_date}) +test_date := 1659985459 +result_string1 := %sqldate(%{test_date}) -if !(&result_string1 == '2022-08-08 19:04:19') { +if !(result_string1 == '2022-08-08 19:04:19') { test_fail } # Invalid format -&result_string1 := '201-32-22 17:25:00' -&result_string2 := %sqldate(%{result_string1}) +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 (&result_string2) { +if (result_string2) { test_fail } -if (!(&Module-Failure-Message == "Failed to parse time string \"201-32-22 17:25:00\" as format '\%Y-\%m-\%d \%H:\%M:\%S'")) { +if (!(Module-Failure-Message == "Failed to parse time string \"201-32-22 17:25:00\" as format '\%Y-\%m-\%d \%H:\%M:\%S'")) { test_fail } # Invalid type -&NAS-IP-Address := "192.168.1.1" -&result_string2 := %date(%{NAS-IP-Address}) +NAS-IP-Address := "192.168.1.1" +result_string2 := %date(%{NAS-IP-Address}) -if (&result_string2) { +if (result_string2) { test_fail } -if (!(&Module-Failure-Message == "Can't convert type ipaddr into date")) { +if (!(Module-Failure-Message == "Can't convert type ipaddr into date")) { test_fail } # # Do date comparisons # -if (&test_date != (date) 'Aug 8 2022 19:04:19 UTC') { +if (test_date != (date) 'Aug 8 2022 19:04:19 UTC') { test_fail } -if (&test_date < (date) 'Aug 8 2022 18:00:00 UTC') { +if (test_date < (date) 'Aug 8 2022 18:00:00 UTC') { test_fail } -if (&test_date > (date) 'Aug 9 2022 00:04:19 UTC') { +if (test_date > (date) 'Aug 9 2022 00:04:19 UTC') { test_fail } diff --git a/src/tests/keywords/debug b/src/tests/keywords/debug index 4bda461ebb9..788b99fafe5 100644 --- a/src/tests/keywords/debug +++ b/src/tests/keywords/debug @@ -4,7 +4,7 @@ uint32 test_integer string dummy_string -&test_integer := "%debug(4)" +test_integer := "%debug(4)" # Check debug level is now 4 if (!(%debug(3) == 4)) { diff --git a/src/tests/keywords/edit b/src/tests/keywords/edit index 289f65cf632..34075d587d4 100644 --- a/src/tests/keywords/edit +++ b/src/tests/keywords/edit @@ -3,20 +3,20 @@ # uint32 test_integer1 uint32 test_integer2 -&test_integer1 := 4 -&test_integer2 := 6 +test_integer1 := 4 +test_integer2 := 6 # # Many, many, years of work led up to this! # -&test_integer1 += 5 +test_integer1 += 5 -if (!(&test_integer1 == 9)) { +if (!(test_integer1 == 9)) { test_fail } -&test_integer1 += &test_integer2 -if (!(&test_integer1 == 15)) { +test_integer1 += test_integer2 +if (!(test_integer1 == 15)) { test_fail } diff --git a/src/tests/keywords/edit-add-create b/src/tests/keywords/edit-add-create index e17e34b9a72..6e436a75f86 100644 --- a/src/tests/keywords/edit-add-create +++ b/src/tests/keywords/edit-add-create @@ -7,34 +7,34 @@ uint32 test_integer2 uint32 test_integer3 group test_group -&test_integer1 += 4 -if !(&test_integer1 == 4) { +test_integer1 += 4 +if !(test_integer1 == 4) { test_fail } -&test_string += "bar" -if !(&test_string == "bar") { +test_string += "bar" +if !(test_string == "bar") { test_fail } -&test_group += { - &Filter-Id = "foo" +test_group += { + Filter-Id = "foo" } -if !&test_group { +if !test_group { test_fail } -if !(&test_group.Filter-Id == "foo") { +if !(test_group.Filter-Id == "foo") { test_fail } -&test_integer2 := 3 -&test_integer3 := 4 +test_integer2 := 3 +test_integer3 := 4 -&test_integer1 += &test_integer3 - &test_integer2 -if !(&test_integer1 == 5) { +test_integer1 += test_integer3 - test_integer2 +if !(test_integer1 == 5) { test_fail } diff --git a/src/tests/keywords/edit-attr-ref-null b/src/tests/keywords/edit-attr-ref-null index d08a229ed72..56c0061af2f 100644 --- a/src/tests/keywords/edit-attr-ref-null +++ b/src/tests/keywords/edit-attr-ref-null @@ -3,49 +3,49 @@ # # Form attribute references with xlats # -&request += { - &Filter-Id = 'foo' - &Filter-Id = 'bar' - &Calling-Station-Id = 'baz' +request += { + Filter-Id = 'foo' + Filter-Id = 'bar' + Calling-Station-Id = 'baz' } -&control = {} +control = {} if (!(%{Filter-Id[#]} == 2)) { test_fail } -if (!(&Filter-Id[0] == 'foo')) { +if (!(Filter-Id[0] == 'foo')) { test_fail } # # Delete an attribute by assigning a non-existent attribute to it # -&Filter-Id[1] := &Reply-Message +Filter-Id[1] := Reply-Message # Should only remove 'bar' -if !(&Filter-Id[0] == 'foo') { +if !(Filter-Id[0] == 'foo') { test_fail } -if (!(&Filter-Id[#] == 1)) { +if (!(Filter-Id[#] == 1)) { test_fail } # Nothing should exist for this attribute. -if (&Filter-Id[1]) { +if (Filter-Id[1]) { test_fail } -if (&Filter-Id[2]) { +if (Filter-Id[2]) { test_fail } -&Filter-Id := &Reply-Message +Filter-Id := Reply-Message # All instances should be removed -if (&Filter-Id) { +if (Filter-Id) { test_fail } diff --git a/src/tests/keywords/edit-comparison-assign b/src/tests/keywords/edit-comparison-assign index ae7b7f26406..ddbb5c1d176 100644 --- a/src/tests/keywords/edit-comparison-assign +++ b/src/tests/keywords/edit-comparison-assign @@ -2,15 +2,15 @@ group { uint32 small uint32 large - &large = 10000 - &small = 10 + large = 10000 + small = 10 # # Enforce it # - &large <= &small + large <= small - if !(&large == &small) { + if !(large == small) { test_fail } diff --git a/src/tests/keywords/edit-eval-rhs b/src/tests/keywords/edit-eval-rhs index fb02a1b765a..afa41fad6bc 100644 --- a/src/tests/keywords/edit-eval-rhs +++ b/src/tests/keywords/edit-eval-rhs @@ -1,11 +1,11 @@ uint32 foo -&Tmp-Integer-0 := 1 -&Tmp-Integer-1 := { 3, 6, 9 } +Tmp-Integer-0 := 1 +Tmp-Integer-1 := { 3, 6, 9 } -&foo = %eval(%{'%{Tmp-Integer-1[' + "%{Tmp-Integer-0}" + ']}'}) +foo = %eval(%{'%{Tmp-Integer-1[' + "%{Tmp-Integer-0}" + ']}'}) -if (&foo != 6) { +if (foo != 6) { test_fail } diff --git a/src/tests/keywords/edit-group b/src/tests/keywords/edit-group index 01366adcb39..1d8a7685b75 100644 --- a/src/tests/keywords/edit-group +++ b/src/tests/keywords/edit-group @@ -10,20 +10,20 @@ string test_string3 # them are rolled back. # transaction { - &test_string1 := "foo" - &test_string2 -= "bar" # fails, no existing test_string2 - &test_string3 := "bar" + test_string1 := "foo" + test_string2 -= "bar" # fails, no existing test_string2 + test_string3 := "bar" } -if (&test_string1) { +if (test_string1) { test_fail } -if (&test_string2) { +if (test_string2) { test_fail } -if (&test_string3) { +if (test_string3) { test_fail } @@ -31,20 +31,20 @@ if (&test_string3) { # All of these succeed individually, so all of them should succeed. # transaction { - &test_string1 := "foo" - &test_string2 := "yup" - &test_string3 := "bar" + test_string1 := "foo" + test_string2 := "yup" + test_string3 := "bar" } -if (!(&test_string1 == "foo")) { +if (!(test_string1 == "foo")) { test_fail } -if (!(&test_string2 == "yup")) { +if (!(test_string2 == "yup")) { test_fail } -if (!(&test_string3 == "bar")) { +if (!(test_string3 == "bar")) { test_fail } diff --git a/src/tests/keywords/edit-intersection b/src/tests/keywords/edit-intersection index 4995717f1c4..48d699e903a 100644 --- a/src/tests/keywords/edit-intersection +++ b/src/tests/keywords/edit-intersection @@ -2,33 +2,33 @@ # PRE: edit-list # -&control.Filter-Id := "foo" -&reply.Filter-Id := "foo" +control.Filter-Id := "foo" +reply.Filter-Id := "foo" -&reply &= &control +reply &= control # must exist -if (!&reply.Filter-Id) { +if (!reply.Filter-Id) { test_fail } # and have the correct value -if (!(&reply.Filter-Id == "foo")) { +if (!(reply.Filter-Id == "foo")) { test_fail } # reset -&reply -= &Filter-Id[*] +reply -= Filter-Id[*] # # Same attribute, but different value # -&reply.Filter-Id := "bar" +reply.Filter-Id := "bar" -&reply &= &control +reply &= control # must NOT exist -if (&reply.Filter-Id) { +if (reply.Filter-Id) { test_fail } diff --git a/src/tests/keywords/edit-leaf b/src/tests/keywords/edit-leaf index f829b06a1fd..f997a2ae604 100644 --- a/src/tests/keywords/edit-leaf +++ b/src/tests/keywords/edit-leaf @@ -2,12 +2,12 @@ string test_string1 string test_string2 string test_string3 -&test_string1 := "foo" -&test_string2 := &test_string1 -&test_string3 := "test_string1" +test_string1 := "foo" +test_string2 := test_string1 +test_string3 := "test_string1" # foo, bar, "foo", "foo" -&Filter-Id := { &test_string1, "bar", "%{test_string1}", %{test_string3} } +Filter-Id := { test_string1, "bar", "%{test_string1}", %{test_string3} } if (!(%{Filter-Id[#]} == 4)) { diff --git a/src/tests/keywords/edit-leaf-delete b/src/tests/keywords/edit-leaf-delete index 6a0b3484879..8a300605972 100644 --- a/src/tests/keywords/edit-leaf-delete +++ b/src/tests/keywords/edit-leaf-delete @@ -1,17 +1,17 @@ uint32 foo -&foo := 42 +foo := 42 -if !(&foo == 42) { +if !(foo == 42) { test_fail } # # This is "delete" # -&foo := {} +foo := {} -if &foo { +if foo { test_fail } success diff --git a/src/tests/keywords/edit-leaf-error b/src/tests/keywords/edit-leaf-error index db241bf53e6..4996d2e6d29 100644 --- a/src/tests/keywords/edit-leaf-error +++ b/src/tests/keywords/edit-leaf-error @@ -1,9 +1,9 @@ uint32 foo -&foo := 42 +foo := 42 -if !(&foo == 42) { +if !(foo == 42) { test_fail } -&foo += {} # ERROR not allowed! +foo += {} # ERROR not allowed! diff --git a/src/tests/keywords/edit-leaf-list-add b/src/tests/keywords/edit-leaf-list-add index 8bbf0c18b87..b672dbb02b2 100644 --- a/src/tests/keywords/edit-leaf-list-add +++ b/src/tests/keywords/edit-leaf-list-add @@ -1,12 +1,12 @@ -&NAS-Port := 1 -&NAS-Port += { 11, 17, 19, 23 } +NAS-Port := 1 +NAS-Port += { 11, 17, 19, 23 } -if !(&NAS-Port[#] == 1) { +if !(NAS-Port[#] == 1) { test_fail } -if !(&NAS-Port == 71) { +if !(NAS-Port == 71) { test_fail } diff --git a/src/tests/keywords/edit-leaf-multivalue b/src/tests/keywords/edit-leaf-multivalue index 757e0d15a7b..0e97c938d7c 100644 --- a/src/tests/keywords/edit-leaf-multivalue +++ b/src/tests/keywords/edit-leaf-multivalue @@ -1,39 +1,39 @@ # # PRE: edit # -&Filter-Id := { +Filter-Id := { "foo %{User-Name}", "bar", "baz", - &User-Name + User-Name } if (!(%{request.Filter-Id[#]} == 4)) { test_fail } -if (!(&Filter-Id[0] == "foo bob")) { +if (!(Filter-Id[0] == "foo bob")) { test_fail } -if (!(&Filter-Id[1] == "bar")) { +if (!(Filter-Id[1] == "bar")) { test_fail } -if (!(&Filter-Id[2] == "baz")) { +if (!(Filter-Id[2] == "baz")) { test_fail } -if (!(&Filter-Id[3] == "bob")) { +if (!(Filter-Id[3] == "bob")) { test_fail } # # And test non-string things # -&Filter-Id := "127" +Filter-Id := "127" -&Framed-IP-Address := { +Framed-IP-Address := { "%{Filter-Id}.0.0.1", 192.0.2.1 } @@ -42,11 +42,11 @@ if (!(%{request.Framed-IP-Address[#]} == 2)) { test_fail } -if (!(&Framed-IP-Address[0] == 127.0.0.1)) { +if (!(Framed-IP-Address[0] == 127.0.0.1)) { test_fail } -if (!(&Framed-IP-Address[1] == 192.0.2.1)) { +if (!(Framed-IP-Address[1] == 192.0.2.1)) { test_fail } diff --git a/src/tests/keywords/edit-leaf-octets b/src/tests/keywords/edit-leaf-octets index e6b3d5704b4..d9bb960f86f 100644 --- a/src/tests/keywords/edit-leaf-octets +++ b/src/tests/keywords/edit-leaf-octets @@ -2,13 +2,13 @@ # PRE: edit # -&Framed-IP-Address := 0x7f000001 +Framed-IP-Address := 0x7f000001 -if (!&Framed-IP-Address) { +if (!Framed-IP-Address) { test_fail } -if (!(&Framed-IP-Address == 127.0.0.1)) { +if (!(Framed-IP-Address == 127.0.0.1)) { test_fail } diff --git a/src/tests/keywords/edit-leaf-star b/src/tests/keywords/edit-leaf-star index b347c2566c1..17f1db3c130 100644 --- a/src/tests/keywords/edit-leaf-star +++ b/src/tests/keywords/edit-leaf-star @@ -3,28 +3,28 @@ # uint32 result_integer -&NAS-Port := { 1, 3, 5, 7, 11 } +NAS-Port := { 1, 3, 5, 7, 11 } # # Do operations on sets of inputs. # -&result_integer += &NAS-Port[*] -if (!(&result_integer == 27)) { +result_integer += NAS-Port[*] +if (!(result_integer == 27)) { test_fail } # # We should be able to copy multiple attributes # -&Port-Limit := &NAS-Port[*] -&result_integer := 0 +Port-Limit := NAS-Port[*] +result_integer := 0 # # Do operations on sets of inputs. # -&result_integer += &Port-Limit[*] -if (!(&result_integer == 27)) { +result_integer += Port-Limit[*] +if (!(result_integer == 27)) { test_fail } diff --git a/src/tests/keywords/edit-list b/src/tests/keywords/edit-list index ed02d524270..9301021ccb8 100644 --- a/src/tests/keywords/edit-list +++ b/src/tests/keywords/edit-list @@ -2,40 +2,40 @@ # PRE: edit # -&control.Filter-Id := "foo" +control.Filter-Id := "foo" # Doesn't exist -if (&Filter-Id) { +if (Filter-Id) { test_fail } # append -&request += &control +request += control # Does exist, and is the last attribute -if (!&Filter-Id[n]) { +if (!Filter-Id[n]) { test_fail } -&request -= &Filter-Id[*] +request -= Filter-Id[*] # Doesn't exist -if (&Filter-Id) { +if (Filter-Id) { test_fail } # prepend -&request ^= &control +request ^= control # Does exist, and is at offset 0 -if (!&Filter-Id[0]) { +if (!Filter-Id[0]) { test_fail } -&request -= &Filter-Id[*] -&control.Filter-Id := { "a", "b", "c", "d" } +request -= Filter-Id[*] +control.Filter-Id := { "a", "b", "c", "d" } -&request += &control.Filter-Id[*] +request += control.Filter-Id[*] if (!(%{request.Filter-Id[#]} == 4)) { test_fail } diff --git a/src/tests/keywords/edit-list-eq b/src/tests/keywords/edit-list-eq index ab647f4c8e1..8b85b6850a7 100644 --- a/src/tests/keywords/edit-list-eq +++ b/src/tests/keywords/edit-list-eq @@ -1,30 +1,30 @@ # # PRE: if edit-list # -&control.Filter-Id = { 'A', 'B' } +control.Filter-Id = { 'A', 'B' } if !(%{control.Filter-Id[#]} == 2) { test_fail } -if !(&control.Filter-Id[1] == 'B') { +if !(control.Filter-Id[1] == 'B') { test_fail } # # Add of SECOND bit fails # -&control.Filter-Id = { 'C', 'D' } +control.Filter-Id = { 'C', 'D' } if !(%{control.Filter-Id[#]} == 2) { test_fail } -if !(&control.Filter-Id[0] == 'A') { +if !(control.Filter-Id[0] == 'A') { test_fail } -if !(&control.Filter-Id[1] == 'B') { +if !(control.Filter-Id[1] == 'B') { test_fail } diff --git a/src/tests/keywords/edit-list-levels b/src/tests/keywords/edit-list-levels index 2269b927d90..e841c3fef28 100644 --- a/src/tests/keywords/edit-list-levels +++ b/src/tests/keywords/edit-list-levels @@ -1,11 +1,11 @@ # # PRE: edit-list # -&control.TLS-Certificate := { - &Issuer = "test" +control.TLS-Certificate := { + Issuer = "test" } -if !(&control.TLS-Certificate.Issuer == "test") { +if !(control.TLS-Certificate.Issuer == "test") { test_fail } diff --git a/src/tests/keywords/edit-list-lhs-error b/src/tests/keywords/edit-list-lhs-error index 8da96eda66e..f7a496e8b27 100644 --- a/src/tests/keywords/edit-list-lhs-error +++ b/src/tests/keywords/edit-list-lhs-error @@ -3,6 +3,6 @@ # # The name on the LHS MUST be given in the context of the parent. # -&reply += { - &request.User-Name = "foo" # ERROR +reply += { + request.User-Name = "foo" # ERROR } diff --git a/src/tests/keywords/edit-list-remove b/src/tests/keywords/edit-list-remove index a8cebb96178..226a094f1d8 100644 --- a/src/tests/keywords/edit-list-remove +++ b/src/tests/keywords/edit-list-remove @@ -2,71 +2,71 @@ # PRE: edit-list # -&request += { - &Class = 0x00 - &Filter-Id = "foo" - &NAS-Port = 1 +request += { + Class = 0x00 + Filter-Id = "foo" + NAS-Port = 1 } # Does exist -if (!&Filter-Id) { +if (!Filter-Id) { test_fail } # Remove the first one -&request -= &Filter-Id +request -= Filter-Id # Does not exist -if (&Filter-Id) { +if (Filter-Id) { test_fail } # Other things still exist -if (!&Class) { +if (!Class) { test_fail } -if (!&NAS-Port) { +if (!NAS-Port) { test_fail } # # Add multiple of the same type # -&request += { - &Filter-Id = "foo" - &Filter-Id = "bar" - &Filter-Id = "baz" +request += { + Filter-Id = "foo" + Filter-Id = "bar" + Filter-Id = "baz" } -if (!&Filter-Id) { +if (!Filter-Id) { test_fail } -&request -= &Filter-Id[0] +request -= Filter-Id[0] # the first one has been removed -if (!(&Filter-Id[0] == "bar")) { +if (!(Filter-Id[0] == "bar")) { test_fail } # Other things still exist -if (!&Class) { +if (!Class) { test_fail } -if (!&NAS-Port) { +if (!NAS-Port) { test_fail } -&request -= &Filter-Id[*] +request -= Filter-Id[*] # Does not exist -if (&Filter-Id) { +if (Filter-Id) { test_fail } -&Filter-Id := { "foo", "bar", "baz" } +Filter-Id := { "foo", "bar", "baz" } # # Remove one by value. @@ -74,31 +74,31 @@ if (&Filter-Id) { # @todo - allow for == or =~ in the RHS list, # as a condition? For now, it's an exact match. :( # -&request -= { - &Filter-Id == "bar" +request -= { + Filter-Id == "bar" } -if (!(&Filter-Id[0] == "foo")) { +if (!(Filter-Id[0] == "foo")) { test_fail } -if (!(&Filter-Id[1] == "baz")) { +if (!(Filter-Id[1] == "baz")) { test_fail } -if (&Filter-Id[2]) { +if (Filter-Id[2]) { test_fail } # # Remove via in-place list, too. # -&request -= "Filter-Id == 'foo'" -if (!(&Filter-Id[0] == "baz")) { +request -= "Filter-Id == 'foo'" +if (!(Filter-Id[0] == "baz")) { test_fail } -if (&Filter-Id[1]) { +if (Filter-Id[1]) { test_fail } diff --git a/src/tests/keywords/edit-list-remove-error b/src/tests/keywords/edit-list-remove-error index 26542349538..e23b58843df 100644 --- a/src/tests/keywords/edit-list-remove-error +++ b/src/tests/keywords/edit-list-remove-error @@ -3,6 +3,6 @@ # # Instead of doing something wrong, we forbid it with a descriptive error. # -&control -= { - &Password.Cleartext == 'oracle01' # ERROR +control -= { + Password.Cleartext == 'oracle01' # ERROR } \ No newline at end of file diff --git a/src/tests/keywords/edit-list-remove-reply b/src/tests/keywords/edit-list-remove-reply index ae439f1458c..a04d60a9ed2 100644 --- a/src/tests/keywords/edit-list-remove-reply +++ b/src/tests/keywords/edit-list-remove-reply @@ -1,15 +1,15 @@ -&reply.Reply-Message := "foo" -if (!&reply.Reply-Message) { +reply.Reply-Message := "foo" +if (!reply.Reply-Message) { test_fail } # # The default list here is the LHS list, not "request". # -&reply -= &Reply-Message[*] +reply -= Reply-Message[*] # Does not exist -if (&reply.Reply-Message) { +if (reply.Reply-Message) { test_fail } diff --git a/src/tests/keywords/edit-list-reset b/src/tests/keywords/edit-list-reset index fc584eafb6f..bfd4496a2c8 100644 --- a/src/tests/keywords/edit-list-reset +++ b/src/tests/keywords/edit-list-reset @@ -2,20 +2,20 @@ # PRE: edit-list # -&control.Filter-Id := "foo" +control.Filter-Id := "foo" # must exist -if (!&control.Filter-Id) { +if (!control.Filter-Id) { test_fail } # # Reset the list to empty contents # -&control := {} +control := {} # must not exist -if (&control.Filter-Id) { +if (control.Filter-Id) { test_fail } diff --git a/src/tests/keywords/edit-list-star b/src/tests/keywords/edit-list-star index d8a33e24b51..1df3bdad05b 100644 --- a/src/tests/keywords/edit-list-star +++ b/src/tests/keywords/edit-list-star @@ -4,22 +4,22 @@ group test_group1 group test_group2 -&test_group1.NAS-Port := { 1, 3, 5, 7, 11 } -&Port-Limit := 0 +test_group1.NAS-Port := { 1, 3, 5, 7, 11 } +Port-Limit := 0 # # Do operations on sets of inputs. # -&Port-Limit += &test_group1.NAS-Port[*] -if (!(&Port-Limit == 27)) { +Port-Limit += test_group1.NAS-Port[*] +if (!(Port-Limit == 27)) { test_fail } -&test_group2 := &test_group1 -&Port-Limit := 0 +test_group2 := test_group1 +Port-Limit := 0 -&Port-Limit += &test_group2.NAS-Port[*] -if (!(&Port-Limit == 27)) { +Port-Limit += test_group2.NAS-Port[*] +if (!(Port-Limit == 27)) { test_fail } diff --git a/src/tests/keywords/edit-list-string b/src/tests/keywords/edit-list-string index 8885ffdd521..4367ad657cd 100644 --- a/src/tests/keywords/edit-list-string +++ b/src/tests/keywords/edit-list-string @@ -8,9 +8,9 @@ # # The purpose of this functionality is mainly for xlat, exec, etc. # -&control += "NAS-Port = 9" +control += "NAS-Port = 9" -if (!(&control.NAS-Port == 9)) { +if (!(control.NAS-Port == 9)) { test_fail } diff --git a/src/tests/keywords/edit-merge b/src/tests/keywords/edit-merge index 38b45fad979..f6d5cf7ce95 100644 --- a/src/tests/keywords/edit-merge +++ b/src/tests/keywords/edit-merge @@ -8,23 +8,23 @@ # = A' MERGE B' if A and B are lists # -&Filter-Id := "foo" -&control.Filter-Id := "bar" +Filter-Id := "foo" +control.Filter-Id := "bar" # merge -&request >= &control +request >= control -if (!&Filter-Id) { +if (!Filter-Id) { test_fail } # The original value should be unchanged -if (!(&Filter-Id == "foo")) { +if (!(Filter-Id == "foo")) { test_fail } # and the new value should not be there -if (&Filter-Id == "bar") { +if (Filter-Id == "bar") { test_fail } diff --git a/src/tests/keywords/edit-merge-lhs b/src/tests/keywords/edit-merge-lhs index 604c92d6f04..26abe75dafc 100644 --- a/src/tests/keywords/edit-merge-lhs +++ b/src/tests/keywords/edit-merge-lhs @@ -8,23 +8,23 @@ # = A' MERGE B' if A and B are lists # -&Filter-Id := "foo" -&control.Filter-Id := "bar" +Filter-Id := "foo" +control.Filter-Id := "bar" # merge -&request <= &control +request <= control -if (!&Filter-Id) { +if (!Filter-Id) { test_fail } # we want the *control* version -if (!(&Filter-Id == "bar")) { +if (!(Filter-Id == "bar")) { test_fail } # and the original value should not be there -if (&Filter-Id == "foo") { +if (Filter-Id == "foo") { test_fail } diff --git a/src/tests/keywords/edit-multivalue b/src/tests/keywords/edit-multivalue index ca947561087..56c4714ceae 100644 --- a/src/tests/keywords/edit-multivalue +++ b/src/tests/keywords/edit-multivalue @@ -2,14 +2,14 @@ string foo string bar string baz -&baz = "a,b,c,d,e" +baz = "a,b,c,d,e" # # Append, don't create multiple versions # -&bar += %explode(%{baz}, ',') +bar += %explode(%{baz}, ',') -if !(&bar == "abcde") { +if !(bar == "abcde") { test_fail } @@ -19,50 +19,50 @@ if !(&bar == "abcde") { # We cannot have multiple copies of local variables. There's no real # reason why, but for now it's safer to be limited. # -&foo := %explode(%{baz}, ',') -if !(&foo[#] == 1) { +foo := %explode(%{baz}, ',') +if !(foo[#] == 1) { test_fail } # # Append # -&Reply-Message = "foo" +Reply-Message = "foo" -&Reply-Message += { "a", "b", "c" } +Reply-Message += { "a", "b", "c" } # # This seems wrong and inconsistent with Filter-Id below??? # -if !(&Reply-Message == "fooabc") { +if !(Reply-Message == "fooabc") { test_fail } -&Filter-Id := { "a", "b", "c" } -if !(&Filter-Id[#] == 3) { +Filter-Id := { "a", "b", "c" } +if !(Filter-Id[#] == 3) { test_fail } # # List by reference # -&foo := "" -&foo += &Filter-Id[*] -if !(&foo == "abc") { +foo := "" +foo += Filter-Id[*] +if !(foo == "abc") { test_fail } -&request -= &Reply-Message +request -= Reply-Message # # Attribute references in in-place lists work. # -&Reply-Message := { &Filter-ID[2], &Filter-ID[1], &Filter-ID[0] } -if !(&Reply-Message[#] == 3) { +Reply-Message := { Filter-ID[2], Filter-ID[1], Filter-ID[0] } +if !(Reply-Message[#] == 3) { test_fail } -if (&Reply-Message[0] != 'c') { +if (Reply-Message[0] != 'c') { test_fail } @@ -70,9 +70,9 @@ if (&Reply-Message[0] != 'c') { # This would make sense, but it doesn't work. Instead it says: # # Missing attribute value -# Failed creating map from '&Reply-Message = (null)' +# Failed creating map from 'Reply-Message = (null)' # -#&Tmp-Group-0 := { &Reply-Message, &Filter-Id } +#Tmp-Group-0 := { Reply-Message, Filter-Id } success diff --git a/src/tests/keywords/edit-nested b/src/tests/keywords/edit-nested index b2e4a040007..83fd5ef3b00 100644 --- a/src/tests/keywords/edit-nested +++ b/src/tests/keywords/edit-nested @@ -1,32 +1,32 @@ # # PRE: if edit-list # -&control.User-Name := "foo" +control.User-Name := "foo" # # Create a nested group. # -# @todo - we only support ONE layer of nesting under &control, -# &request, etc. for now. We should support more. +# @todo - we only support ONE layer of nesting under control, +# request, etc. for now. We should support more. # -&control.Tmp-Group-0 := { - &NAS-Port = 1 +control.Tmp-Group-0 := { + NAS-Port = 1 } -if (!&control.Tmp-Group-0.NAS-Port) { +if (!control.Tmp-Group-0.NAS-Port) { test_fail } -if (!(&control.Tmp-Group-0.NAS-Port == 1)) { +if (!(control.Tmp-Group-0.NAS-Port == 1)) { test_fail } # # Edit it in place. # -&control.Tmp-Group-0.NAS-Port += 5 +control.Tmp-Group-0.NAS-Port += 5 -if (!(&control.Tmp-Group-0.NAS-Port == 6)) { +if (!(control.Tmp-Group-0.NAS-Port == 6)) { test_fail } @@ -35,9 +35,9 @@ if (!(&control.Tmp-Group-0.NAS-Port == 6)) { # # @todo - look FIRST for attributes in the current group? # -&control.Tmp-Group-0 -= &control.Tmp-Group-0.NAS-Port +control.Tmp-Group-0 -= control.Tmp-Group-0.NAS-Port -if (&control.Tmp-Group-0.NAS-Port) { +if (control.Tmp-Group-0.NAS-Port) { test_fail } @@ -48,26 +48,26 @@ if (&control.Tmp-Group-0.NAS-Port) { # # Append something to it # -&control.Tmp-Group-0 += { - &Framed-IP-Address = 127.0.0.1 +control.Tmp-Group-0 += { + Framed-IP-Address = 127.0.0.1 } -if (!(&control.Tmp-Group-0.Framed-IP-Address == 127.0.0.1)) { +if (!(control.Tmp-Group-0.Framed-IP-Address == 127.0.0.1)) { test_fail } # # Multiple members # -&control.Tmp-Group-0 += { - &Class = 0xabcdef +control.Tmp-Group-0 += { + Class = 0xabcdef } -if (!(&control.Tmp-Group-0.Framed-IP-Address == 127.0.0.1)) { +if (!(control.Tmp-Group-0.Framed-IP-Address == 127.0.0.1)) { test_fail } -if (!(&control.Tmp-Group-0.Class == 0xabcdef)) { +if (!(control.Tmp-Group-0.Class == 0xabcdef)) { test_fail } diff --git a/src/tests/keywords/edit-remove-index b/src/tests/keywords/edit-remove-index index b38a51b8475..eff17109415 100644 --- a/src/tests/keywords/edit-remove-index +++ b/src/tests/keywords/edit-remove-index @@ -1,21 +1,21 @@ # # PRE: if edit # -&request += { - &Framed-IP-Address = 192.0.2.1 - &Framed-IP-Address = 192.0.2.2 +request += { + Framed-IP-Address = 192.0.2.1 + Framed-IP-Address = 192.0.2.2 } # # Delete only the second one # -&request.Framed-IP-Address[1] := {} +request.Framed-IP-Address[1] := {} -if (&Framed-IP-Address[#] != 1) { +if (Framed-IP-Address[#] != 1) { test_fail } -if !(&Framed-IP-Address[0] == 192.0.2.1) { +if !(Framed-IP-Address[0] == 192.0.2.1) { test_fail } diff --git a/src/tests/keywords/edit-rhs-error b/src/tests/keywords/edit-rhs-error index 1581768ae30..ad948800715 100644 --- a/src/tests/keywords/edit-rhs-error +++ b/src/tests/keywords/edit-rhs-error @@ -2,4 +2,4 @@ # The RHS isn't a number or an enum # uint32 a -&a := '$[3][2]' # ERROR +a := '$[3][2]' # ERROR diff --git a/src/tests/keywords/edit-rhs-group b/src/tests/keywords/edit-rhs-group index e6698f98db9..ad0b9beaead 100644 --- a/src/tests/keywords/edit-rhs-group +++ b/src/tests/keywords/edit-rhs-group @@ -1,30 +1,30 @@ # # PRE: edit-list # -&request += { - &Tmp-Group-0 = {} +request += { + Tmp-Group-0 = {} } -if (!&request.Tmp-Group-0) { +if (!request.Tmp-Group-0) { test_fail } -&request.Tmp-Group-0 += { - &User-Name = "hello" +request.Tmp-Group-0 += { + User-Name = "hello" } -if !(&request.Tmp-Group-0.User-Name == "hello") { +if !(request.Tmp-Group-0.User-Name == "hello") { test_fail } -&request.Tmp-Group-0 += { - &Tmp-Group-1 = { - &User-Name = "foo" +request.Tmp-Group-0 += { + Tmp-Group-1 = { + User-Name = "foo" } } -if !(&request.Tmp-Group-0.Tmp-Group-1.User-Name == "foo") { +if !(request.Tmp-Group-0.Tmp-Group-1.User-Name == "foo") { test_fail } diff --git a/src/tests/keywords/edit-session-state b/src/tests/keywords/edit-session-state index e80c9d01c4f..3a63a95e2f2 100644 --- a/src/tests/keywords/edit-session-state +++ b/src/tests/keywords/edit-session-state @@ -1,11 +1,11 @@ # # PRE: edit # -&session-state += { - &User-Name = "foo" +session-state += { + User-Name = "foo" } -if !(&session-state.User-Name == "foo") { +if !(session-state.User-Name == "foo") { test_fail } diff --git a/src/tests/keywords/edit-set-fail b/src/tests/keywords/edit-set-fail index 8ad79e32fc5..b51bb2de083 100644 --- a/src/tests/keywords/edit-set-fail +++ b/src/tests/keywords/edit-set-fail @@ -4,20 +4,20 @@ # It should still nuke the LHS attributes # -&NAS-Port := 1812 -if !(&NAS-Port == 1812) { +NAS-Port := 1812 +if !(NAS-Port == 1812) { test_fail } # # Service-Type doesn't exist, so the ":=" means "delete everything" # -&NAS-Port := (integer) &Service-Type +NAS-Port := (integer) Service-Type # # This should no longer exist. # -if &NAS-Port { +if NAS-Port { test_fail } diff --git a/src/tests/keywords/edit-shift b/src/tests/keywords/edit-shift index 926b450b846..bc007c4a241 100644 --- a/src/tests/keywords/edit-shift +++ b/src/tests/keywords/edit-shift @@ -3,21 +3,21 @@ octets foo # # left shift octets # -&foo := 0xabcdef -&foo <<= 2 +foo := 0xabcdef +foo <<= 2 -if (&foo != 0xef) { +if (foo != 0xef) { test_fail } # # And right shift # -&foo := 0xabcdef +foo := 0xabcdef -&foo >>= 2 -if (&foo != 0xab) { +foo >>= 2 +if (foo != 0xab) { test_fail } success diff --git a/src/tests/keywords/edit-star-error b/src/tests/keywords/edit-star-error index 09c63648fb2..2454633393a 100644 --- a/src/tests/keywords/edit-star-error +++ b/src/tests/keywords/edit-star-error @@ -1,4 +1,4 @@ # # Some old operators are not allowed. # -&reply.Filter-Id !* ANY # ERROR +reply.Filter-Id !* ANY # ERROR diff --git a/src/tests/keywords/edit-string b/src/tests/keywords/edit-string index 0f04709a7bc..f97c08589dc 100644 --- a/src/tests/keywords/edit-string +++ b/src/tests/keywords/edit-string @@ -2,26 +2,26 @@ # PRE: edit # string test_string -&test_string := "foo" -&test_string ^= "bar" +test_string := "foo" +test_string ^= "bar" -if (!(&test_string == "barfoo")) { +if (!(test_string == "barfoo")) { test_fail } -&test_string := "foo" -&test_string += "bar" +test_string := "foo" +test_string += "bar" -if (!(&test_string == "foobar")) { +if (!(test_string == "foobar")) { test_fail } # # Subtract is the inverse of add. # -&test_string -= "bar" +test_string -= "bar" -if (!(&test_string == "foo")) { +if (!(test_string == "foo")) { test_fail } diff --git a/src/tests/keywords/edit-underflow b/src/tests/keywords/edit-underflow index 2d69d8600df..6c398742ae0 100644 --- a/src/tests/keywords/edit-underflow +++ b/src/tests/keywords/edit-underflow @@ -4,26 +4,26 @@ uint32 two # # PRE: edit # -&one := 4 -&two := 5 +one := 4 +two := 5 # # First modification succeeds. The second modification fails, which # also reverts the changes to the first one. # transaction { - &one += 5 - &two -= 16 # Run-time underflow! + one += 5 + two -= 16 # Run-time underflow! } # # The various edits above should have been reverted. # -if !(&one == 4) { +if !(one == 4) { test_fail } -if !(&two == 5) { +if !(two == 5) { test_fail } success diff --git a/src/tests/keywords/edit-union b/src/tests/keywords/edit-union index 6060671e66f..5ec22dd149f 100644 --- a/src/tests/keywords/edit-union +++ b/src/tests/keywords/edit-union @@ -8,23 +8,23 @@ # = A' UNION B' if A and B are lists # -&Reply-Message := "foo" -&control.Reply-Message := "bar" +Reply-Message := "foo" +control.Reply-Message := "bar" # union -&request |= &control +request |= control -if (!&Reply-Message) { +if (!Reply-Message) { test_fail } # The original value should be unchanged -if (!(&Reply-Message[0] == "foo")) { +if (!(Reply-Message[0] == "foo")) { test_fail } # and the new value should be there, too -if (!(&Reply-Message[1] == "bar")) { +if (!(Reply-Message[1] == "bar")) { test_fail } diff --git a/src/tests/keywords/else-empty b/src/tests/keywords/else-empty index cbe07e4e09a..9e89e809339 100644 --- a/src/tests/keywords/else-empty +++ b/src/tests/keywords/else-empty @@ -2,7 +2,7 @@ # PRE: if-empty-allow # -if (&User-Name == 'bob') { +if (User-Name == 'bob') { ok } else { diff --git a/src/tests/keywords/else-error b/src/tests/keywords/else-error index 82a99e510ba..c61534da514 100644 --- a/src/tests/keywords/else-error +++ b/src/tests/keywords/else-error @@ -4,7 +4,7 @@ # "else" has to be preceded by an "if" or "elsif" # if (1) { - &control.Password.Cleartext := "fail" + control.Password.Cleartext := "fail" else { # ERROR ok diff --git a/src/tests/keywords/enum-name b/src/tests/keywords/enum-name index 1220606fd50..4b8793c70b5 100644 --- a/src/tests/keywords/enum-name +++ b/src/tests/keywords/enum-name @@ -1,6 +1,6 @@ -&Service-Type := ::Framed-User +Service-Type := ::Framed-User -if !(&Service-Type == ::Framed-User) { +if !(Service-Type == ::Framed-User) { test_fail } diff --git a/src/tests/keywords/escape b/src/tests/keywords/escape index 307e2e14551..233f532aa17 100644 --- a/src/tests/keywords/escape +++ b/src/tests/keywords/escape @@ -11,33 +11,33 @@ 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' +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 -&test_string7 := 'ŒČÿ' -&test_string8 := 'Œ=C4=8Cÿ' +test_string7 := 'ŒČÿ' +test_string8 := 'Œ=C4=8Cÿ' # = not followed by hex and without 2 following chars -&test_string9 := 'a=Az=y' +test_string9 := 'a=Az=y' -if (!((string)%escape.escape("%{test_string1}") == &test_string1)) { +if (!((string)%escape.escape("%{test_string1}") == test_string1)) { test_fail } -if (!((string)%escape.escape("%{test_string2}") == &test_string4)) { +if (!((string)%escape.escape("%{test_string2}") == test_string4)) { test_fail } -if (!((string)%escape.escape("%{test_string3}") == &test_string5)) { +if (!((string)%escape.escape("%{test_string3}") == test_string5)) { test_fail } -if (!((string)%escape.unescape("%{test_string1}") == &test_string1)) { +if (!((string)%escape.unescape("%{test_string1}") == test_string1)) { test_fail } @@ -45,19 +45,19 @@ if (!((string)%escape.unescape("%{test_string4}") == "%{test_string2}")) { test_fail } -if (!((string)%escape.unescape("%{test_string5}") == &test_string3)) { +if (!((string)%escape.unescape("%{test_string5}") == test_string3)) { test_fail } -if (!((string)%escape.escape("%{test_string7}") == &test_string8)) { +if (!((string)%escape.escape("%{test_string7}") == test_string8)) { test_fail } -if (!((string)%escape.unescape("%{test_string8}") == &test_string7)) { +if (!((string)%escape.unescape("%{test_string8}") == test_string7)) { test_fail } -if (!((string)%escape.unescape("%{test_string9}") == &test_string9)) { +if (!((string)%escape.unescape("%{test_string9}") == test_string9)) { test_fail } diff --git a/src/tests/keywords/escape-sequences b/src/tests/keywords/escape-sequences index 459bcfc09f2..6790f337a9f 100644 --- a/src/tests/keywords/escape-sequences +++ b/src/tests/keywords/escape-sequences @@ -5,19 +5,19 @@ octets test_octets ipaddr test_ipaddr string result_string -&test_octets := 0x69206861766520736361727920656d626564646564207468696e67730020696e73696465206d65 -&test_ipaddr := 127.0.0.1 -&request += { - &Reply-Message = "i have scary embedded things\000 inside me" - &Reply-Message = "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°" +test_octets := 0x69206861766520736361727920656d626564646564207468696e67730020696e73696465206d65 +test_ipaddr := 127.0.0.1 +request += { + 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' - &Callback-Number = 'i have scary embedded things\000 inside me' - &Callback-Number = '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°' - &Callback-Id = 'i have scary embedded things\000 inside me' - &Callback-Id = "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°" + Callback-Id = 'i have scary embedded things\000 inside me' + Callback-Id = "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°" } @@ -29,18 +29,18 @@ if (!(%length(%{Callback-Number}) == 42)) { test_fail } -&result_string := "%{(string) %{test_octets}}" -if (!(&result_string == "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 (!(&Reply-Message == "i have scary embedded things\000 inside me")) { +if (!(Reply-Message == "i have scary embedded things\000 inside me")) { test_fail } -&test_octets := 0x30783031013078303707307830410A307830440D222230786230b0C2b0 -&result_string := "%{(string) %{test_octets}}" -if (!(&result_string == "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 } @@ -48,7 +48,7 @@ if (!("%{Reply-Message[0]}" == "i have scary embedded things\000 inside me")) { test_fail } -if (!(&Reply-Message[1] == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) { +if (!(Reply-Message[1] == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) { test_fail } @@ -57,7 +57,7 @@ if !("%{Reply-Message[*]}" == "i have scary embedded things\000 inside me0x01\00 test_fail } -if (!(&Reply-Message[0] == &Reply-Message[0])) { +if (!(Reply-Message[0] == Reply-Message[0])) { test_fail } @@ -65,21 +65,21 @@ if (!(&Reply-Message[0] == &Reply-Message[0])) { # This seems weird... double escapes for most things, but single escapes # for the quotation marks. # -if (!(&Callback-Id[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 (!(&Callback-Id[1] == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) { +if (!(Callback-Id[1] == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) { test_fail } # # Other data types # -&result_string := "%{(string) &test_ipaddr}" +result_string := "%{(string) test_ipaddr}" if (!(%length(%{result_string}) == 9)) { test_fail } diff --git a/src/tests/keywords/ethernet b/src/tests/keywords/ethernet index 7b3a8f62096..fcf0fa60e1e 100644 --- a/src/tests/keywords/ethernet +++ b/src/tests/keywords/ethernet @@ -1,21 +1,21 @@ octets test_octets ether test_ether -&test_octets := 0x001122334456 +test_octets := 0x001122334456 -&test_ether = &test_octets +test_ether = test_octets -if (!(&test_ether == 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 { - &test_ether := %{Class[42]} + test_ether := %{Class[42]} } -if (&test_ether) { +if (test_ether) { test_fail } diff --git a/src/tests/keywords/exec-list b/src/tests/keywords/exec-list index 57af968c236..c50c1c93c38 100644 --- a/src/tests/keywords/exec-list +++ b/src/tests/keywords/exec-list @@ -1,6 +1,6 @@ -&request += %exec('/bin/sh', '-c', '/bin/echo \&Reply-Message = foo') +request += %exec('/bin/sh', '-c', '/bin/echo \Reply-Message = foo') -if !(&Reply-Message == 'foo') { +if !(Reply-Message == 'foo') { test_fail } diff --git a/src/tests/keywords/expand-expr b/src/tests/keywords/expand-expr index 6f4d2f36e1b..eeb7ab7821e 100644 --- a/src/tests/keywords/expand-expr +++ b/src/tests/keywords/expand-expr @@ -3,17 +3,17 @@ uint32 bar uint32 baz uint32 none -&foo = 1 -&bar = 2 +foo = 1 +bar = 2 -&baz := %{&foo + &bar} +baz := %{foo + bar} -if !(&baz == 3) { +if !(baz == 3) { test_fail } -&baz := %{&none || &foo} -if !(&baz == &foo) { +baz := %{none || foo} +if !(baz == foo) { test_fail } diff --git a/src/tests/keywords/expr b/src/tests/keywords/expr index 03f660e6da2..b79581f7ad3 100644 --- a/src/tests/keywords/expr +++ b/src/tests/keywords/expr @@ -28,29 +28,29 @@ if !(1 + 2 * 3 + 4 == 11) { # # attribute references # -&test_integer1 := 3 -&test_integer2 := 4 -&test_date := "%l" +test_integer1 := 3 +test_integer2 := 4 +test_date := "%l" -if (!(%{ 1 + 2 * &test_integer1 + 4} == 11)) { +if (!(%{ 1 + 2 * test_integer1 + 4} == 11)) { test_fail } -if !(1 + 2 * &test_integer1 + 4 == 11) { +if !(1 + 2 * test_integer1 + 4 == 11) { test_fail } -if (!(%{ 1 + 2 * (&test_integer1 + 4)} == 15)) { +if (!(%{ 1 + 2 * (test_integer1 + 4)} == 15)) { test_fail } -if !(1 + 2 * (&test_integer1 + 4) == 15) { +if !(1 + 2 * (test_integer1 + 4) == 15) { test_fail } -if (!(%{ 1 + 2 * (&test_integer1 + &test_integer2)} == 15)) { +if (!(%{ 1 + 2 * (test_integer1 + test_integer2)} == 15)) { test_fail } -if !(1 + 2 * (&test_integer1 + &test_integer2) == 15) { +if !(1 + 2 * (test_integer1 + test_integer2) == 15) { test_fail } @@ -96,10 +96,10 @@ if !(((1 << 2) | 1) == 5) { # needs extra () to resolve precedence test_fail } -if ("%{ &test_date}" <= 0) { +if ("%{ test_date}" <= 0) { test_fail } -if (&test_date <= 0) { +if (test_date <= 0) { test_fail } @@ -113,10 +113,10 @@ if !(6 + -(1 + 3) == 2) { test_fail } -if (!(%{ 6 * -&test_integer2} == -24)) { +if (!(%{ 6 * -test_integer2} == -24)) { test_fail } -if !(6 * -&test_integer2 == -24) { +if !(6 * -test_integer2 == -24) { test_fail } diff --git a/src/tests/keywords/expr-acct b/src/tests/keywords/expr-acct index 1ed91562dda..b931f2f3655 100644 --- a/src/tests/keywords/expr-acct +++ b/src/tests/keywords/expr-acct @@ -4,9 +4,9 @@ uint64 input # PRE: if edit # -&input := %{((uint64)&Acct-Input-Gigawords << 32) | (uint64)&Acct-Input-Octets} +input := %{((uint64)Acct-Input-Gigawords << 32) | (uint64)Acct-Input-Octets} -if !(&input == 0) { +if !(input == 0) { test_fail } diff --git a/src/tests/keywords/expr-alt-missing b/src/tests/keywords/expr-alt-missing index b94da8279e2..2184aa0f0d3 100644 --- a/src/tests/keywords/expr-alt-missing +++ b/src/tests/keywords/expr-alt-missing @@ -1,30 +1,30 @@ -&Acct-Input-Octets := 0 +Acct-Input-Octets := 0 # 0 is false according to the truthy rules, should return 5 -if (!(%{&Acct-Input-Octets || 5} == 5)) { +if (!(%{Acct-Input-Octets || 5} == 5)) { test_fail } # Both values are not truthy, but it's still more useful to # return one on them instead of NULL, and this is an extremely # common use case when setting defaults. -if ("%{&Acct-Input-Octets || 0}" == '') { +if ("%{Acct-Input-Octets || 0}" == '') { test_fail } # Same as above, except 5 is truthy, so we DEFINITELY shouldn't # be returning NULL. -if ("%{&Acct-Input-Octets || 5}" == '') { +if ("%{Acct-Input-Octets || 5}" == '') { test_fail } # Completely absent null value is definitely not truthy -if (!(%{&Acct-Output-Octets || 5} == 5)) { +if (!(%{Acct-Output-Octets || 5} == 5)) { test_fail } # One null should not trigger the expression returning null overall -if ("%{&Acct-Output-Octets || 5}" == '') { +if ("%{Acct-Output-Octets || 5}" == '') { test_fail } diff --git a/src/tests/keywords/expr-condition b/src/tests/keywords/expr-condition index a713feed54e..14d1d987d12 100644 --- a/src/tests/keywords/expr-condition +++ b/src/tests/keywords/expr-condition @@ -4,13 +4,13 @@ # # @todo - allow just a bare # -# &NAS-Port := 5 + (&User-Name == "bob") +# NAS-Port := 5 + (User-Name == "bob") # # which means updating the config file parser, too. # -&NAS-Port := %{5 + (&User-Name == "bob")} +NAS-Port := %{5 + (User-Name == "bob")} -if !(&NAS-Port == 6) { +if !(NAS-Port == 6) { test_fail } diff --git a/src/tests/keywords/expr-double b/src/tests/keywords/expr-double index ecd17a5e2ae..be3d605cddc 100644 --- a/src/tests/keywords/expr-double +++ b/src/tests/keywords/expr-double @@ -1,5 +1,5 @@ # # We only care if this crashes or not. # -&Filter-Id := "%{1 + 1} %tolower(1)" +Filter-Id := "%{1 + 1} %tolower(1)" success diff --git a/src/tests/keywords/expr-missing b/src/tests/keywords/expr-missing index b40dbb4c5e0..c290310d57d 100644 --- a/src/tests/keywords/expr-missing +++ b/src/tests/keywords/expr-missing @@ -9,20 +9,20 @@ string sc # # b is missing, so its default value is 0 # -&a = 1 -&c = &a - &b +a = 1 +c = a - b -if !(&c == &a) { +if !(c == a) { test_fail } -&sa = "foo" -&sc = &sa + &sb +sa = "foo" +sc = sa + sb # # sb is missing, so its default value is the empty string # -if !(&sc == &sa) { +if !(sc == sa) { test_fail } success diff --git a/src/tests/keywords/filter_password b/src/tests/keywords/filter_password index 1c2c07af2af..c0891836284 100644 --- a/src/tests/keywords/filter_password +++ b/src/tests/keywords/filter_password @@ -2,7 +2,7 @@ # Tests for NUL in the middle of a string # -&Reply-Message := "bob\000hello" +Reply-Message := "bob\000hello" # # Commented out because it fails @@ -11,20 +11,20 @@ # test_fail #} -if &Reply-Message { +if Reply-Message { group tmp octets delim # # Because "\000" yields "zero length delimiter is not allowed" # - &delim = 0x00 - &tmp.Reply-Message := %explode(%{Reply-Message}, "%{delim}") + delim = 0x00 + tmp.Reply-Message := %explode(%{Reply-Message}, "%{delim}") - &Reply-Message := &tmp.Reply-Message[0] + Reply-Message := tmp.Reply-Message[0] } -if &Reply-Message != "bob" { +if Reply-Message != "bob" { test_fail } diff --git a/src/tests/keywords/foreach b/src/tests/keywords/foreach index efa0aab749d..1f53debe1ee 100644 --- a/src/tests/keywords/foreach +++ b/src/tests/keywords/foreach @@ -1,7 +1,7 @@ -&request -= &Packet-Type +request -= Packet-Type -foreach &Filter-Id { - &reply += { - &Called-Station-Id = "%{Foreach-Variable-0}" +foreach Filter-Id { + reply += { + Called-Station-Id = "%{Foreach-Variable-0}" } } diff --git a/src/tests/keywords/foreach-break b/src/tests/keywords/foreach-break index 200add83ecf..268430f3253 100644 --- a/src/tests/keywords/foreach-break +++ b/src/tests/keywords/foreach-break @@ -4,11 +4,11 @@ # # We DON'T want to see this one. # -&request += { - &Filter-Id = "broken" +request += { + Filter-Id = "broken" } -foreach &Filter-Id { +foreach Filter-Id { # # If we see this one, "break" out of the # foreach loop. @@ -17,8 +17,8 @@ foreach &Filter-Id { break } - &reply += { - &Called-Station-Id = "%{Foreach-Variable-0}" + reply += { + Called-Station-Id = "%{Foreach-Variable-0}" } } @@ -26,35 +26,35 @@ foreach &Filter-Id { # # Adding attribute during request and immediately breaking # -&request += { - &Filter-Id = "1" - &Filter-Id = "2" +request += { + Filter-Id = "1" + Filter-Id = "2" } -foreach &Reply-Message { +foreach Reply-Message { if ("%{Foreach-Variable-0}" == "1") { - &request += { - &Filter-Id = "3" + request += { + Filter-Id = "3" } break } } -&request -= &Filter-Id[*] +request -= Filter-Id[*] # # Adding attribute during request and continuing # -&request += { - &Filter-Id = "1" - &Filter-Id = "2" +request += { + Filter-Id = "1" + Filter-Id = "2" } -foreach &Reply-Message { +foreach Reply-Message { if ("%{Foreach-Variable-0}" == "1") { - &request += { - &Filter-Id = "3" + request += { + Filter-Id = "3" } } diff --git a/src/tests/keywords/foreach-break-2 b/src/tests/keywords/foreach-break-2 index c11edd068c5..5b9326b73d2 100644 --- a/src/tests/keywords/foreach-break-2 +++ b/src/tests/keywords/foreach-break-2 @@ -3,16 +3,16 @@ # string test_string -&test_string := "ABCDEF_1" +test_string := "ABCDEF_1" # # This creates a bunch of User-Name attributes. # -&control.User-Name := { "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.User-Name { +foreach control.User-Name { if ("%{test_string}" =~ /([A-Z0-9\-]*)_%{Foreach-Variable-0}/) { - &test_string := "%{1}" + test_string := "%{1}" success break } diff --git a/src/tests/keywords/foreach-break-3 b/src/tests/keywords/foreach-break-3 index 9ed231f5096..decab278217 100644 --- a/src/tests/keywords/foreach-break-3 +++ b/src/tests/keywords/foreach-break-3 @@ -1,12 +1,12 @@ # # PRE: foreach foreach-break # -&Calling-Station-Id := "8" +Calling-Station-Id := "8" -&control.Calling-Station-Id := { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g" } +control.Calling-Station-Id := { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g" } -foreach &control.Calling-Station-Id { - if (&Calling-Station-Id == "%{Foreach-Variable-0}") { +foreach control.Calling-Station-Id { + if (Calling-Station-Id == "%{Foreach-Variable-0}") { success break } diff --git a/src/tests/keywords/foreach-delete b/src/tests/keywords/foreach-delete index fec364436ed..e30e515761f 100644 --- a/src/tests/keywords/foreach-delete +++ b/src/tests/keywords/foreach-delete @@ -2,30 +2,30 @@ # PRE: foreach-modify # -&Tmp-Integer-0 := { 1, 3, 5, 11 } +Tmp-Integer-0 := { 1, 3, 5, 11 } # # Try to delete one of the variables we're looping over. If the user could delete one, # then the underlying tmpl_dcursor would crash, as it didn't know about the deletion. # -foreach uint32 self (&Tmp-Integer-0) { - &request -= &Tmp-Integer-0[1] - &self += 19 +foreach uint32 self (Tmp-Integer-0) { + request -= Tmp-Integer-0[1] + self += 19 } -if (&Tmp-Integer-0[0] != 20) { +if (Tmp-Integer-0[0] != 20) { test_fail } -if (&Tmp-Integer-0[1] != 22) { +if (Tmp-Integer-0[1] != 22) { test_fail } -if (&Tmp-Integer-0[2] != 24) { +if (Tmp-Integer-0[2] != 24) { test_fail } -if (&Tmp-Integer-0[3] != 30) { +if (Tmp-Integer-0[3] != 30) { test_fail } diff --git a/src/tests/keywords/foreach-error b/src/tests/keywords/foreach-error index 76d0458587f..1915796d186 100644 --- a/src/tests/keywords/foreach-error +++ b/src/tests/keywords/foreach-error @@ -1,3 +1,3 @@ foreach "%tolower('foo')" { # ERROR - &reply.Called-Station-Id += "%{Foreach-Variable-0}" + reply.Called-Station-Id += "%{Foreach-Variable-0}" } diff --git a/src/tests/keywords/foreach-isolation b/src/tests/keywords/foreach-isolation index 5f88190840d..8536eecdb79 100644 --- a/src/tests/keywords/foreach-isolation +++ b/src/tests/keywords/foreach-isolation @@ -2,26 +2,26 @@ # PRE: foreach # -&control.User-Name := { "0", "1", "2", "3" } +control.User-Name := { "0", "1", "2", "3" } -foreach &control.User-Name { - &control -= { - &User-Name == "%{1 + %{Foreach-Variable-0}}" +foreach control.User-Name { + control -= { + User-Name == "%{1 + %{Foreach-Variable-0}}" } - &request += { - &Filter-Id = "%{Foreach-Variable-0}" + request += { + Filter-Id = "%{Foreach-Variable-0}" } } -if (!&Filter-Id[0] || !&Filter-Id[1] || !&Filter-Id[2] || !&Filter-Id[3]) { +if (!Filter-Id[0] || !Filter-Id[1] || !Filter-Id[2] || !Filter-Id[3]) { test_fail } -if (!((&Filter-Id[0] == '0')) || (!(&Filter-Id[1] == '1')) || (!(&Filter-Id[2] == '2')) || (!(&Filter-Id[3] == '3'))) { +if (!((Filter-Id[0] == '0')) || (!(Filter-Id[1] == '1')) || (!(Filter-Id[2] == '2')) || (!(Filter-Id[3] == '3'))) { test_fail } -if (!&control.User-Name[0] || &control.User-Name[1] || &control.User-Name[2] || &control.User-Name[3]) { +if (!control.User-Name[0] || control.User-Name[1] || control.User-Name[2] || control.User-Name[3]) { test_fail } diff --git a/src/tests/keywords/foreach-list b/src/tests/keywords/foreach-list index 5ef23d09fb2..fe6562f5346 100644 --- a/src/tests/keywords/foreach-list +++ b/src/tests/keywords/foreach-list @@ -1,7 +1,7 @@ -&request -= &Packet-Type[*] +request -= Packet-Type[*] -foreach &request.[*] { - &reply += { - &Called-Station-Id = "%{Foreach-Variable-0}" +foreach request.[*] { + reply += { + Called-Station-Id = "%{Foreach-Variable-0}" } } diff --git a/src/tests/keywords/foreach-modify b/src/tests/keywords/foreach-modify index 1115dc57178..7f26d5a0838 100644 --- a/src/tests/keywords/foreach-modify +++ b/src/tests/keywords/foreach-modify @@ -2,25 +2,25 @@ # PRE: foreach # -&Tmp-Integer-0 := { 1, 3, 5, 11 } +Tmp-Integer-0 := { 1, 3, 5, 11 } -foreach uint32 self (&Tmp-Integer-0) { - &self += 19 +foreach uint32 self (Tmp-Integer-0) { + self += 19 } -if (&Tmp-Integer-0[0] != 20) { +if (Tmp-Integer-0[0] != 20) { test_fail } -if (&Tmp-Integer-0[1] != 22) { +if (Tmp-Integer-0[1] != 22) { test_fail } -if (&Tmp-Integer-0[2] != 24) { +if (Tmp-Integer-0[2] != 24) { test_fail } -if (&Tmp-Integer-0[3] != 30) { +if (Tmp-Integer-0[3] != 30) { test_fail } diff --git a/src/tests/keywords/foreach-nested b/src/tests/keywords/foreach-nested index c4566d59164..4fc6df014e8 100644 --- a/src/tests/keywords/foreach-nested +++ b/src/tests/keywords/foreach-nested @@ -1,9 +1,9 @@ # PRE: foreach # -foreach &Filter-Id { - foreach &Calling-Station-Id { - &reply += { - &Called-Station-Id = "%{Foreach-Variable-0} %{Foreach-Variable-1}" +foreach Filter-Id { + foreach Calling-Station-Id { + reply += { + Called-Station-Id = "%{Foreach-Variable-0} %{Foreach-Variable-1}" } } } diff --git a/src/tests/keywords/foreach-regex b/src/tests/keywords/foreach-regex index 24d1b61f9da..dccbc672c3a 100644 --- a/src/tests/keywords/foreach-regex +++ b/src/tests/keywords/foreach-regex @@ -3,22 +3,22 @@ string cisco_prefix # This is what most people end up using foreach for, # so we should probably test it works. -&cisco_prefix := "cisco" +cisco_prefix := "cisco" # Expanded regex -foreach &Vendor-Specific.Cisco.AVPair { +foreach Vendor-Specific.Cisco.AVPair { if ("%{Foreach-Variable-0}" =~ /^%{cisco_prefix}=(.*)$/i) { - &reply += { - &Called-Station-Id = "%{1}" + reply += { + Called-Station-Id = "%{1}" } } } # Compiled regex -foreach &Vendor-Specific.Cisco.AVPair { +foreach Vendor-Specific.Cisco.AVPair { if ("%{Foreach-Variable-0}" =~ /^stupid=(.*)$/i) { - &reply += { - &Called-Station-Id = "%{1}" + reply += { + Called-Station-Id = "%{1}" } } } diff --git a/src/tests/keywords/foreach-return b/src/tests/keywords/foreach-return index d6f979a41f8..a25e322e202 100644 --- a/src/tests/keywords/foreach-return +++ b/src/tests/keywords/foreach-return @@ -4,9 +4,9 @@ # # Adding attribute during request and immediately returning should still work # -&Filter-Id := { "1", "2", "3", "4", "5" } +Filter-Id := { "1", "2", "3", "4", "5" } -foreach &Filter-Id { +foreach Filter-Id { if ("%{Foreach-Variable-0}" == "3") { success @@ -15,7 +15,7 @@ foreach &Filter-Id { # will prevent the "pap" module from being run # in the "authorize" section. # - &control.Auth-Type := ::PAP + control.Auth-Type := ::PAP # # Stop processing "authorize", and go to the next section. diff --git a/src/tests/keywords/foreach-tlv b/src/tests/keywords/foreach-tlv index 9fb4307c8e9..75af303c9c6 100644 --- a/src/tests/keywords/foreach-tlv +++ b/src/tests/keywords/foreach-tlv @@ -7,39 +7,39 @@ # string out -&Tmp-TLV-0 := { - &a = 1 - &b = 2 - &c = "foo" - &d = 127.0.0.1 +Tmp-TLV-0 := { + a = 1 + b = 2 + c = "foo" + d = 127.0.0.1 } -&request += { - &Tmp-TLV-0 = { - &a = 2112 - &b = 6809 - &c = "bar" - &d = 192.0.2.1 +request += { + Tmp-TLV-0 = { + a = 2112 + b = 6809 + c = "bar" + d = 192.0.2.1 } } -&out = "" +out = "" # # Don't use "tlv" as the attribute name, because "tlv" is a data type. # -foreach thing (&Tmp-TLV-0[*]) { - &out += &thing.c - &out += " " +foreach thing (Tmp-TLV-0[*]) { + out += thing.c + out += " " } -&out -= " " +out -= " " # # And we have updated the string from multiple TLVs, and one particular # child from each TLV. # -if (&out != 'foo bar') { +if (out != 'foo bar') { test_fail } diff --git a/src/tests/keywords/foreach-variable b/src/tests/keywords/foreach-variable index a9db8ea4c08..19edb18e49c 100644 --- a/src/tests/keywords/foreach-variable +++ b/src/tests/keywords/foreach-variable @@ -1,10 +1,10 @@ -&request -= &Packet-Type +request -= Packet-Type # # New syntax # -foreach thing ( &Filter-Id ) { - &reply += { - &Called-Station-Id = &thing +foreach thing ( Filter-Id ) { + reply += { + Called-Station-Id = thing } } diff --git a/src/tests/keywords/foreach-varied-depth b/src/tests/keywords/foreach-varied-depth index 2e035e270cd..82dac96d128 100644 --- a/src/tests/keywords/foreach-varied-depth +++ b/src/tests/keywords/foreach-varied-depth @@ -1,35 +1,35 @@ # # PRE: foreach # -&control += { - &Filter-Id = "ssid=ABCDEF" - &Filter-Id = "ssid=GHIJKL" +control += { + Filter-Id = "ssid=ABCDEF" + Filter-Id = "ssid=GHIJKL" } -if (&User-Name) { - foreach &control.Filter-Id { +if (User-Name) { + foreach control.Filter-Id { if ("%{Foreach-Variable-0}" =~ /(.*)/) { - &control.Calling-Station-Id := "%{1}" + control.Calling-Station-Id := "%{1}" } } } -if (!(&control.Calling-Station-Id == 'ssid=GHIJKL')) { +if (!(control.Calling-Station-Id == 'ssid=GHIJKL')) { test_fail } -&control -= &Calling-Station-Id[*] +control -= Calling-Station-Id[*] -foreach &control.Filter-Id { +foreach control.Filter-Id { if ("%{Foreach-Variable-0}" =~ /(.*)/) { - &control.Calling-Station-Id := "%{1}" + control.Calling-Station-Id := "%{1}" } } -if (!(&control.Calling-Station-Id == 'ssid=GHIJKL')) { +if (!(control.Calling-Station-Id == 'ssid=GHIJKL')) { test_fail } -&control -= &Calling-Station-Id[*] +control -= Calling-Station-Id[*] success diff --git a/src/tests/keywords/hex b/src/tests/keywords/hex index 02645dc850e..c879116ce0a 100644 --- a/src/tests/keywords/hex +++ b/src/tests/keywords/hex @@ -16,104 +16,104 @@ 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 +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 -&result_string := %hex(%{test_string}) -if (!(&result_string == '39383730')) { +result_string := %hex(%{test_string}) +if (!(result_string == '39383730')) { test_fail } # Octets -&result_string := %hex(%{test_octets}) -if (!(&result_string == '39383731')) { +result_string := %hex(%{test_octets}) +if (!(result_string == '39383731')) { test_fail } # IP Address -&result_string := %hex(%{test_ipaddr}) -if (!(&result_string == '39383732')) { +result_string := %hex(%{test_ipaddr}) +if (!(result_string == '39383732')) { test_fail } # Integer -&result_string := %hex(%{test_integer}) -if (!(&result_string == '39383734')) { +result_string := %hex(%{test_integer}) +if (!(result_string == '39383734')) { test_fail } # ifid -&result_string := %hex(%{test_ifid}) -if (!(&result_string == '0000000039383737')) { +result_string := %hex(%{test_ifid}) +if (!(result_string == '0000000039383737')) { test_fail } # ipv6addr -&result_string := %hex(%{test_ipv6addr}) -if (!(&result_string == '00000000000000000000000039383738')) { +result_string := %hex(%{test_ipv6addr}) +if (!(result_string == '00000000000000000000000039383738')) { test_fail } # ipv6addrprefix -&result_string := %hex(%{test_ipv6prefix}) -if (!(&result_string == '008000000000000000000000000039383739')) { +result_string := %hex(%{test_ipv6prefix}) +if (!(result_string == '008000000000000000000000000039383739')) { test_fail } # byte -&result_string := %hex(%{test_byte}) -if (!(&result_string == '3a')) { +result_string := %hex(%{test_byte}) +if (!(result_string == '3a')) { test_fail } # short -&result_string := %hex(%{test_short}) -if (!(&result_string == '373b')) { +result_string := %hex(%{test_short}) +if (!(result_string == '373b')) { test_fail } # ethernet -&result_string := %hex(%{test_ether}) -if (!(&result_string == '00003938373c')) { +result_string := %hex(%{test_ether}) +if (!(result_string == '00003938373c')) { test_fail } # integer64 -&result_string := %hex(%{test_int64}) -if (!(&result_string == '100000003938373d')) { +result_string := %hex(%{test_int64}) +if (!(result_string == '100000003938373d')) { test_fail } # ipv4prefix -&result_string := %hex(%{test_ipv4prefix}) -if (!(&result_string == '203938373e')) { +result_string := %hex(%{test_ipv4prefix}) +if (!(result_string == '203938373e')) { test_fail } -&request += { - &Class = 0x0101 - &Class = 0x010203 - &Class = 0x0405 +request += { + Class = 0x0101 + Class = 0x010203 + Class = 0x0405 } -&NAS-Identifier := %hex(%{Class[*]}) +NAS-Identifier := %hex(%{Class[*]}) -if (&NAS-Identifier[#] != 3) { +if (NAS-Identifier[#] != 3) { test_fail } -if !((&NAS-Identifier[0] == '0101') && (&NAS-Identifier[1] == '010203') && (&NAS-Identifier[2] == '0405')) { +if !((NAS-Identifier[0] == '0101') && (NAS-Identifier[1] == '010203') && (NAS-Identifier[2] == '0405')) { test_fail } diff --git a/src/tests/keywords/if-attr-error b/src/tests/keywords/if-attr-error index 4c04a8b5f29..d7677fac6e6 100644 --- a/src/tests/keywords/if-attr-error +++ b/src/tests/keywords/if-attr-error @@ -6,6 +6,6 @@ # then fail in the compilation stage, because the # attribute doesn't exist. # -if (&Not-Dynamically-Allocated) { # ERROR +if (Not-Dynamically-Allocated) { # ERROR # foo } diff --git a/src/tests/keywords/if-bob b/src/tests/keywords/if-bob index cf47999d5f0..edc06026550 100644 --- a/src/tests/keywords/if-bob +++ b/src/tests/keywords/if-bob @@ -2,10 +2,10 @@ # # Matching "if" conditions # -if (&User-Name == "bob") { +if (User-Name == "bob") { success } -if (!(&User-Name == "bob")) { +if (!(User-Name == "bob")) { test_fail } diff --git a/src/tests/keywords/if-else b/src/tests/keywords/if-else index 9717280faf7..b2f3db45c1a 100644 --- a/src/tests/keywords/if-else +++ b/src/tests/keywords/if-else @@ -3,7 +3,7 @@ # # Matching "if" conditions # -if (!(&User-Name == "bob")) { +if (!(User-Name == "bob")) { test_fail } else { diff --git a/src/tests/keywords/if-elsif b/src/tests/keywords/if-elsif index 76dfed61405..4d2634aca6d 100644 --- a/src/tests/keywords/if-elsif +++ b/src/tests/keywords/if-elsif @@ -2,10 +2,10 @@ # # Matching "if" conditions # -if (!(&User-Name == "bob")) { +if (!(User-Name == "bob")) { test_fail } -elsif (&User-Name == "bob") { +elsif (User-Name == "bob") { success } else { diff --git a/src/tests/keywords/if-failed-xlat b/src/tests/keywords/if-failed-xlat index 74a9d08b328..568af21a1f6 100644 --- a/src/tests/keywords/if-failed-xlat +++ b/src/tests/keywords/if-failed-xlat @@ -10,7 +10,7 @@ if (%regex(foo)) { test_fail } -if (!(&Module-Failure-Message[*] == "No previous named regex capture group")) { +if (!(Module-Failure-Message[*] == "No previous named regex capture group")) { test_fail } } diff --git a/src/tests/keywords/if-function b/src/tests/keywords/if-function index 78bdebf5a22..49e420317bf 100644 --- a/src/tests/keywords/if-function +++ b/src/tests/keywords/if-function @@ -8,8 +8,8 @@ if !(%md5('foo') == 0xacbd18db4cc2f85cedef654fccc4a4d8) { group { octets hash - &hash = %md5('foo') - if !(&hash == 0xacbd18db4cc2f85cedef654fccc4a4d8) { + hash = %md5('foo') + if !(hash == 0xacbd18db4cc2f85cedef654fccc4a4d8) { test_fail } } diff --git a/src/tests/keywords/if-multivalue b/src/tests/keywords/if-multivalue index 87aef13d766..c23551366e8 100644 --- a/src/tests/keywords/if-multivalue +++ b/src/tests/keywords/if-multivalue @@ -2,67 +2,67 @@ # PRE: if # -&request += { - &Filter-Id = 'foo' - &Filter-Id = 'bar' - &Filter-Id = 'baz' +request += { + Filter-Id = 'foo' + Filter-Id = 'bar' + Filter-Id = 'baz' - &NAS-Port-Id = 'GROUP ADMINISTRATORS' - &NAS-Port-Id = 'GROUP STUDENTS' - &NAS-Port-Id = 'GROUP PEONS' + NAS-Port-Id = 'GROUP ADMINISTRATORS' + NAS-Port-Id = 'GROUP STUDENTS' + NAS-Port-Id = 'GROUP PEONS' - &Reply-Message = 'PEONS' - &Reply-Message = 'STUDENTS' - &Reply-Message = 'ADMINISTRATORS' + Reply-Message = 'PEONS' + Reply-Message = 'STUDENTS' + Reply-Message = 'ADMINISTRATORS' - &Callback-Id = 'no' - &Callback-Id = 'no' - &Callback-Id = 'yes' + Callback-Id = 'no' + Callback-Id = 'no' + Callback-Id = 'yes' - &NAS-Port = 1 - &NAS-Port = 2 - &NAS-Port = 5 + NAS-Port = 1 + NAS-Port = 2 + NAS-Port = 5 } -&control += { - &Filter-Id = 'foo' - &Filter-Id = 'bar' - &Filter-Id = 'baz' +control += { + Filter-Id = 'foo' + Filter-Id = 'bar' + Filter-Id = 'baz' - &NAS-Port-Id = 'boink' - &NAS-Port-Id = 'tard' - &NAS-Port-Id = 'dink' - &NAS-Port-Id = 'slink' + NAS-Port-Id = 'boink' + NAS-Port-Id = 'tard' + NAS-Port-Id = 'dink' + NAS-Port-Id = 'slink' - &NAS-Port = 01 - &NAS-Port = 02 - &NAS-Port = 05 - &NAS-Port = 04 + NAS-Port = 01 + NAS-Port = 02 + NAS-Port = 05 + NAS-Port = 04 - &Port-Limit = 10 - &Port-Limit = 20 - &Port-Limit = 30 + Port-Limit = 10 + Port-Limit = 20 + Port-Limit = 30 } # # Mmmm O(N^2) # -if (!(&Filter-Id[*] == &control.Filter-Id[*])) { +if (!(Filter-Id[*] == control.Filter-Id[*])) { test_fail } -if (&Filter-Id[*] == &control.NAS-Port-Id[*]) { +if (Filter-Id[*] == control.NAS-Port-Id[*]) { test_fail } -if (&NAS-Port-Id[*] == &control.Filter-Id[*]) { +if (NAS-Port-Id[*] == control.Filter-Id[*]) { test_fail } # # Integer comparison and normalisation # -if (!(&NAS-Port == &control.NAS-Port)) { +if (!(NAS-Port == control.NAS-Port)) { test_fail } @@ -70,67 +70,67 @@ if (!(&NAS-Port == &control.NAS-Port)) { # if any value of request.NAS-Port > any value of # request.Port-Limit then evaluate to true # -if (&NAS-Port[*] > &control.Port-Limit[*]) { +if (NAS-Port[*] > control.Port-Limit[*]) { test_fail } # # Compiled regex comparisons # -if (&NAS-Port-Id[*] !~ /PEONS$/) { +if (NAS-Port-Id[*] !~ /PEONS$/) { test_fail } -if (&control.NAS-Port-Id =~ /PEONS$/) { +if (control.NAS-Port-Id =~ /PEONS$/) { test_fail } -if (&control.NAS-Port-Id =~ /DINKS$/) { +if (control.NAS-Port-Id =~ /DINKS$/) { test_fail } # # Dynamic regex comparisons # -if (&NAS-Port-Id[*] !~ /%{Reply-Message[0]}$/) { +if (NAS-Port-Id[*] !~ /%{Reply-Message[0]}$/) { test_fail } -if (&NAS-Port-Id =~ /%{Reply-Message[1]}$/) { +if (NAS-Port-Id =~ /%{Reply-Message[1]}$/) { test_fail } -if !(&NAS-Port-Id =~ /%{Reply-Message[2]}$/) { +if !(NAS-Port-Id =~ /%{Reply-Message[2]}$/) { test_fail } -if (&NAS-Port-Id =~ /%{Reply-Message[#]}$/) { +if (NAS-Port-Id =~ /%{Reply-Message[#]}$/) { test_fail } # # XLAT virtual comparisons # -if (!(&control.NAS-Port[*] == %{control.NAS-Port[#]})) { +if (!(control.NAS-Port[*] == %{control.NAS-Port[#]})) { test_fail } # # Literal comparisons # -if (!(&control.NAS-Port-Id[*] == 'boink')) { +if (!(control.NAS-Port-Id[*] == 'boink')) { test_fail } -if (&control.NAS-Port-Id[*] == 'foo') { +if (control.NAS-Port-Id[*] == 'foo') { test_fail } -if (&NAS-Port[*] > 10) { +if (NAS-Port[*] > 10) { test_fail } -if (!(&NAS-Port[*] < 10)) { +if (!(NAS-Port[*] < 10)) { test_fail } diff --git a/src/tests/keywords/if-nested-logic b/src/tests/keywords/if-nested-logic index bf8d0da5039..f1fb8683fb4 100644 --- a/src/tests/keywords/if-nested-logic +++ b/src/tests/keywords/if-nested-logic @@ -2,36 +2,36 @@ # PRE: if # -&request += { - &Filter-Id = 'foo' - &Filter-Id = 'bar' +request += { + Filter-Id = 'foo' + Filter-Id = 'bar' } -if !(&NAS-Port || &Filter-Id) { +if !(NAS-Port || Filter-Id) { test_fail } -if !(!(!(&Filter-Id))) { +if !(!(!(Filter-Id))) { test_fail } -if (&Filter-Id[0] && &Filter-Id[1] && &Filter-Id[2]) { +if (Filter-Id[0] && Filter-Id[1] && Filter-Id[2]) { test_fail } -if !(((&Filter-Id[0] == 'baz') && (&Filter-Id[1] == 'boing')) || ((&Filter-Id[0] == 'foo') && (&Filter-Id[1] == 'bar'))) { +if !(((Filter-Id[0] == 'baz') && (Filter-Id[1] == 'boing')) || ((Filter-Id[0] == 'foo') && (Filter-Id[1] == 'bar'))) { test_fail } -if !(((&Filter-Id[0] == 'foo') && (&Filter-Id[1] == 'boing')) || ((&Filter-Id[0] == 'foo') && (&Filter-Id[1] == 'bar'))) { +if !(((Filter-Id[0] == 'foo') && (Filter-Id[1] == 'boing')) || ((Filter-Id[0] == 'foo') && (Filter-Id[1] == 'bar'))) { test_fail } -if !((&NAS-Port || &Filter-Id) && (&Calling-Station-Id || &User-Name)) { +if !((NAS-Port || Filter-Id) && (Calling-Station-Id || User-Name)) { test_fail } -if !(((&NAS-Port || &Filter-Id) && !&User-Name) || (&Calling-Station-Id || &User-Name)) { +if !(((NAS-Port || Filter-Id) && !User-Name) || (Calling-Station-Id || User-Name)) { test_fail } diff --git a/src/tests/keywords/if-rcode-error b/src/tests/keywords/if-rcode-error index c1ea293cdee..5c21937b1c7 100644 --- a/src/tests/keywords/if-rcode-error +++ b/src/tests/keywords/if-rcode-error @@ -2,6 +2,6 @@ # # return code in an "if" section. # -if (&User-Name == "bob") { +if (User-Name == "bob") { ok = reject # ERROR } diff --git a/src/tests/keywords/if-regex-bad-attribute b/src/tests/keywords/if-regex-bad-attribute index 99fb299f4fb..28a68bb7bb6 100644 --- a/src/tests/keywords/if-regex-bad-attribute +++ b/src/tests/keywords/if-regex-bad-attribute @@ -5,13 +5,13 @@ # # This should parse # -if (&User-Name =~ /%{User-Name}/) { +if (User-Name =~ /%{User-Name}/) { ok } # # Check regexes which refer to unknown attributes # -if (&User-Name =~ /%{What-The-Heck-Is-This-Thing}/) { # ERROR +if (User-Name =~ /%{What-The-Heck-Is-This-Thing}/) { # ERROR ok } diff --git a/src/tests/keywords/if-regex-empty b/src/tests/keywords/if-regex-empty index aef8ac71211..7c497e75678 100644 --- a/src/tests/keywords/if-regex-empty +++ b/src/tests/keywords/if-regex-empty @@ -2,7 +2,7 @@ # PRE: if if-regex-match # -if !(&control.Password.Cleartext =~ /hell(o)(.*)/) { +if !(control.Password.Cleartext =~ /hell(o)(.*)/) { test_fail } @@ -20,7 +20,7 @@ if ("%{2}") { test_fail } -if !(&control.Password.Cleartext =~ /hello(.*)/) { +if !(control.Password.Cleartext =~ /hello(.*)/) { test_fail } @@ -34,15 +34,15 @@ if ("%{1}") { # # Check assignment of regex null-match # -if (&control.Password.Cleartext =~ /hell(o)(.*)/) { - &control.Filter-Id := "%{2}" +if (control.Password.Cleartext =~ /hell(o)(.*)/) { + control.Filter-Id := "%{2}" } -if (!&control.Filter-Id) { +if (!control.Filter-Id) { test_fail } -if (!(&control.Filter-Id == "")) { +if (!(control.Filter-Id == "")) { test_fail } diff --git a/src/tests/keywords/if-regex-error b/src/tests/keywords/if-regex-error index 051f10199a7..b6445ee0a3c 100644 --- a/src/tests/keywords/if-regex-error +++ b/src/tests/keywords/if-regex-error @@ -5,6 +5,6 @@ # # Check that bad regular expressions will fail # -if (&User-Name =~ /[a-3]/) { # ERROR +if (User-Name =~ /[a-3]/) { # ERROR ok } diff --git a/src/tests/keywords/if-regex-match b/src/tests/keywords/if-regex-match index 3da4cf8b32f..a1f21a3db43 100644 --- a/src/tests/keywords/if-regex-match +++ b/src/tests/keywords/if-regex-match @@ -4,10 +4,10 @@ string test_string string dummy_string uint32 test_integer -&test_integer := '123456789' +test_integer := '123456789' # Non matching on attribute ref -if !(&User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{test_string}/) { +if !(User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{test_string}/) { test_fail } @@ -17,16 +17,16 @@ if !("%{User-Name}" =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{ } # Matching on attribute ref with capture groups -if (&User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{test_string}/) { +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}" + reply.User-Name := "%{7}_%{6}_%{5}_%{4}_%{3}_%{2}_%{1}_%{0}" } else { test_fail } # Checking capture groups are cleared out correctly -if (&User-Name =~ /^([0-9])_%{test_string}/) { +if (User-Name =~ /^([0-9])_%{test_string}/) { if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1_1')) { test_fail } @@ -36,7 +36,7 @@ else { } # Checking capture groups are cleared out correctly when there are no matches -if (&User-Name =~ /^.%{test_string}/) { +if (User-Name =~ /^.%{test_string}/) { if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1')) { test_fail } @@ -66,17 +66,17 @@ else { } # uncompiled - ref - insensitive -if !(&Calling-Station-Id =~ /:roamyroam%{test_string}$/i) { +if !(Calling-Station-Id =~ /:roamyroam%{test_string}$/i) { test_fail } # uncompiled - expansion - insensitive -if !(&Calling-Station-Id =~ /:roamyroam%{test_string}$/i) { +if !(Calling-Station-Id =~ /:roamyroam%{test_string}$/i) { test_fail } # uncompiled - enum - ref - insensitive -if !(&Service-Type =~ /^framed-user%{test_string}$/i) { +if !(Service-Type =~ /^framed-user%{test_string}$/i) { test_fail } @@ -86,48 +86,48 @@ if !("%{Service-Type}" =~ /^framed-user%{test_string}$/i) { } # uncompiled - enum - ref -if (&Service-Type =~ /^framed-user%{test_string}$/) { +if (Service-Type =~ /^framed-user%{test_string}$/) { test_fail } # uncompiled - integer - ref -if !(&test_integer =~ /%{test_integer}/) { +if !(test_integer =~ /%{test_integer}/) { test_fail } -&test_string := "foo\nbar" +test_string := "foo\nbar" # uncompiled - ref - multiline -if !(&test_string =~ /^foo$%{dummy_string}/m) { +if !(test_string =~ /^foo$%{dummy_string}/m) { test_fail } # uncompiled - ref - non-multiline -if (&test_string =~ /^foo$%{dummy_string}/) { +if (test_string =~ /^foo$%{dummy_string}/) { test_fail } # uncompiled - ref - non-multiline -if !(&test_string =~ /^foo\nbar%{dummy_string}$/) { +if !(test_string =~ /^foo\nbar%{dummy_string}$/) { test_fail } # uncompiled - ref - multiline -if !(&test_string =~ /^bar%{dummy_string}$/m) { +if !(test_string =~ /^bar%{dummy_string}$/m) { test_fail } # uncompiled - ref - multiline - sensitive -if (&test_string =~ /^BAR%{dummy_string}$/m) { +if (test_string =~ /^BAR%{dummy_string}$/m) { test_fail } # uncompiled - ref - multiline - insensitive -if !(&test_string =~ /^BAR%{dummy_string}$/mi) { +if !(test_string =~ /^BAR%{dummy_string}$/mi) { test_fail } # uncompiled - ref - multiline - insensitive (flag order reversed) -if !(&test_string =~ /^BAR%{dummy_string}$/im) { +if !(test_string =~ /^BAR%{dummy_string}$/im) { test_fail } diff --git a/src/tests/keywords/if-regex-match-comp b/src/tests/keywords/if-regex-match-comp index 566421a8662..498a514646b 100644 --- a/src/tests/keywords/if-regex-match-comp +++ b/src/tests/keywords/if-regex-match-comp @@ -3,7 +3,7 @@ string test_string # Non matching on attribute ref -if !(&User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])/) { +if !(User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])/) { test_fail } @@ -13,16 +13,16 @@ if !("%{User-Name}" =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])/) } # Matching on attribute ref with capture groups -if (&User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])/) { +if (User-Name =~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])/) { # Test all the capture groups - &reply.User-Name := "%{7}_%{6}_%{5}_%{4}_%{3}_%{2}_%{1}_%{0}" + reply.User-Name := "%{7}_%{6}_%{5}_%{4}_%{3}_%{2}_%{1}_%{0}" } else { test_fail } # Checking capture groups are cleared out correctly -if (&User-Name =~ /^([0-9])_/) { +if (User-Name =~ /^([0-9])_/) { if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1_1')) { test_fail } @@ -32,7 +32,7 @@ else { } # Checking capture groups are cleared out correctly when there are no matches -if (&User-Name =~ /^./) { +if (User-Name =~ /^./) { if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1')) { test_fail } @@ -42,17 +42,17 @@ else { } # compiled - ref - insensitive -if !(&Calling-Station-Id =~ /:roamyroam$/i) { +if !(Calling-Station-Id =~ /:roamyroam$/i) { test_fail } # compiled - expansion - insensitive -if !(&Calling-Station-Id =~ /:roamyroam$/i) { +if !(Calling-Station-Id =~ /:roamyroam$/i) { test_fail } # compiled - enum - ref - insensitive -if !(&Service-Type =~ /^framed-user$/i) { +if !(Service-Type =~ /^framed-user$/i) { test_fail } @@ -62,46 +62,46 @@ if !("%{Service-Type}" =~ /^framed-user$/i) { } # compiled - enum - ref -if (&Service-Type =~ /^framed-user$/) { +if (Service-Type =~ /^framed-user$/) { test_fail } -&test_string := "foo\nbar" +test_string := "foo\nbar" # compiled - ref - multiline -if !(&test_string =~ /^foo$/m) { +if !(test_string =~ /^foo$/m) { test_fail } # compiled - ref - non-multiline -if (&test_string =~ /^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')) && !(&test_string =~ /^foo\nbar$/)) { +if ((('${feature.regex-pcre}' == 'yes') || ('${feature.regex-pcre2}' == 'yes')) && !(test_string =~ /^foo\nbar$/)) { test_fail } # compiled - ref - multiline -if !(&test_string =~ /^bar$/m) { +if !(test_string =~ /^bar$/m) { test_fail } # compiled - ref - multiline - sensitive -if (&test_string =~ /^BAR$/m) { +if (test_string =~ /^BAR$/m) { test_fail } # compiled - ref - multiline - insensitive -if !(&test_string =~ /^BAR$/mi) { +if !(test_string =~ /^BAR$/mi) { test_fail } # compiled - ref - multiline - insensitive (flag order reversed) -if !(&test_string =~ /^BAR$/im) { +if !(test_string =~ /^BAR$/im) { test_fail } diff --git a/src/tests/keywords/if-regex-match-named b/src/tests/keywords/if-regex-match-named index dbaa9f49b51..1cbfb218aee 100644 --- a/src/tests/keywords/if-regex-match-named +++ b/src/tests/keywords/if-regex-match-named @@ -4,9 +4,9 @@ string result_string string dummy_string if (('${feature.regex-pcre}' == 'yes') || ('${feature.regex-pcre2}' == 'yes')) { - &request += { - &NAS-Port = '123456789' - &Port-Limit = 1 + request += { + NAS-Port = '123456789' + Port-Limit = 1 } # Check failure when no previous capture - full capture @@ -14,38 +14,38 @@ if (%regex()) { test_fail } -if (!(&Module-Failure-Message[*] == "No previous regex capture")) { +if (!(Module-Failure-Message[*] == "No previous regex capture")) { test_fail } -&request -= &Module-Failure-Message[*] +request -= Module-Failure-Message[*] # Check failure when no previous capture - named group if (%regex(foo)) { test_fail } -if (!(&Module-Failure-Message[*] == "No previous named regex capture group")) { +if (!(Module-Failure-Message[*] == "No previous named regex capture group")) { test_fail } -&request -= &Module-Failure-Message[*] +request -= Module-Failure-Message[*] # Check failure when no previous capture - numbered group if (%regex(%{Port-Limit})) { test_fail } -if (!(&Module-Failure-Message[*] == "No previous numbered regex capture group")) { +if (!(Module-Failure-Message[*] == "No previous numbered regex capture group")) { test_fail } -&request -= &Module-Failure-Message[*] +request -= Module-Failure-Message[*] # uncompiled - ref - named capture groups -if (&User-Name =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+)_(?[^_])_(?6)_(?[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')) { +if (User-Name =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+)_(?[^_])_(?6)_(?[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 } } @@ -54,9 +54,9 @@ else { } # Checking capture groups are cleared out correctly -if (&User-Name =~ /^(?[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')) { +if (User-Name =~ /^(?[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 } } @@ -65,9 +65,9 @@ else { } # Checking capture groups are cleared out correctly when there are no matches -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')) { +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 } } @@ -76,9 +76,9 @@ else { } # compiled - ref - named capture groups -if (&User-Name =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+)_(?[^_])_(?6)_(?[7-8])/) { - &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')) { +if (User-Name =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+)_(?[^_])_(?6)_(?[7-8])/) { + 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 } } @@ -88,8 +88,8 @@ else { # compiled - xlat - named capture groups if ('1_2_3_4_5_6_7' =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+)_(?[^_])_(?6)_(?[7-8])/) { - &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')) { + 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 } } @@ -98,9 +98,9 @@ else { } # compiled - ref - named capture groups (numeric indexes) -if (&User-Name =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+)_(?[^_])_(?6)_(?[7-8])/) { - &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')) { +if (User-Name =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+)_(?[^_])_(?6)_(?[7-8])/) { + 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 } @@ -110,7 +110,7 @@ else { } # compiled - ref - named capture groups (numeric indexes using expansion) -if (&User-Name =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+)_(?[^_])_(?6)_(?[7-8])/) { +if (User-Name =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+)_(?[^_])_(?6)_(?[7-8])/) { uint32 a uint32 b uint32 c @@ -119,17 +119,17 @@ if (&User-Name =~ /^(?[0-9])_(?[0-9])?_(?[0-9]*)_(?[0-9]+ 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')) { + 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 } } diff --git a/src/tests/keywords/if-regex-multivalue b/src/tests/keywords/if-regex-multivalue index e1f989e319f..a54008dfbd3 100644 --- a/src/tests/keywords/if-regex-multivalue +++ b/src/tests/keywords/if-regex-multivalue @@ -2,10 +2,10 @@ # PRE: update if # -&Vendor-Specific.Cisco.AVPair := { 'foo=bar', 'bar=baz', 'baz=foo' } +Vendor-Specific.Cisco.AVPair := { 'foo=bar', 'bar=baz', 'baz=foo' } -if (&Vendor-Specific.Cisco.AVPair[1] =~ /bar=(.*)/) { +if (Vendor-Specific.Cisco.AVPair[1] =~ /bar=(.*)/) { if (!("%{1}" == 'baz')) { test_fail } @@ -14,7 +14,7 @@ else { test_fail } -if (&Vendor-Specific.Cisco.AVPair[*] =~ /bar=(.*)/) { +if (Vendor-Specific.Cisco.AVPair[*] =~ /bar=(.*)/) { if (!("%{1}" == 'baz')) { test_fail } diff --git a/src/tests/keywords/if-regex-nil b/src/tests/keywords/if-regex-nil index 0bb6c6057a7..7b75f57bf7b 100644 --- a/src/tests/keywords/if-regex-nil +++ b/src/tests/keywords/if-regex-nil @@ -1,7 +1,7 @@ # # PRE: if # -if !(&User-Name =~ /^\0/) { +if !(User-Name =~ /^\0/) { success } else { test_fail diff --git a/src/tests/keywords/if-tlv b/src/tests/keywords/if-tlv index a6ae44917f2..be5fb367017 100644 --- a/src/tests/keywords/if-tlv +++ b/src/tests/keywords/if-tlv @@ -2,9 +2,9 @@ # PRE: if # -%map("&TLS-Certificate.Issuer = 'foo'") +%map("TLS-Certificate.Issuer = 'foo'") -if !(&TLS-Certificate.Issuer == 'foo') { +if !(TLS-Certificate.Issuer == 'foo') { test_fail } diff --git a/src/tests/keywords/immutable b/src/tests/keywords/immutable index e0fe72e1f1e..eb0d795dc0c 100644 --- a/src/tests/keywords/immutable +++ b/src/tests/keywords/immutable @@ -5,21 +5,21 @@ # uint32 test_integer -&NAS-Port := 1812 +NAS-Port := 1812 # # Editing it is fine. # -&NAS-Port += 1 -if !(&NAS-Port == 1813) { +NAS-Port += 1 +if !(NAS-Port == 1813) { test_fail } # # Mark it as immutable. The value shouldn't change. # -%immutable(&request.NAS-Port[*]) -if !(&NAS-Port == 1813) { +%immutable(request.NAS-Port[*]) +if !(NAS-Port == 1813) { test_fail } @@ -27,41 +27,41 @@ if !(&NAS-Port == 1813) { # Try to edit it. The value shouldn't change. # transaction { - &NAS-Port += 1 + NAS-Port += 1 } -if !(&NAS-Port == 1813) { +if !(NAS-Port == 1813) { test_fail } # # We can't delete it. Deletion is a noop # -&request -= &NAS-Port[*] -if !(&NAS-Port == 1813) { +request -= NAS-Port[*] +if !(NAS-Port == 1813) { test_fail } # # We can copy the immutable value. The copy is mutable. # -&test_integer := &NAS-Port -if !(&test_integer == 1813) { +test_integer := NAS-Port +if !(test_integer == 1813) { test_fail } -&test_integer += 1 -if !(&test_integer == 1814) { +test_integer += 1 +if !(test_integer == 1814) { test_fail } # # Add a non-immutable NAS-Port # -&request += { - &NAS-Port = 6809 +request += { + NAS-Port = 6809 } -if !(&NAS-Port[1] == 6809) { +if !(NAS-Port[1] == 6809) { test_fail } @@ -69,12 +69,12 @@ if !(&NAS-Port[1] == 6809) { # Deleting all NAS-Port attributes means that we delete the _mutable_ # ones, and leave the _immutable_ ones in place. # -&request -= &NAS-Port[*] -if !(&NAS-Port == 1813) { +request -= NAS-Port[*] +if !(NAS-Port == 1813) { test_fail } -if (&NAS-Port[#] != 1) { +if (NAS-Port[#] != 1) { test_fail } diff --git a/src/tests/keywords/ipaddr b/src/tests/keywords/ipaddr index e42f8513ef2..0a32f00a6a7 100644 --- a/src/tests/keywords/ipaddr +++ b/src/tests/keywords/ipaddr @@ -3,31 +3,31 @@ # ipaddr result_ipaddr -if (!(&NAS-IP-Address == 127.0.0.1)) { +if (!(NAS-IP-Address == 127.0.0.1)) { test_fail } # Dotted Quad -&result_ipaddr := 127.0.0.1 -if (!(&result_ipaddr == 127.0.0.1)) { +result_ipaddr := 127.0.0.1 +if (!(result_ipaddr == 127.0.0.1)) { test_fail } # Dotted Quad with prefix -&result_ipaddr := 127.0.0.2/32 -if (!(&result_ipaddr == 127.0.0.2)) { +result_ipaddr := 127.0.0.2/32 +if (!(result_ipaddr == 127.0.0.2)) { test_fail } # Hex (0x) -&result_ipaddr := 0x7f000003 -if (!(&result_ipaddr == 127.0.0.3)) { +result_ipaddr := 0x7f000003 +if (!(result_ipaddr == 127.0.0.3)) { test_fail } # Decimal -&result_ipaddr := 2130706436 -if (!(&result_ipaddr == 127.0.0.4)) { +result_ipaddr := 2130706436 +if (!(result_ipaddr == 127.0.0.4)) { test_fail } diff --git a/src/tests/keywords/ipaddr.raw b/src/tests/keywords/ipaddr.raw index e2c03725300..56d46b1c39d 100644 --- a/src/tests/keywords/ipaddr.raw +++ b/src/tests/keywords/ipaddr.raw @@ -5,12 +5,12 @@ # # Malformed NAS-IP-Address # -&raw.4 = 0x010203 +raw.4 = 0x010203 -if (!&raw.4) { +if (!raw.4) { test_fail } -elsif (!(&raw.4 == 0x010203)) { +elsif (!(raw.4 == 0x010203)) { test_fail } diff --git a/src/tests/keywords/ipprefix b/src/tests/keywords/ipprefix index cac67927607..bb7e092aa10 100644 --- a/src/tests/keywords/ipprefix +++ b/src/tests/keywords/ipprefix @@ -4,31 +4,31 @@ 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 +test_ipv4prefix := 198.51.100.255/16 +test_ipv6prefix := ::198.51.100.255/112 +Framed-IP-Address := 198.51.0.1 -if (!(&test_ipv6prefix == '::198.51.0.0/112')) { +if (!(test_ipv6prefix == '::198.51.0.0/112')) { test_fail } -if (!(&test_ipv4prefix == '198.51.0.0/16')) { +if (!(test_ipv4prefix == '198.51.0.0/16')) { test_fail } -if (!(&test_ipv6prefix == ::198.51.0.0/112)) { +if (!(test_ipv6prefix == ::198.51.0.0/112)) { test_fail } -if (!(&test_ipv4prefix == 198.51.0.0/16)) { +if (!(test_ipv4prefix == 198.51.0.0/16)) { test_fail } -if (!(&test_ipv4prefix < 198.0.0.0/8)) { +if (!(test_ipv4prefix < 198.0.0.0/8)) { test_fail } -if (!(&Framed-IP-Address < 198.51.0.0/16)) { +if (!(Framed-IP-Address < 198.51.0.0/16)) { test_fail } diff --git a/src/tests/keywords/join b/src/tests/keywords/join index 8a79688459f..9d0df2bb428 100644 --- a/src/tests/keywords/join +++ b/src/tests/keywords/join @@ -3,17 +3,17 @@ # string result_string -&control -= &Password[*] - -&control += { - &User-Name = &request.User-Name - &User-Password = &request.User-Password - &Filter-Id = "ab c" - &Filter-Id = "de fg" - &NAS-Port = 123 +control -= Password[*] + +control += { + User-Name = request.User-Name + User-Password = request.User-Password + Filter-Id = "ab c" + Filter-Id = "de fg" + NAS-Port = 123 } -&request.Framed-IP-Address := 192.168.1.254 +request.Framed-IP-Address := 192.168.1.254 debug_control debug_request @@ -30,14 +30,14 @@ debug_request # # @todo - fix this... # -&result_string := %concat(%join(%{control.[*]}, %{request.Framed-IP-Address}), '. ') +result_string := %concat(%join(%{control.[*]}, %{request.Framed-IP-Address}), '. ') -if (!(&result_string == "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 } -&result_string := %concat(%join(%{control.Filter-Id[*]}, %{control.NAS-Port}), ',') -if (!(&result_string == "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 } diff --git a/src/tests/keywords/length b/src/tests/keywords/length index 62a346a62c5..ab258c205ee 100644 --- a/src/tests/keywords/length +++ b/src/tests/keywords/length @@ -15,7 +15,7 @@ uint64 test_int64 ipv4prefix test_ipv4prefix uint32 result_int -&test_string := '\ +test_string := '\ abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\ abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\ abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' @@ -24,94 +24,94 @@ if (!(%length(%{test_string}) == 260)) { test_fail } -&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 +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 -&result_int := %length(%{test_string}) -if (!(&result_int == 4)) { +result_int := %length(%{test_string}) +if (!(result_int == 4)) { test_fail } # Octets - bin 0x39383731 -&result_int := %length(%{test_octets}) -if (!(&result_int == 4)) { +result_int := %length(%{test_octets}) +if (!(result_int == 4)) { test_fail } # IP Address - bin 0x39383732 -&result_int := %length(%{test_ipaddr}) -if (!(&result_int == 4)) { +result_int := %length(%{test_ipaddr}) +if (!(result_int == 4)) { test_fail } # String - "hello, world" -&result_int := %length('hello, world') -if (!(&result_int == 12)) { +result_int := %length('hello, world') +if (!(result_int == 12)) { test_fail } # Integer - bin 0x39383734 -&result_int := %length(%{test_integer}) -if (!(&result_int == 4)) { +result_int := %length(%{test_integer}) +if (!(result_int == 4)) { test_fail } # ifid - bin 0x0000000039383737 -&result_int := %length(%{test_ifid}) -if (!(&result_int == 8)) { +result_int := %length(%{test_ifid}) +if (!(result_int == 8)) { test_fail } # ipv6addr - bin 0x00000000000000000000000039383738 -&result_int := %length(%{test_ipv6addr}) -if (!(&result_int == 16)) { +result_int := %length(%{test_ipv6addr}) +if (!(result_int == 16)) { test_fail } # ipv6addrprefix - bin 0x8000000000000000000000000039383739 -&result_int := %length(%{test_ipv6prefix}) -if (!(&result_int == 17)) { +result_int := %length(%{test_ipv6prefix}) +if (!(result_int == 17)) { test_fail } # byte - bin 0x3a -&result_int := %length(%{test_byte}) -if (!(&result_int == 1)) { +result_int := %length(%{test_byte}) +if (!(result_int == 1)) { test_fail } # short - bin 0x373b -&result_int := %length(%{test_short}) -if (!(&result_int == 2)) { +result_int := %length(%{test_short}) +if (!(result_int == 2)) { test_fail } # ethernet - bin 0x00003938373c -&result_int := %length(%{test_ether}) -if (!(&result_int == 6)) { +result_int := %length(%{test_ether}) +if (!(result_int == 6)) { test_fail } # integer64 - bin 0x100000003938373d -&result_int := %length(%{test_int64}) -if (!(&result_int == 8)) { +result_int := %length(%{test_int64}) +if (!(result_int == 8)) { test_fail } # ipv4prefix - bin 0x203938373e -&result_int := %length(%{test_ipv4prefix}) -if (!(&result_int == 5)) { +result_int := %length(%{test_ipv4prefix}) +if (!(result_int == 5)) { test_fail } diff --git a/src/tests/keywords/list-add-error b/src/tests/keywords/list-add-error index dc4c346e29a..03dd3b9941a 100644 --- a/src/tests/keywords/list-add-error +++ b/src/tests/keywords/list-add-error @@ -1,3 +1,3 @@ group foo -&foo := &request + &control # ERROR +foo := request + control # ERROR diff --git a/src/tests/keywords/list-existence b/src/tests/keywords/list-existence index 067b5016e85..57c36d8d817 100644 --- a/src/tests/keywords/list-existence +++ b/src/tests/keywords/list-existence @@ -1,25 +1,25 @@ # # List existence checks are "is the list empty" checks. # -if (&session-state.) { +if (session-state.) { test_fail } -if (&session-state.[*]) { +if (session-state.[*]) { test_fail } -if (&session-state.) { +if (session-state.) { test_fail } -&session-state.User-Name := 'foo' +session-state.User-Name := 'foo' -if (!&session-state.) { +if (!session-state.) { test_fail } -if (!&session-state.[*]) { +if (!session-state.[*]) { test_fail } diff --git a/src/tests/keywords/load-balance b/src/tests/keywords/load-balance index 021ef1a1134..5922576a710 100644 --- a/src/tests/keywords/load-balance +++ b/src/tests/keywords/load-balance @@ -8,78 +8,78 @@ uint32 count1 uint32 count2 -&count1 := 0 -&count2 := 0 +count1 := 0 +count2 := 0 -&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 +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 &NAS-Port { +foreach NAS-Port { load-balance { group { - &count1 += 1 - &request += { - &Reply-Message = "Picked group 1 - %{count1} time(s)" + count1 += 1 + request += { + Reply-Message = "Picked group 1 - %{count1} time(s)" } ok } group { - &count2 += 1 - &request += { - &Reply-Message = "Picked group 2 %{count2} Time(s)" + count2 += 1 + request += { + Reply-Message = "Picked group 2 %{count2} Time(s)" } ok } @@ -89,11 +89,11 @@ foreach &NAS-Port { # 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 ((&count1 == 0) || (&count2 == 0)) { +if ((count1 == 0) || (count2 == 0)) { test_fail } -if !(&count1 + &count2 == 50) { +if !(count1 + count2 == 50) { test_fail } diff --git a/src/tests/keywords/local-array-error b/src/tests/keywords/local-array-error index d0174a6f3aa..8c69119b14a 100644 --- a/src/tests/keywords/local-array-error +++ b/src/tests/keywords/local-array-error @@ -2,5 +2,5 @@ group { uint32 foo # There's only one local variable - &foo[1] := 1 # ERROR + foo[1] := 1 # ERROR } diff --git a/src/tests/keywords/local-delete-error b/src/tests/keywords/local-delete-error index 056ec38b960..ba478f39bdc 100644 --- a/src/tests/keywords/local-delete-error +++ b/src/tests/keywords/local-delete-error @@ -1,11 +1,11 @@ group { uint32 foo - &foo := 1 + foo := 1 debug_request - &request -= &foo # ERROR + request -= foo # ERROR debug_request } diff --git a/src/tests/keywords/local-list-error b/src/tests/keywords/local-list-error index d551de75917..4f5da6a18a5 100644 --- a/src/tests/keywords/local-list-error +++ b/src/tests/keywords/local-list-error @@ -1,5 +1,5 @@ group { uint32 foo - &request.foo := 1 # ERROR + request.foo := 1 # ERROR } diff --git a/src/tests/keywords/local-variable b/src/tests/keywords/local-variable index 25eeccda5a4..639855cdba8 100644 --- a/src/tests/keywords/local-variable +++ b/src/tests/keywords/local-variable @@ -1,6 +1,6 @@ -&Filter-Id := 2 +Filter-Id := 2 -if !(&request.[#] == 5) { +if !(request.[#] == 5) { debug_request test_fail } @@ -12,43 +12,43 @@ group { # We declared it, but it does *not* exist until we assign # a value to it. # - if &foo { + if foo { test_fail } - &foo := 1 + foo := 1 - &Filter-Id := &foo + Filter-Id := foo - if !(&Filter-Id == &foo) { + if !(Filter-Id == foo) { test_fail } # # Local variables are *not* in the request. # - if !(&request.[#] == 5) { + if !(request.[#] == 5) { test_fail } # # Local variables can be expanded # - &Reply-Message := "This is %{foo}" - if !(&Reply-Message == "This is 1") { + Reply-Message := "This is %{foo}" + if !(Reply-Message == "This is 1") { test_fail } - &request -= &Reply-Message + request -= Reply-Message -} # leaving this scope automatically deletes &foo +} # leaving this scope automatically deletes foo -if !(&request.[#] == 5) { +if !(request.[#] == 5) { debug_request test_fail } -if !(&Filter-Id == "1") { +if !(Filter-Id == "1") { test_fail } diff --git a/src/tests/keywords/logical-and b/src/tests/keywords/logical-and index 28575b34928..d717fd174bf 100644 --- a/src/tests/keywords/logical-and +++ b/src/tests/keywords/logical-and @@ -4,35 +4,35 @@ uint32 test_integer1 uint32 test_integer2 -&test_integer1 := 0 -&test_integer2 := 1 +test_integer1 := 0 +test_integer2 := 1 # # (true && true) --> true # # But if it's false, then we have an issue. # -if !((&test_integer1 == 0) && (&test_integer2 == 1)) { +if !((test_integer1 == 0) && (test_integer2 == 1)) { test_fail } # # false && true --> false # -if ((&test_integer1 == 1) && (&test_integer2 == 1)) { +if ((test_integer1 == 1) && (test_integer2 == 1)) { test_fail } # # true && false -> false # -if ((&test_integer1 == 0) && (&test_integer2 == 0)) { +if ((test_integer1 == 0) && (test_integer2 == 0)) { test_fail } -&control.Filter-Id := { "bob", "oof" } +control.Filter-Id := { "bob", "oof" } -if ((&control.Filter-Id[0] == 'bob') && (&control.Filter-Id[1] == 'oof')) { +if ((control.Filter-Id[0] == 'bob') && (control.Filter-Id[1] == 'oof')) { # OK } else { test_fail diff --git a/src/tests/keywords/logical-or b/src/tests/keywords/logical-or index bd804879ed0..ca9cea1db08 100644 --- a/src/tests/keywords/logical-or +++ b/src/tests/keywords/logical-or @@ -4,23 +4,23 @@ uint32 test_integer1 uint32 test_integer2 -&test_integer1 := 0 -&test_integer2 := 1 +test_integer1 := 0 +test_integer2 := 1 -if !((&test_integer1 == 1) || (&test_integer2 == 1)) { +if !((test_integer1 == 1) || (test_integer2 == 1)) { test_fail } -if !((&test_integer2 == 1) || (&test_integer1 == 1)) { +if !((test_integer2 == 1) || (test_integer1 == 1)) { test_fail } # # Neither of these exists, so the resulting string should be empty # -&Filter-Id := "%{&NAS-Port-Id || &NAS-Port-Id}" +Filter-Id := "%{NAS-Port-Id || NAS-Port-Id}" -if !(&Filter-Id == '') { +if !(Filter-Id == '') { test_fail } diff --git a/src/tests/keywords/logical-or-assign b/src/tests/keywords/logical-or-assign index 3c0fc43d2a9..81f536a0be0 100644 --- a/src/tests/keywords/logical-or-assign +++ b/src/tests/keywords/logical-or-assign @@ -1,13 +1,13 @@ string foo -&Acct-Session-Time = 30 +Acct-Session-Time = 30 # # Test for short-circuit logical optimizations # -&foo = %{&Acct-Session-Time || 'NULL'} +foo = %{Acct-Session-Time || 'NULL'} -if !(&foo == "30") { +if !(foo == "30") { test_fail } success diff --git a/src/tests/keywords/map b/src/tests/keywords/map index 2fb87afb575..6d90e35edd5 100644 --- a/src/tests/keywords/map +++ b/src/tests/keywords/map @@ -3,11 +3,11 @@ string CSV-Result # # PRE: map-2arg-error map-empty-error map-module-error map-field-error # -map csv &User-Name { - &CSV-Result := field3 +map csv User-Name { + CSV-Result := field3 } -if (!(&CSV-Result == "success")) { +if (!(CSV-Result == "success")) { test_fail } diff --git a/src/tests/keywords/map-arg3-xlat b/src/tests/keywords/map-arg3-xlat index 3c993001157..f51251c6e99 100644 --- a/src/tests/keywords/map-arg3-xlat +++ b/src/tests/keywords/map-arg3-xlat @@ -8,5 +8,5 @@ # arg3 can be an xlat # map csv "%tolower(%{User-Name})" { - &reply.Result-Status := 'field3' + reply.Result-Status := 'field3' } diff --git a/src/tests/keywords/map-csv-lhs b/src/tests/keywords/map-csv-lhs index ec3a674307e..809d793f868 100644 --- a/src/tests/keywords/map-csv-lhs +++ b/src/tests/keywords/map-csv-lhs @@ -3,5 +3,5 @@ # map csv "%tolower(%{User-Name})" { - &reply.Result-Status := 'field3' + reply.Result-Status := 'field3' } diff --git a/src/tests/keywords/map-csv-prepend b/src/tests/keywords/map-csv-prepend index 170ac8b24f8..c3d0b6136ae 100644 --- a/src/tests/keywords/map-csv-prepend +++ b/src/tests/keywords/map-csv-prepend @@ -2,17 +2,17 @@ # PRE: map # -&control.Filter-Id := "fail" +control.Filter-Id := "fail" -map csv &User-Name { - &control.Filter-Id ^= 'field3' +map csv User-Name { + control.Filter-Id ^= 'field3' } -if (!(&control.Filter-Id[0] == 'success')) { +if (!(control.Filter-Id[0] == 'success')) { test_fail } -if (!(&control.Filter-Id[1] == "fail")) { +if (!(control.Filter-Id[1] == "fail")) { test_fail } diff --git a/src/tests/keywords/map-field-error b/src/tests/keywords/map-field-error index 91a35ca7804..7bc6721fff1 100644 --- a/src/tests/keywords/map-field-error +++ b/src/tests/keywords/map-field-error @@ -1,6 +1,6 @@ # # PRE: map-2arg-error map-empty-error map-module-error # -map csv &User-Name { +map csv User-Name { reply.Filter-Id := 'field2' # ERROR } diff --git a/src/tests/keywords/map-module-error b/src/tests/keywords/map-module-error index 2b2872868a9..1bc8b4012ad 100644 --- a/src/tests/keywords/map-module-error +++ b/src/tests/keywords/map-module-error @@ -2,5 +2,5 @@ # PRE: map-2arg-error # map foo "bar" { # ERROR - &User-Name = 'foo' + User-Name = 'foo' } diff --git a/src/tests/keywords/map-xlat b/src/tests/keywords/map-xlat index 55a7f3cd756..35558ed7577 100644 --- a/src/tests/keywords/map-xlat +++ b/src/tests/keywords/map-xlat @@ -3,31 +3,31 @@ # # Test the map xlat # -&request += { - &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'" +request += { + 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(%{Filter-Id})" == 1)) { test_fail } -if (!(&control.Filter-Id == 'testing123')) { +if (!(control.Filter-Id == 'testing123')) { test_fail } -foreach &NAS-Port-Id[*] { +foreach NAS-Port-Id[*] { if (!("%map(%{Foreach-Variable-0})" == 1)) { test_fail } } -if (!(&Vendor-Specific.Nokia-SR.MSAP-Interface[0] == 'UNICAST_7360OLT3')) { +if (!(Vendor-Specific.Nokia-SR.MSAP-Interface[0] == 'UNICAST_7360OLT3')) { test_fail } -if (!(&Vendor-Specific.Nokia-SR.MSAP-Interface[1] == 'UNICAST_7360OLT4')) { +if (!(Vendor-Specific.Nokia-SR.MSAP-Interface[1] == 'UNICAST_7360OLT4')) { test_fail } diff --git a/src/tests/keywords/map-xlat-nested b/src/tests/keywords/map-xlat-nested index 7f0c71f7baa..385a53e939b 100644 --- a/src/tests/keywords/map-xlat-nested +++ b/src/tests/keywords/map-xlat-nested @@ -3,7 +3,7 @@ # # Test the map xlat # -&Filter-Id := "request.Tmp-Group-0.User-Name = 'testing123'" +Filter-Id := "request.Tmp-Group-0.User-Name = 'testing123'" if (!("%map(%{Filter-Id})" == 1)) { test_fail diff --git a/src/tests/keywords/map-xlat-nested-overwrite b/src/tests/keywords/map-xlat-nested-overwrite index f2b00e7df8e..a61ede0b046 100644 --- a/src/tests/keywords/map-xlat-nested-overwrite +++ b/src/tests/keywords/map-xlat-nested-overwrite @@ -3,7 +3,7 @@ # # Test the map xlat # -&Filter-Id := "request.Tmp-Group-0.Filter-Id := 'testing123'" +Filter-Id := "request.Tmp-Group-0.Filter-Id := 'testing123'" if (!(%map("%{Filter-Id}") == 1)) { test_fail @@ -17,11 +17,11 @@ if (!(%map("request.Tmp-Group-0.User-Name := 'testing000'") == 1)) { test_fail } -if (!&Tmp-Group-0[0].Filter-Id || (!(&Tmp-Group-0[0].Filter-Id == 'testing123'))) { +if (!Tmp-Group-0[0].Filter-Id || (!(Tmp-Group-0[0].Filter-Id == 'testing123'))) { test_fail } -if (!&Tmp-Group-0[0].User-Name || (!(&Tmp-Group-0[0].User-Name == 'testing000'))) { +if (!Tmp-Group-0[0].User-Name || (!(Tmp-Group-0[0].User-Name == 'testing000'))) { test_fail } diff --git a/src/tests/keywords/map-xlat-struct b/src/tests/keywords/map-xlat-struct index 8f0b298532c..5f898b90218 100644 --- a/src/tests/keywords/map-xlat-struct +++ b/src/tests/keywords/map-xlat-struct @@ -6,17 +6,17 @@ # string test_string -&test_string := "IA-PD.IAID = 11" +test_string := "IA-PD.IAID = 11" if (!("%map(%{test_string})" == 1)) { test_fail } -if (!&IA-PD.IAID) { +if (!IA-PD.IAID) { test_fail } -if (!(&IA-PD.IAID == 11)) { +if (!(IA-PD.IAID == 11)) { test_fail } diff --git a/src/tests/keywords/md4 b/src/tests/keywords/md4 index a095fb6de73..61ec0f170ac 100644 --- a/src/tests/keywords/md4 +++ b/src/tests/keywords/md4 @@ -6,36 +6,36 @@ string dummy_string octets test_octets octets result_octets -&test_string := "This is a string\n" -&test_octets := 0x000504030201 +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. # -&result_octets := %md4("This is a string\n") -if (!(&result_octets == 0x1f60d5cd85e17bfbdda7c923822f060c)) { +result_octets := %md4("This is a string\n") +if (!(result_octets == 0x1f60d5cd85e17bfbdda7c923822f060c)) { test_fail } -&result_octets := %md4("%{test_string}") -if (!(&result_octets == 0x1f60d5cd85e17bfbdda7c923822f060c)) { +result_octets := %md4("%{test_string}") +if (!(result_octets == 0x1f60d5cd85e17bfbdda7c923822f060c)) { test_fail } # # MD4 should also be able to cope with references to octet attributes # -&result_octets := %md4("%{test_octets}") -if (!(&result_octets == 0xac3ed17b3cf19ec38352ec534a932fc6)) { +result_octets := %md4("%{test_octets}") +if (!(result_octets == 0xac3ed17b3cf19ec38352ec534a932fc6)) { test_fail } # # MD4 of null string is d41d8cd98f00b204e9800998ecf8427e # -&result_octets := %md4("%{dummy_string}") -if (!(&result_octets == 0x31d6cfe0d16ae931b73c59d7e0c089c0)) { +result_octets := %md4("%{dummy_string}") +if (!(result_octets == 0x31d6cfe0d16ae931b73c59d7e0c089c0)) { test_fail } diff --git a/src/tests/keywords/md5 b/src/tests/keywords/md5 index 591edba2187..92117c5e81f 100644 --- a/src/tests/keywords/md5 +++ b/src/tests/keywords/md5 @@ -8,55 +8,55 @@ string test_hmac_data octets test_octets octets result_octets -&test_string := "This is a string\n" -&test_octets := 0x000504030201 -&test_hmac_key := "what do ya want for nothing?" -&test_hmac_data := "Jefe" +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. # -&result_octets := %md5("This is a string\n") -if (!(&result_octets == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) { +result_octets := %md5("This is a string\n") +if (!(result_octets == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) { test_fail } -&result_octets := %md5("%{test_string}") -if (!(&result_octets == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) { +result_octets := %md5("%{test_string}") +if (!(result_octets == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) { test_fail } # # MD5 should also be able to cope with references to octet attributes # -&result_octets := %md5("%{test_octets}") -if (!(&result_octets == 0xc1e7fa505b2fc1fd0da6cac3db6f6f44)) { +result_octets := %md5("%{test_octets}") +if (!(result_octets == 0xc1e7fa505b2fc1fd0da6cac3db6f6f44)) { test_fail } # # MD5 of null string is d41d8cd98f00b204e9800998ecf8427e # -&result_octets := %md5("%{dummy_string}") -if (!(&result_octets == 0xd41d8cd98f00b204e9800998ecf8427e)) { +result_octets := %md5("%{dummy_string}") +if (!(result_octets == 0xd41d8cd98f00b204e9800998ecf8427e)) { test_fail } # # MD5 HMAC with attribute references # -&result_octets := %hmacmd5("%{test_hmac_key}", "%{test_hmac_data}") -if (!(&result_octets == 0x750c783e6ab0b503eaa86e310a5db738)) { +result_octets := %hmacmd5("%{test_hmac_key}", "%{test_hmac_data}") +if (!(result_octets == 0x750c783e6ab0b503eaa86e310a5db738)) { test_fail } # # MD5 HMAC with empty key and data # -&dummy_string := '' -&result_octets := %hmacmd5("%{dummy_string}", "%{dummy_string}") -if (!(&result_octets == 0x74e6f7298a9c2d168935f58c001bad88)) { +dummy_string := '' +result_octets := %hmacmd5("%{dummy_string}", "%{dummy_string}") +if (!(result_octets == 0x74e6f7298a9c2d168935f58c001bad88)) { test_fail } diff --git a/src/tests/keywords/md5-error b/src/tests/keywords/md5-error index 68f166c3434..1f720ccaa92 100644 --- a/src/tests/keywords/md5-error +++ b/src/tests/keywords/md5-error @@ -4,13 +4,13 @@ string test_string octets result_octets -&test_string := "hello" +test_string := "hello" # # MD5 HMAC with missing key should fail # -&result_octets := %hmacmd5(%{test_string}, ) -if &result_octets { +result_octets := %hmacmd5(%{test_string}, ) +if result_octets { test_fail } success diff --git a/src/tests/keywords/module-failure-message b/src/tests/keywords/module-failure-message index 22088ce3249..76f774c2cae 100644 --- a/src/tests/keywords/module-failure-message +++ b/src/tests/keywords/module-failure-message @@ -4,23 +4,23 @@ test -if !(&Module-Failure-Message[4] == 'test: RERROR error message') { +if !(Module-Failure-Message[4] == 'test: RERROR error message') { test_fail } -if !(&Module-Failure-Message[3] == 'test: RDEBUG error message') { +if !(Module-Failure-Message[3] == 'test: RDEBUG error message') { test_fail } -if !(&Module-Failure-Message[2] == 'test: RDEBUG2 error message') { +if !(Module-Failure-Message[2] == 'test: RDEBUG2 error message') { test_fail } -if !(&Module-Failure-Message[1] == 'test: RDEBUG3 error message') { +if !(Module-Failure-Message[1] == 'test: RDEBUG3 error message') { test_fail } -if !(&Module-Failure-Message[0] == 'test: RDEBUG4 error message') { +if !(Module-Failure-Message[0] == 'test: RDEBUG4 error message') { test_fail } diff --git a/src/tests/keywords/mschap b/src/tests/keywords/mschap index 2080105bf38..a240d702afa 100644 --- a/src/tests/keywords/mschap +++ b/src/tests/keywords/mschap @@ -7,78 +7,78 @@ octets result_octets # # over-write the existing User-Name # -&User-Name := 'EXAMPLE\bob' +User-Name := 'EXAMPLE\bob' # MS CHAPv1 -&request += { - &Vendor-Specific.Microsoft.CHAP-Challenge = 0xe96e4fff2955c4f1 - &Vendor-Specific.Microsoft.CHAP-Response = 0x00010000000000000000000000000000000000000000000000008860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f +request += { + Vendor-Specific.Microsoft.CHAP-Challenge = 0xe96e4fff2955c4f1 + Vendor-Specific.Microsoft.CHAP-Response = 0x00010000000000000000000000000000000000000000000000008860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f } -&result_octets := %mschap(Challenge) -if !(&result_octets == 0xe96e4fff2955c4f1) { +result_octets := %mschap(Challenge) +if !(result_octets == 0xe96e4fff2955c4f1) { test_fail } -&result_octets := %mschap(NT-Response) -if !(&result_octets == 0x8860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f) { +result_octets := %mschap(NT-Response) +if !(result_octets == 0x8860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f) { test_fail } -&result_string := %mschap(NT-Domain) -if !(&result_string == 'EXAMPLE') { +result_string := %mschap(NT-Domain) +if !(result_string == 'EXAMPLE') { test_fail } -&result_string := %mschap(User-Name) -if !(&result_string == 'bob') { +result_string := %mschap(User-Name) +if !(result_string == 'bob') { test_fail } -&request.Vendor-Specific.Microsoft.CHAP-Response := 0x00006937d7935bb28a4c1dafe6a193bdea7a853a74d8bcf6db158860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f +request.Vendor-Specific.Microsoft.CHAP-Response := 0x00006937d7935bb28a4c1dafe6a193bdea7a853a74d8bcf6db158860bbaac0cd3960b4ce5dc6f0f7a462b897ef530484e80f -&result_octets := %mschap(LM-Response) +result_octets := %mschap(LM-Response) -if !(&result_octets == 0x6937d7935bb28a4c1dafe6a193bdea7a853a74d8bcf6db15) { +if !(result_octets == 0x6937d7935bb28a4c1dafe6a193bdea7a853a74d8bcf6db15) { test_fail } # Hashing -&result_octets := %mschap(NT-Hash, 'testing_123') -if !(&result_octets == 0xfa782604f85eb3564f555648341b53e4) { +result_octets := %mschap(NT-Hash, 'testing_123') +if !(result_octets == 0xfa782604f85eb3564f555648341b53e4) { test_fail } -&result_octets := %mschap(LM-Hash, 'testing_123') -if !(&result_octets == 0x2d5545077d7b7d2ae4343f96ab15c596) { +result_octets := %mschap(LM-Hash, 'testing_123') +if !(result_octets == 0x2d5545077d7b7d2ae4343f96ab15c596) { test_fail } # MS CHAPv2 -&request -= &Vendor-Specific.Microsoft.CHAP-Response[*] +request -= Vendor-Specific.Microsoft.CHAP-Response[*] -&Vendor-Specific.Microsoft.CHAP-Challenge := 0x04408dc2a98dae1ce351dfc53f57d08e -&Vendor-Specific.Microsoft.CHAP2-Response := 0x00010e93cfbfcef8d5b6af42d2b2ca5b43180000000000000000bc068d1e8c54de5e9db78e6736d686eb88a999dd7fa239b200 +Vendor-Specific.Microsoft.CHAP-Challenge := 0x04408dc2a98dae1ce351dfc53f57d08e +Vendor-Specific.Microsoft.CHAP2-Response := 0x00010e93cfbfcef8d5b6af42d2b2ca5b43180000000000000000bc068d1e8c54de5e9db78e6736d686eb88a999dd7fa239b200 -&result_octets := %mschap(Challenge) -if !(&result_octets == 0xad18b6b8e1478b4c) { +result_octets := %mschap(Challenge) +if !(result_octets == 0xad18b6b8e1478b4c) { test_fail } -&result_octets := %mschap(NT-Response) -if !(&result_octets == 0xbc068d1e8c54de5e9db78e6736d686eb88a999dd7fa239b2) { +result_octets := %mschap(NT-Response) +if !(result_octets == 0xbc068d1e8c54de5e9db78e6736d686eb88a999dd7fa239b2) { test_fail } # Invalid -&Vendor-Specific.Microsoft.CHAP-Challenge := 0xf0eac4151d5346662ba8c5e428 -&result_string := %mschap(Challenge) +Vendor-Specific.Microsoft.CHAP-Challenge := 0xf0eac4151d5346662ba8c5e428 +result_string := %mschap(Challenge) -if (&result_string) { +if (result_string) { test_fail } -if (!(&Module-Failure-Message == "Invalid MS-CHAP challenge length")) { +if (!(Module-Failure-Message == "Invalid MS-CHAP challenge length")) { test_fail } diff --git a/src/tests/keywords/net_src_ip b/src/tests/keywords/net_src_ip index 92a110a2f7f..eb6cd702713 100644 --- a/src/tests/keywords/net_src_ip +++ b/src/tests/keywords/net_src_ip @@ -1,7 +1,7 @@ # # This is the default for the tests # -if !(&Net.Src.IP == 127.0.0.1) { +if !(Net.Src.IP == 127.0.0.1) { test_fail } success diff --git a/src/tests/keywords/nexttime b/src/tests/keywords/nexttime index 69c567b6613..a044cac8226 100644 --- a/src/tests/keywords/nexttime +++ b/src/tests/keywords/nexttime @@ -8,26 +8,26 @@ uint32 result_integer # different numbers of days involved. Check hour / day / week # -&result_integer := "%{%nexttime(2h) - %nexttime(1h)}" +result_integer := "%{%nexttime(2h) - %nexttime(1h)}" # We have a fudge factor of 1 second either way -if ((&result_integer < 3599) || (&result_integer > 3601)) { +if ((result_integer < 3599) || (result_integer > 3601)) { test_fail } # # Day # -&result_integer := "%{%nexttime(3d) - %nexttime(1d)}" -if ((&result_integer < 172799) || (&result_integer > 172801)) { +result_integer := "%{%nexttime(3d) - %nexttime(1d)}" +if ((result_integer < 172799) || (result_integer > 172801)) { test_fail } # # Week # -&result_integer := "%{%nexttime(4w) - %nexttime(2w)}" -if ((&result_integer < 1209599) || (&result_integer > 1209601)) { +result_integer := "%{%nexttime(4w) - %nexttime(2w)}" +if ((result_integer < 1209599) || (result_integer > 1209601)) { test_fail } diff --git a/src/tests/keywords/notfound b/src/tests/keywords/notfound index 1247b53e920..53baf17d6f2 100644 --- a/src/tests/keywords/notfound +++ b/src/tests/keywords/notfound @@ -6,7 +6,7 @@ string dummy_string # # This doesn't exist, so the condition shouldn't match. # -if (&dummy_string == "foo") { +if (dummy_string == "foo") { test_fail } else { @@ -16,7 +16,7 @@ else { # # Since the middle part doesn't match, "NOT" the middle part SHOULD match. # -if (!(&dummy_string == "foo")) { +if (!(dummy_string == "foo")) { ok } else { diff --git a/src/tests/keywords/ok-return b/src/tests/keywords/ok-return index 6399d1ac627..904428a3099 100644 --- a/src/tests/keywords/ok-return +++ b/src/tests/keywords/ok-return @@ -1,5 +1,5 @@ -&control.Auth-Type := ::Accept -&reply.Reply-Message := 'pass' +control.Auth-Type := ::Accept +reply.Reply-Message := 'pass' # Section should exit after this statement diff --git a/src/tests/keywords/pack b/src/tests/keywords/pack index 935be8a1224..7eaf100968c 100644 --- a/src/tests/keywords/pack +++ b/src/tests/keywords/pack @@ -3,25 +3,25 @@ # octets result_octets -&request += { - &Framed-IP-Address = 127.0.0.1 - &NAS-Port = 2112 - &NAS-IP-Address = 127.0.0.2 +request += { + Framed-IP-Address = 127.0.0.1 + NAS-Port = 2112 + NAS-IP-Address = 127.0.0.2 } -&result_octets := (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 (!(&result_octets == 0x7f000001000008407f000002)) { +if (!(result_octets == 0x7f000001000008407f000002)) { test_fail } # # With octet addition, we don't need %pack() any more! # -&result_octets := (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 (!(&result_octets == 0x7f000001000008407f000002)) { +if (!(result_octets == 0x7f000001000008407f000002)) { test_fail } diff --git a/src/tests/keywords/pad b/src/tests/keywords/pad index 38fa63754b7..073c8961af0 100644 --- a/src/tests/keywords/pad +++ b/src/tests/keywords/pad @@ -3,7 +3,7 @@ # string test_string -&test_string = "test" +test_string = "test" # # rpad tests diff --git a/src/tests/keywords/pairs b/src/tests/keywords/pairs index ea06846410a..9d358f0e1a7 100644 --- a/src/tests/keywords/pairs +++ b/src/tests/keywords/pairs @@ -3,13 +3,13 @@ # string result_string -&request -= &Packet-Type[*] +request -= Packet-Type[*] -&Tmp-Group-0 += { - &Filter-Id = "This is a string" - &Filter-Id = "This is another one" - &Class = 0x000504030201 - &NAS-Port = 7331 +Tmp-Group-0 += { + Filter-Id = "This is a string" + Filter-Id = "This is another one" + Class = 0x000504030201 + NAS-Port = 7331 } # @@ -18,58 +18,58 @@ string result_string # @todo - this doesn't work. tmpl_afrom_attr_substr() doesn't check # the tail da, or the parent of the tail. # -#&pairs := %{(string) %{Tmp-Group-0.[*]}} +#pairs := %{(string) %{Tmp-Group-0.[*]}} # # However, this does "work". It returns a concatenated string # of the _values_ of the attributes, which doesn't include th # attribute names. # -#&pairs := %cast('string', %{Tmp-Group-0.[*]}) +#pairs := %cast('string', %{Tmp-Group-0.[*]}) -&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') { +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 } -&result_string := "%pairs(Tmp-Group-0.Filter-Id)" -if !(&result_string == 'Filter-Id = "This is a string"') { +result_string := "%pairs(Tmp-Group-0.Filter-Id)" +if !(result_string == 'Filter-Id = "This is a string"') { test_fail } -&result_string := "%concat(%pairs(Tmp-Group-0.Filter-Id[*]), ', ')" -if !(&result_string == 'Filter-Id = "This is a string", Filter-Id = "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 # -&result_string := "%concat(%pairs(control.[*]), ', ')" -if !(&result_string == 'Password = { Cleartext = "hello" }') { +result_string := "%concat(%pairs(control.[*]), ', ')" +if !(result_string == 'Password = { Cleartext = "hello" }') { test_fail } -&result_string := "%pairs(control.User-Name)" -if (!(&result_string == '')) { +result_string := "%pairs(control.User-Name)" +if (!(result_string == '')) { test_fail } -&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 }') { +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.Filter-Id) { +request -= Tmp-Group-0[*] +if (request.Tmp-Group-0.Filter-Id) { test_fail } # # Parse pairs from a string! # -&request += "%{result_string}" -if !(&request.Tmp-Group-0.Filter-Id == 'This is a string') { +request += "%{result_string}" +if !(request.Tmp-Group-0.Filter-Id == 'This is a string') { test_fail } diff --git a/src/tests/keywords/pap b/src/tests/keywords/pap index 7a5779c0ea2..02e74ecc555 100644 --- a/src/tests/keywords/pap +++ b/src/tests/keywords/pap @@ -5,14 +5,14 @@ string salt string result_string octets result_octets -&control := {} -&salt := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK" # 60 byte salt +control := {} +salt := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK" # 60 byte salt # # Unencoded Password.Cleartext in password with header # -&control := { - &Password.With-Header = &User-Password +control := { + Password.With-Header = User-Password } pap.authorize @@ -26,9 +26,9 @@ if (reject) { # # Base64 encoded Password.Cleartext in password with header # -&result_string := "{clear}%{User-Password}" -&control := { - &Password.With-Header = %base64.encode(%{result_string}) +result_string := "{clear}%{User-Password}" +control := { + Password.With-Header = %base64.encode(%{result_string}) } pap.authorize @@ -42,8 +42,8 @@ if (reject) { # # Hex encoded SSHA password # -&control := { - &Password.With-Header = "{ssha}%hex(%sha1(%{User-Password}%{salt}))%hex(%{salt})" +control := { + Password.With-Header = "{ssha}%hex(%sha1(%{User-Password}%{salt}))%hex(%{salt})" } pap.authorize @@ -57,14 +57,14 @@ if (reject) { # # Base64 encoded SSHA password # -&result_string := "%hex(%sha1(%{User-Password}%{salt}))%hex(%{salt})" +result_string := "%hex(%sha1(%{User-Password}%{salt}))%hex(%{salt})" # To Binary -&result_octets := "%bin(%{result_string})" +result_octets := "%bin(%{result_string})" # To Base64 -&result_string := "%base64.encode(%{result_octets})" -&control.Password.With-Header := "{ssha}%{result_string}" +result_string := "%base64.encode(%{result_octets})" +control.Password.With-Header := "{ssha}%{result_string}" pap.authorize pap.authenticate { @@ -78,14 +78,14 @@ if (reject) { # # Base64 of Base64 encoded SSHA password # -&result_string := "%hex(%sha1(%{User-Password}%{salt}))%hex(%{salt})" +result_string := "%hex(%sha1(%{User-Password}%{salt}))%hex(%{salt})" # To Binary -&result_octets := "%bin(%{result_string})" +result_octets := "%bin(%{result_string})" # To Base64 -&result_string := "{ssha}%base64.encode(%{result_octets})" -&control.Password.With-Header := "%base64.encode(%{result_string})" +result_string := "{ssha}%base64.encode(%{result_octets})" +control.Password.With-Header := "%base64.encode(%{result_string})" pap.authorize pap.authenticate { @@ -96,8 +96,8 @@ if (reject) { } -&control := { - &Auth-Type = ::Accept +control := { + Auth-Type = ::Accept } success diff --git a/src/tests/keywords/pap-ssha2 b/src/tests/keywords/pap-ssha2 index b6571c689d3..b955a6db311 100644 --- a/src/tests/keywords/pap-ssha2 +++ b/src/tests/keywords/pap-ssha2 @@ -13,18 +13,18 @@ octets result_octets # Skip if the server wasn't built with openssl # if (!('${feature.tls}' == 'yes')) { - &reply.Packet-Type := Access-Accept + reply.Packet-Type := Access-Accept handled } -&control := {} -&salt := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK" # 60 byte salt +control := {} +salt := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK" # 60 byte salt # # Hex encoded SSHA2-512 password # -&control += { - &Password.With-Header = "{ssha512}%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})" +control += { + Password.With-Header = "{ssha512}%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})" } pap.authorize @@ -35,21 +35,21 @@ if (reject) { test_fail } -&control := {} +control := {} # # Base64 encoded SSHA2-512 password # -&result_string := "%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})" +result_string := "%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})" # To Binary -&result_octets := "%bin(%{result_string})" +result_octets := "%bin(%{result_string})" # To Base64 -&result_string := "%base64.encode(%{result_octets})" +result_string := "%base64.encode(%{result_octets})" -&control += { - &Password.With-Header = "{ssha512}%{result_string}" +control += { + Password.With-Header = "{ssha512}%{result_string}" } pap.authorize @@ -60,21 +60,21 @@ if (reject) { test_fail } -&control := {} +control := {} # # Base64 of Base64 encoded SSHA2-512 password # -&result_string := "%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})" +result_string := "%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})" # To Binary -&result_octets := "%bin(%{result_string})" +result_octets := "%bin(%{result_string})" # To Base64 -&result_string := "{ssha512}%base64.encode(%{result_octets})" +result_string := "{ssha512}%base64.encode(%{result_octets})" -&control += { - &Password.With-Header = "%base64.encode(%{result_string})" +control += { + Password.With-Header = "%base64.encode(%{result_string})" } pap.authorize @@ -85,12 +85,12 @@ if (reject) { test_fail } -&control := {} +control := {} # # Base64 of SHA2-384 password (in SHA2-Password) # -&control.Password.SHA2 := %hex(%sha2_384(%{User-Password})) +control.Password.SHA2 := %hex(%sha2_384(%{User-Password})) pap.authorize pap.authenticate { @@ -100,14 +100,14 @@ if (reject) { test_fail } -&control := { - &Auth-Type = ::Accept +control := { + Auth-Type = ::Accept } # # Base64 of SHA2-256 password (in SHA2-256-Password) # -&control.Password.SHA2-256 := "%hex(%sha2_256(%{User-Password}))" +control.Password.SHA2-256 := "%hex(%sha2_256(%{User-Password}))" pap.authorize pap.authenticate { @@ -117,12 +117,12 @@ if (reject) { test_fail } -&control := {} +control := {} # # Base64 of SHA2-224 password (in SHA2-224-Password - No hex armour) # -&control.Password.SHA2-224 := "%sha2_224(%{User-Password})" +control.Password.SHA2-224 := "%sha2_224(%{User-Password})" pap.authorize pap.authenticate { @@ -132,8 +132,8 @@ if (reject) { test_fail } -&control := { - &Auth-Type = ::Accept +control := { + Auth-Type = ::Accept } success diff --git a/src/tests/keywords/parallel b/src/tests/keywords/parallel index b169b2161a2..bacd7323336 100644 --- a/src/tests/keywords/parallel +++ b/src/tests/keywords/parallel @@ -1,22 +1,22 @@ parallel { group { - &parent.control += { - &NAS-Port = 1 + parent.control += { + NAS-Port = 1 } } group { - &parent.control += { - &NAS-Port = 3 + parent.control += { + NAS-Port = 3 } } group { - &parent.control += { - &NAS-Port = 5 + parent.control += { + NAS-Port = 5 } } group { - &parent.control += { - &NAS-Port = 7 + parent.control += { + NAS-Port = 7 } } } diff --git a/src/tests/keywords/parallel-rcode b/src/tests/keywords/parallel-rcode index 7ef5dda7ba1..e44f5723252 100644 --- a/src/tests/keywords/parallel-rcode +++ b/src/tests/keywords/parallel-rcode @@ -27,7 +27,7 @@ group { parallel { fail group { # This should *NOT* be dispatched - &Filter-Id := 'foo' + Filter-Id := 'foo' } } actions { @@ -37,7 +37,7 @@ group { if (!fail) { test_fail } -if (&Filter-Id) { +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.Filter-Id := 'foo' + parent.request.Filter-Id := 'foo' } } actions { @@ -61,7 +61,7 @@ group { if (!fail) { test_fail } -if (!(&Filter-Id == 'foo')) { +if (!(Filter-Id == 'foo')) { test_fail } diff --git a/src/tests/keywords/parallel-yield b/src/tests/keywords/parallel-yield index 55ef6ecfd76..e31d95bf801 100644 --- a/src/tests/keywords/parallel-yield +++ b/src/tests/keywords/parallel-yield @@ -6,11 +6,11 @@ parallel { reschedule group { - &parent.request.Filter-Id := 'foo' + parent.request.Filter-Id := 'foo' } } -if (!(&Filter-Id == 'foo')) { +if (!(Filter-Id == 'foo')) { test_fail } diff --git a/src/tests/keywords/rand b/src/tests/keywords/rand index 146eac22e64..576bac75810 100644 --- a/src/tests/keywords/rand +++ b/src/tests/keywords/rand @@ -1,15 +1,15 @@ string result_string uint32 result_integer -&result_integer := %rand('123') -if (!&result_integer) { +result_integer := %rand('123') +if (!result_integer) { test_fail } # # Make sure random number is within limit # -if (&result_integer < 0 || &result_integer > 123) { +if (result_integer < 0 || result_integer > 123) { test_fail } diff --git a/src/tests/keywords/randstr b/src/tests/keywords/randstr index 1d59df385e6..a8598d3c641 100644 --- a/src/tests/keywords/randstr +++ b/src/tests/keywords/randstr @@ -3,27 +3,27 @@ string result_string # # Empty output on empty input # -&result_string := "%randstr(%{result_string})" -if !(&result_string == "") { +result_string := "%randstr(%{result_string})" +if !(result_string == "") { test_fail } # # Check length of output # -&result_string := "%randstr(nnn)" +result_string := "%randstr(nnn)" if (!(%length(%{result_string}) == 3)) { test_fail } -&result_string := "%randstr(24a)" +result_string := "%randstr(24a)" if (!(%length(%{result_string}) == 24)) { test_fail } # # Check maximum repetition # -&result_string := "%randstr(1030aa)" +result_string := "%randstr(1030aa)" if (!(%length(%{result_string}) == 1025)) { test_fail } @@ -31,16 +31,16 @@ if (!(%length(%{result_string}) == 1025)) { # # Check invalid character class # -&result_string := "%randstr(G)" +result_string := "%randstr(G)" -if !(&result_string == "") { +if !(result_string == "") { test_fail } # # Check repetition of binary output # -&result_string := "%randstr(10b)" +result_string := "%randstr(10b)" if (!(%length(%{result_string}) == 10)) { test_fail } diff --git a/src/tests/keywords/redundant b/src/tests/keywords/redundant index be43c2e9e04..31a4babf237 100644 --- a/src/tests/keywords/redundant +++ b/src/tests/keywords/redundant @@ -6,44 +6,44 @@ # uint32 count -&count := 0 -&request += { - &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 +count := 0 +request += { + 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 { uint32 foo group { - &foo := 1 + foo := 1 fail } group { - if !(&foo == 1) { + if !(foo == 1) { test_fail } success } } -if (!&reply.Result-Status) { +if (!reply.Result-Status) { test_fail } # # Loop 0..9 # -foreach &NAS-Port { +foreach NAS-Port { redundant { group { # fail on even numbered values, succeed on odd numbered ones @@ -51,9 +51,9 @@ foreach &NAS-Port { fail } else { - &count += 1 - &request += { - &Reply-Message = "Succeed odd %{Foreach-Variable-0} %{count}" + count += 1 + request += { + Reply-Message = "Succeed odd %{Foreach-Variable-0} %{count}" } ok } @@ -64,9 +64,9 @@ foreach &NAS-Port { fail } else { - &count += 1 - &request += { - &Reply-Message = "Succeed even %{Foreach-Variable-0} %{count}" + count += 1 + request += { + Reply-Message = "Succeed even %{Foreach-Variable-0} %{count}" } ok } @@ -74,7 +74,7 @@ foreach &NAS-Port { } } -if (!(&count == %{NAS-Port[#]})) { +if (!(count == %{NAS-Port[#]})) { test_fail } diff --git a/src/tests/keywords/redundant-load-balance b/src/tests/keywords/redundant-load-balance index 9a0dbe9521a..10c1cae65d6 100644 --- a/src/tests/keywords/redundant-load-balance +++ b/src/tests/keywords/redundant-load-balance @@ -6,24 +6,24 @@ # uint32 count -&count := 0; -&request += { - &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 +count := 0; +request += { + 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 &NAS-Port { +foreach NAS-Port { redundant-load-balance { group { # fail on even numbered values, succeed on odd numbered ones @@ -31,9 +31,9 @@ foreach &NAS-Port { fail } else { - &count += 1 - &request += { - &Reply-Message = "Succeed odd %{Foreach-Variable-0} %{count}" + count += 1 + request += { + Reply-Message = "Succeed odd %{Foreach-Variable-0} %{count}" } ok } @@ -44,9 +44,9 @@ foreach &NAS-Port { fail } else { - &count += 1 - &request += { - &Reply-Message = "Succeed even %{Foreach-Variable-0} %{count}" + count += 1 + request += { + Reply-Message = "Succeed even %{Foreach-Variable-0} %{count}" } ok } @@ -54,7 +54,7 @@ foreach &NAS-Port { } } -if (!(&count == %{NAS-Port[#]})) { +if (!(count == %{NAS-Port[#]})) { test_fail } diff --git a/src/tests/keywords/redundant-map-fail b/src/tests/keywords/redundant-map-fail index cf300335d08..8157cf9d3af 100644 --- a/src/tests/keywords/redundant-map-fail +++ b/src/tests/keywords/redundant-map-fail @@ -1,11 +1,11 @@ redundant { - map test-fail &Filter-Id { - &NAS-Port := '$[3][2]' + map test-fail Filter-Id { + NAS-Port := '$[3][2]' } noop } -if (noop || (&NAS-Port == 4294967295)) { +if (noop || (NAS-Port == 4294967295)) { success } else { fail diff --git a/src/tests/keywords/redundant-redundant b/src/tests/keywords/redundant-redundant index 9730014cd28..8da1eef2d3d 100644 --- a/src/tests/keywords/redundant-redundant +++ b/src/tests/keywords/redundant-redundant @@ -8,27 +8,27 @@ uint32 count2 uint32 count3 uint32 count4 -&count1 = 0 -&count2 = 0 -&count3 = 0 -&count4 = 0 +count1 = 0 +count2 = 0 +count3 = 0 +count4 = 0 redundant { redundant-load-balance { group { - &count1 += 1 + count1 += 1 fail } group { - &count2 += 1 + count2 += 1 fail } group { - &count3 += 1 + count3 += 1 fail } group { - &count4 += 1 + count4 += 1 fail } } @@ -44,21 +44,21 @@ if (!ok) { return } -if (!(&count1 == 1)) { +if (!(count1 == 1)) { test_fail } -if (!(&count2 == 1)) { +if (!(count2 == 1)) { test_fail return } -if (!(&count3 == 1)) { +if (!(count3 == 1)) { test_fail return } -if (!(&count4 == 1)) { +if (!(count4 == 1)) { test_fail return } diff --git a/src/tests/keywords/regex-escape b/src/tests/keywords/regex-escape index 5f469cbbdf0..2ec0fc36f23 100644 --- a/src/tests/keywords/regex-escape +++ b/src/tests/keywords/regex-escape @@ -8,14 +8,14 @@ string test_string2 # Strings which are expanded in a regex have regex special # characters escaped. Because the input strings are unsafe. # -&test_string1 := "%taint(example.com)" -&test_string2 := "%taint(exampleXcom)" +test_string1 := "%taint(example.com)" +test_string2 := "%taint(exampleXcom)" if ("exampleXcom" =~ /%{test_string1}/) { test_fail } -if (&test_string2 =~ /%{test_string1}/) { +if (test_string2 =~ /%{test_string1}/) { test_fail } diff --git a/src/tests/keywords/regex-lhs b/src/tests/keywords/regex-lhs index 17c4ccc5274..d52a3a6ea09 100644 --- a/src/tests/keywords/regex-lhs +++ b/src/tests/keywords/regex-lhs @@ -8,13 +8,13 @@ string test_string2 # Strings which are expanded in a regex have regex special # characters escaped. Because the input strings are unsafe. # -&test_string1 = "example.com" -&test_string2 = "^foo$bar" +test_string1 = "example.com" +test_string2 = "^foo$bar" -if !(&test_string1 =~ /example\.com$/) { +if !(test_string1 =~ /example\.com$/) { test_fail } -elsif !(&test_string2 =~ /\^foo\$bar/) { +elsif !(test_string2 =~ /\^foo\$bar/) { test_fail } diff --git a/src/tests/keywords/retry-section b/src/tests/keywords/retry-section index 48085c65eb7..2a0abf99571 100644 --- a/src/tests/keywords/retry-section +++ b/src/tests/keywords/retry-section @@ -1,10 +1,10 @@ # PRE: if uint32 count -&count := 0 +count := 0 group { - &count += 1 + count += 1 noop actions { @@ -16,7 +16,7 @@ group { } } -if (!(&count == 3)) { +if (!(count == 3)) { test_fail } diff --git a/src/tests/keywords/return b/src/tests/keywords/return index e75da443951..fb0f06d3c4d 100644 --- a/src/tests/keywords/return +++ b/src/tests/keywords/return @@ -1,7 +1,7 @@ # # PRE: if # -if (&User-Name == "bob") { +if (User-Name == "bob") { success # @@ -9,7 +9,7 @@ if (&User-Name == "bob") { # will prevent the "pap" module from being run # in the "authorize" section. # - &control.Auth-Type := ::PAP + control.Auth-Type := ::PAP # # Stop processing "authorize", and go to the next section. diff --git a/src/tests/keywords/return-break-mix b/src/tests/keywords/return-break-mix index fef36587efe..6f13fe163bb 100644 --- a/src/tests/keywords/return-break-mix +++ b/src/tests/keywords/return-break-mix @@ -1,14 +1,14 @@ # # PRE: if return foreach # -&control += { - &NAS-Port = 0 - &NAS-Port = 1 - &NAS-Port = 2 - &NAS-Port = 3 +control += { + NAS-Port = 0 + NAS-Port = 1 + NAS-Port = 2 + NAS-Port = 3 } -foreach &control.NAS-Port { +foreach control.NAS-Port { policy_return # Should continue executing @@ -16,17 +16,17 @@ foreach &control.NAS-Port { break } - &control -= { - &NAS-Port == "%{Foreach-Variable-0}" + control -= { + NAS-Port == "%{Foreach-Variable-0}" } } # Everything should have been removed except -# the last incidence of &NAS-Port -if (!&control.NAS-Port) { +# the last incidence of NAS-Port +if (!control.NAS-Port) { test_fail } -if (!(&control.NAS-Port[0] == 2)) { +if (!(control.NAS-Port[0] == 2)) { test_fail } diff --git a/src/tests/keywords/return-group b/src/tests/keywords/return-group index 0813cdf4219..22f5277e837 100644 --- a/src/tests/keywords/return-group +++ b/src/tests/keywords/return-group @@ -1,7 +1,7 @@ # # PRE: return # -&control.Auth-Type := 'Accept' +control.Auth-Type := 'Accept' group { # Section should exit after this statement @@ -10,8 +10,8 @@ group { } # This entry should never be reached - &reply.Reply-Message := 'fail' + reply.Reply-Message := 'fail' } # We should continue processing after the previous group. -&reply.Reply-Message := 'pass' +reply.Reply-Message := 'pass' diff --git a/src/tests/keywords/return-section b/src/tests/keywords/return-section index 9b5746474d1..841b637b4fd 100644 --- a/src/tests/keywords/return-section +++ b/src/tests/keywords/return-section @@ -1,7 +1,7 @@ # # PRE: if return # -if (&User-Name == "bob") { +if (User-Name == "bob") { ok # @@ -9,7 +9,7 @@ if (&User-Name == "bob") { # will prevent the "pap" module from being run # in the "authorize" section. # - &control.Auth-Type := ::PAP + control.Auth-Type := ::PAP # # Stop processing "authorize", and go to the next section. diff --git a/src/tests/keywords/return-within-condition-dynamic b/src/tests/keywords/return-within-condition-dynamic index 97703b95ba9..148d8f2d9e7 100644 --- a/src/tests/keywords/return-within-condition-dynamic +++ b/src/tests/keywords/return-within-condition-dynamic @@ -1,13 +1,13 @@ # # PRE: if # -if (&User-Name == 'bob') { +if (User-Name == 'bob') { accept success return } # Should not execute this condition -if (&User-Name == 'bob') { +if (User-Name == 'bob') { reject } diff --git a/src/tests/keywords/return-within-condition-static b/src/tests/keywords/return-within-condition-static index d211c63fc95..92705440ceb 100644 --- a/src/tests/keywords/return-within-condition-static +++ b/src/tests/keywords/return-within-condition-static @@ -8,7 +8,7 @@ if ("no" == no) { } # Should not execute this condition -if (&User-Name == 'bob') { +if (User-Name == 'bob') { reject } diff --git a/src/tests/keywords/return-within-foreach b/src/tests/keywords/return-within-foreach index 6379675add9..a33a9169edb 100644 --- a/src/tests/keywords/return-within-foreach +++ b/src/tests/keywords/return-within-foreach @@ -1,15 +1,15 @@ # # PRE: if return foreach # -&control += { - &NAS-Port = 0 - &NAS-Port = 1 - &NAS-Port = 2 - &NAS-Port = 3 +control += { + NAS-Port = 0 + NAS-Port = 1 + NAS-Port = 2 + NAS-Port = 3 } group { - foreach &control.NAS-Port { + foreach control.NAS-Port { if ("%{Foreach-Variable-0}" == '2') { accept success diff --git a/src/tests/keywords/return-within-if-after-policy b/src/tests/keywords/return-within-if-after-policy index 1c383f3b190..78a0fb759c4 100644 --- a/src/tests/keywords/return-within-if-after-policy +++ b/src/tests/keywords/return-within-if-after-policy @@ -6,7 +6,7 @@ if ('true' == 'true') { accept success - if(&User-Name == 'bob') { + if(User-Name == 'bob') { %debug(%debug(0)) # Noop return } diff --git a/src/tests/keywords/sha1 b/src/tests/keywords/sha1 index 570b80c3349..98324d8d659 100644 --- a/src/tests/keywords/sha1 +++ b/src/tests/keywords/sha1 @@ -8,46 +8,46 @@ string dummy_string octets result_octets -&test_string := "This is a string\n" -&test_hmac_key := "what do ya want for nothing?" -&test_hmac_data := "Jefe" +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. # -&result_octets := %sha1("This is a string\n") -if (!(&result_octets == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) { +result_octets := %sha1("This is a string\n") +if (!(result_octets == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) { test_fail } -&result_octets := %sha1("%{test_string}") -if (!(&result_octets == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) { +result_octets := %sha1("%{test_string}") +if (!(result_octets == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) { test_fail } # # SHA1 of empty string # -&result_octets := %sha1("%{dummy_string}") -if (!(&result_octets == 0xda39a3ee5e6b4b0d3255bfef95601890afd80709)) { +result_octets := %sha1("%{dummy_string}") +if (!(result_octets == 0xda39a3ee5e6b4b0d3255bfef95601890afd80709)) { test_fail } # # SHA1 HMAC with attribute references # -&result_octets := %hmacsha1("%{test_hmac_key}", "%{test_hmac_data}") -if (!(&result_octets == 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79)) { +result_octets := %hmacsha1("%{test_hmac_key}", "%{test_hmac_data}") +if (!(result_octets == 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79)) { test_fail } # # SHA1 HMAC with empty key and data # -&dummy_string := '' -&result_octets := %hmacsha1("%{dummy_string}", "%{dummy_string}") -if (!(&result_octets == 0xfbdb1d1b18aa6c08324b7d64b71fb76370690e1d)) { +dummy_string := '' +result_octets := %hmacsha1("%{dummy_string}", "%{dummy_string}") +if (!(result_octets == 0xfbdb1d1b18aa6c08324b7d64b71fb76370690e1d)) { test_fail } diff --git a/src/tests/keywords/sha1-error b/src/tests/keywords/sha1-error index 28fc7120192..fd3426a7dc9 100644 --- a/src/tests/keywords/sha1-error +++ b/src/tests/keywords/sha1-error @@ -1,12 +1,12 @@ string test_string octets result_octets -&test_string := "hello" +test_string := "hello" # # SHA1 HMAC with missing key should fail # -&result_octets := %hmacsha1(%{test_string}, ) # ERROR -if &result_octets { +result_octets := %hmacsha1(%{test_string}, ) # ERROR +if result_octets { test_fail } success diff --git a/src/tests/keywords/sha2 b/src/tests/keywords/sha2 index a91d4bb0862..27345564d7e 100644 --- a/src/tests/keywords/sha2 +++ b/src/tests/keywords/sha2 @@ -6,36 +6,36 @@ octets test_octets octets dummy_octets octets result_octets -&test_string := "This is a string\n" -&test_octets := 0x000504030201 +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. # -&result_octets := %sha2_256("This is a string\n") -if (!(&result_octets == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) { +result_octets := %sha2_256("This is a string\n") +if (!(result_octets == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) { test_fail } -&result_octets := %sha2_256(%{test_string}) -if (!(&result_octets == 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 # -&result_octets := %sha2_256(%{test_octets}) -if (!(&result_octets == 0xf307e202b881fded70e58017aa0c4d7b29c76ab25d02bf078301a5f6635187eb)) { +result_octets := %sha2_256(%{test_octets}) +if (!(result_octets == 0xf307e202b881fded70e58017aa0c4d7b29c76ab25d02bf078301a5f6635187eb)) { test_fail } # # SHA256 of empty string # -&result_octets := %sha2_256(%{dummy_octets}) -if (!(&result_octets == 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)) { +result_octets := %sha2_256(%{dummy_octets}) +if (!(result_octets == 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)) { test_fail } @@ -43,18 +43,18 @@ if (!(&result_octets == 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca49599 # SHA512 and SHA256 share common code paths, so the tests don't need to be # as exhaustive. # -&result_octets := %sha2_512("This is a string\n") -if (!(&result_octets == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) { +result_octets := %sha2_512("This is a string\n") +if (!(result_octets == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) { test_fail } -&result_octets := %sha2_512(%{test_string}) -if (!(&result_octets == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) { +result_octets := %sha2_512(%{test_string}) +if (!(result_octets == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) { test_fail } -&result_octets := %sha2_512(%{test_octets}) -if (!(&result_octets == 0xde80271eb5e03a1c24dd0cd823a22305a743ee3a54f1de5bf97adbf56984561154bfb6928b1da4ccc3f5dde9f4032ad461937b60b9ace4ad3898cf45c90596d7)) { +result_octets := %sha2_512(%{test_octets}) +if (!(result_octets == 0xde80271eb5e03a1c24dd0cd823a22305a743ee3a54f1de5bf97adbf56984561154bfb6928b1da4ccc3f5dde9f4032ad461937b60b9ace4ad3898cf45c90596d7)) { test_fail } diff --git a/src/tests/keywords/sign b/src/tests/keywords/sign index d5c1eaed0f9..d9b8d2590db 100644 --- a/src/tests/keywords/sign +++ b/src/tests/keywords/sign @@ -1,3 +1,3 @@ -&NAS-Port := -1000 # ERROR +NAS-Port := -1000 # ERROR test_fail diff --git a/src/tests/keywords/suberequest-cancel b/src/tests/keywords/suberequest-cancel deleted file mode 100644 index b596d9a7656..00000000000 --- a/src/tests/keywords/suberequest-cancel +++ /dev/null @@ -1,26 +0,0 @@ -# -# PRE: subrequest -# - -# Cancel in subrequest -subrequest Access-Request { - %cancel() - test_fail -} - -# Cancel in nested subrequest -subrequest Access-Request { - subrequest Access-Request { - %cancel() - test_fail - } -} - -# Cancel parent with active subrequest, will run on next timer service -%cancel(100ms) -subrequest Access-Request { - %delay_10s(1s) -} - -test_fail - diff --git a/src/tests/keywords/suberequest-cancel.attrs b/src/tests/keywords/suberequest-cancel.attrs deleted file mode 100644 index 3bb22a1cc46..00000000000 --- a/src/tests/keywords/suberequest-cancel.attrs +++ /dev/null @@ -1,9 +0,0 @@ -# -# Input packet -# -Packet-Type = Access-Request - -# -# Expected answer -# -Packet-Type == 0 diff --git a/src/tests/keywords/subrequest b/src/tests/keywords/subrequest index b5560f827c3..79fa129e820 100644 --- a/src/tests/keywords/subrequest +++ b/src/tests/keywords/subrequest @@ -1,12 +1,12 @@ subrequest ::Access-Request { - &parent.control.User-Name := 'bob' + parent.control.User-Name := 'bob' success } -if (!&control.User-Name) { +if (!control.User-Name) { test_fail } -if (!(&control.User-Name == 'bob')) { +if (!(control.User-Name == 'bob')) { test_fail } diff --git a/src/tests/keywords/subrequest-attr b/src/tests/keywords/subrequest-attr index 4d0cead3409..3a0f536a44f 100644 --- a/src/tests/keywords/subrequest-attr +++ b/src/tests/keywords/subrequest-attr @@ -1,21 +1,21 @@ # # PRE: subrequest # -&control.Filter-Id := "Access-Request" +control.Filter-Id := "Access-Request" # # Subrequest with an attribute reference # -subrequest &control.Filter-Id { - &parent.control.User-Name := 'bob' +subrequest control.Filter-Id { + parent.control.User-Name := 'bob' success } -if (!&control.User-Name) { +if (!control.User-Name) { test_fail } -if (!(&control.User-Name == 'bob')) { +if (!(control.User-Name == 'bob')) { test_fail } diff --git a/src/tests/keywords/subrequest-cancel b/src/tests/keywords/subrequest-cancel index 74229e8a26c..1be929835af 100644 --- a/src/tests/keywords/subrequest-cancel +++ b/src/tests/keywords/subrequest-cancel @@ -3,22 +3,22 @@ string bar # Cancel in subrequest subrequest ::Access-Request { - &parent.foo := 'testing' + parent.foo := 'testing' # Immediately cancel the subrequest %cancel(0) - &parent.bar := 'should not see me' + parent.bar := 'should not see me' # We should've been cancelled here test_fail } -if (!(&foo == 'testing')) { +if (!(foo == 'testing')) { test_fail } -if (&bar == 'should not see me') { +if (bar == 'should not see me') { test_fail } success diff --git a/src/tests/keywords/subrequest-detach b/src/tests/keywords/subrequest-detach index b791c93837a..66cdca77e82 100644 --- a/src/tests/keywords/subrequest-detach +++ b/src/tests/keywords/subrequest-detach @@ -1,25 +1,25 @@ # # PRE: subrequest # -&Filter-Id := 'testing' +Filter-Id := 'testing' # Cancel in subrequest subrequest ::Access-Request { detach # Smoke test, check for crashes - if (&parent.Filter-Id == 'testing') { + if (parent.Filter-Id == 'testing') { test_fail } - &parent.Reply-Message = '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 (&Reply-Message && (&Reply-Message == 'testing')) { +if (Reply-Message && (Reply-Message == 'testing')) { test_fail } diff --git a/src/tests/keywords/subrequest-if b/src/tests/keywords/subrequest-if index 9c17bd5149a..cab73f6e824 100644 --- a/src/tests/keywords/subrequest-if +++ b/src/tests/keywords/subrequest-if @@ -2,17 +2,17 @@ # PRE: subrequest # subrequest ::Access-Request { - &User-Name := &parent.request.User-Name + User-Name := parent.request.User-Name - if (!&User-Name) { + if (!User-Name) { test_fail } - if (!(&User-Name == 'bob')) { + if (!(User-Name == 'bob')) { test_fail } - &parent.control.User-Name := 'bob' + parent.control.User-Name := 'bob' success } diff --git a/src/tests/keywords/subrequest-request-qualifiers b/src/tests/keywords/subrequest-request-qualifiers index 177a5c8f2b4..747ebe60ce2 100644 --- a/src/tests/keywords/subrequest-request-qualifiers +++ b/src/tests/keywords/subrequest-request-qualifiers @@ -2,68 +2,68 @@ subrequest ::Access-Request { # # Prefix/attribute parsing disambiguation # - &outer.request.Outer-Realm-Name := 'testing123' + outer.request.Outer-Realm-Name := 'testing123' - &User-Name := "obo" + User-Name := "obo" subrequest ::Access-Request { - &User-Name := "jim" + User-Name := "jim" subrequest ::Access-Request { - &User-Name := "joe" + User-Name := "joe" - &outer.request += { - &Filter-Id = ¤t.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 = ¤t.outer.User-Name - &Filter-Id = &parent.current.outer.User-Name - &Filter-Id = "%{parent.parent.parent.parent.User-Name}" - &Filter-Id = "%{outer.parent.User-Name}" + outer.request += { + 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}" } } } } -if !(&Outer-Realm-Name == 'testing123') { +if !(Outer-Realm-Name == 'testing123') { test_fail } -if !(&Filter-Id[0] == 'joe') { +if !(Filter-Id[0] == 'joe') { test_fail } -if !(&Filter-Id[1] == 'jim') { +if !(Filter-Id[1] == 'jim') { test_fail } -if !(&Filter-Id[2] == 'obo') { +if !(Filter-Id[2] == 'obo') { test_fail } -if !(&Filter-Id[3] == 'bob') { +if !(Filter-Id[3] == 'bob') { test_fail } -if !(&Filter-Id[4] == 'bob') { +if !(Filter-Id[4] == 'bob') { test_fail } -if !(&Filter-Id[5] == 'bob') { +if !(Filter-Id[5] == 'bob') { test_fail } -if !(&Filter-Id[6] == 'bob') { +if !(Filter-Id[6] == 'bob') { test_fail } -if !(&Filter-Id[7] == "") { +if !(Filter-Id[7] == "") { test_fail } -if !(&Filter-Id[8] == "") { +if !(Filter-Id[8] == "") { test_fail } diff --git a/src/tests/keywords/subrequest-return b/src/tests/keywords/subrequest-return index c9f98878d2e..7f37b79fc14 100644 --- a/src/tests/keywords/subrequest-return +++ b/src/tests/keywords/subrequest-return @@ -1,19 +1,19 @@ subrequest ::Access-Request { - &parent.request.Filter-Id := "testing1234" + parent.request.Filter-Id := "testing1234" return # # Should be ignored # - &parent.request.Reply-Message := "testing1234" + parent.request.Reply-Message := "testing1234" } -if (&Reply-Message) { +if (Reply-Message) { test_fail } -if (!(&Filter-Id == "testing1234")) { +if (!(Filter-Id == "testing1234")) { test_fail } diff --git a/src/tests/keywords/subrequest-src-dst b/src/tests/keywords/subrequest-src-dst index 23a64046e96..985d094fa67 100644 --- a/src/tests/keywords/subrequest-src-dst +++ b/src/tests/keywords/subrequest-src-dst @@ -1,27 +1,27 @@ # # PRE: subrequest # -subrequest ::Access-Request &request &reply.Tmp-Group-0 { - if (!&User-Name) { +subrequest ::Access-Request request reply.Tmp-Group-0 { + if (!User-Name) { test_fail } - if (!(&User-Name == 'bob')) { + if (!(User-Name == 'bob')) { test_fail } - &reply.Filter-Id := 'hello from subrequest' + reply.Filter-Id := 'hello from subrequest' } -if (!&reply.Tmp-Group-0) { +if (!reply.Tmp-Group-0) { test_fail } -if (!&reply.Tmp-Group-0.Filter-Id) { +if (!reply.Tmp-Group-0.Filter-Id) { test_fail } -if !(&reply.Tmp-Group-0.Filter-Id == 'hello from subrequest') { +if !(reply.Tmp-Group-0.Filter-Id == 'hello from subrequest') { test_fail } diff --git a/src/tests/keywords/subrequest-src-dst-nested b/src/tests/keywords/subrequest-src-dst-nested index af1f91ebc2a..5f9119f97e6 100644 --- a/src/tests/keywords/subrequest-src-dst-nested +++ b/src/tests/keywords/subrequest-src-dst-nested @@ -1,29 +1,29 @@ # # PRE: subrequest # -subrequest ::Access-Request &request &reply.Tmp-Group-0 { - subrequest ::Access-Request &request &reply.Tmp-Group-0 { - if (!&User-Name) { +subrequest ::Access-Request request reply.Tmp-Group-0 { + subrequest ::Access-Request request reply.Tmp-Group-0 { + if (!User-Name) { test_fail } - if (!(&User-Name == 'bob')) { + if (!(User-Name == 'bob')) { test_fail } - &reply.Filter-Id := 'hello from subrequest' + reply.Filter-Id := 'hello from subrequest' } } -if (!&reply.Tmp-Group-0.Tmp-Group-0) { +if (!reply.Tmp-Group-0.Tmp-Group-0) { test_fail } -if (!&reply.Tmp-Group-0.Tmp-Group-0.Filter-Id) { +if (!reply.Tmp-Group-0.Tmp-Group-0.Filter-Id) { test_fail } -if !(&reply.Tmp-Group-0.Tmp-Group-0.Filter-Id == 'hello from subrequest') { +if !(reply.Tmp-Group-0.Tmp-Group-0.Filter-Id == 'hello from subrequest') { test_fail } diff --git a/src/tests/keywords/substr b/src/tests/keywords/substr index 69a12cd11d7..a6a35981194 100644 --- a/src/tests/keywords/substr +++ b/src/tests/keywords/substr @@ -5,9 +5,9 @@ string test_string octets test_octets uint32 test_int -&test_string = "hello world" -&test_octets = 0x01234567 -&test_int = 123456 +test_string = "hello world" +test_octets = 0x01234567 +test_int = 123456 if !(%substr(%{test_string}, 1, 3) == 'ell') { test_fail diff --git a/src/tests/keywords/switch b/src/tests/keywords/switch index b95853fff0f..898c7121823 100644 --- a/src/tests/keywords/switch +++ b/src/tests/keywords/switch @@ -1,15 +1,15 @@ -switch &User-Name { +switch User-Name { case "bob" { success } case "doug" { - &Filter-Id := "doug" + Filter-Id := "doug" test_fail } default { - &Filter-Id := "default" + Filter-Id := "default" test_fail } } @@ -20,12 +20,12 @@ switch "%{User-Name}" { } case 'doug' { - &Filter-Id := "doug" + Filter-Id := "doug" test_fail } default { - &Filter-Id := "default" + Filter-Id := "default" test_fail } } diff --git a/src/tests/keywords/switch-case-error b/src/tests/keywords/switch-case-error index 12f5951a6d2..073dedc7b0b 100644 --- a/src/tests/keywords/switch-case-error +++ b/src/tests/keywords/switch-case-error @@ -1,13 +1,13 @@ -switch &User-Name { +switch User-Name { case "%{Filter-Id}" { # ERROR success } case "doug" { - &Filter-Id := "doug" + Filter-Id := "doug" } default { - &Filter-Id := "default" + Filter-Id := "default" } } diff --git a/src/tests/keywords/switch-default b/src/tests/keywords/switch-default index 626a3b74fe0..f2de15dcd89 100644 --- a/src/tests/keywords/switch-default +++ b/src/tests/keywords/switch-default @@ -1,12 +1,12 @@ # PRE: switch # -switch &User-Name { +switch User-Name { case "harry" { - &Filter-Id := "harry" + Filter-Id := "harry" } case "doug" { - &Filter-Id := "doug" + Filter-Id := "doug" } case { diff --git a/src/tests/keywords/switch-escape b/src/tests/keywords/switch-escape index 8491b41d632..b40fd4a78be 100644 --- a/src/tests/keywords/switch-escape +++ b/src/tests/keywords/switch-escape @@ -1,5 +1,5 @@ string test_string -&test_string := 'foo' +test_string := 'foo' switch "%tolower(%{test_string})" { case 'foo' { diff --git a/src/tests/keywords/switch-integer b/src/tests/keywords/switch-integer index 2c061dfee38..373d47b3795 100644 --- a/src/tests/keywords/switch-integer +++ b/src/tests/keywords/switch-integer @@ -1,6 +1,6 @@ -&request.REST-HTTP-Status-Code := 200 +request.REST-HTTP-Status-Code := 200 -switch &request.REST-HTTP-Status-Code { +switch request.REST-HTTP-Status-Code { case 200 { success } diff --git a/src/tests/keywords/switch-nodefault b/src/tests/keywords/switch-nodefault index e412989be41..380a7141411 100644 --- a/src/tests/keywords/switch-nodefault +++ b/src/tests/keywords/switch-nodefault @@ -2,13 +2,13 @@ # User-Name is "bob", and a switch statement # with no "default" should not crash the server. # -switch &User-Name { +switch User-Name { case "doug" { - &Filter-Id := "doug" + Filter-Id := "doug" } } -if (&reply.Filter-Id) { +if (reply.Filter-Id) { test_fail } diff --git a/src/tests/keywords/switch-value-error b/src/tests/keywords/switch-value-error index bb1fcfd37e2..3de3050ca7d 100644 --- a/src/tests/keywords/switch-value-error +++ b/src/tests/keywords/switch-value-error @@ -1,7 +1,7 @@ # # PRE: switch # -switch &Service-Type { +switch Service-Type { case Login-User { test_fail } diff --git a/src/tests/keywords/switch-virtual b/src/tests/keywords/switch-virtual index a919299d62a..50b63cdfc3b 100644 --- a/src/tests/keywords/switch-virtual +++ b/src/tests/keywords/switch-virtual @@ -5,7 +5,7 @@ # # Virtual attribute references get mashed to xlats # -switch &Packet-Type { +switch Packet-Type { case Access-Request { success } diff --git a/src/tests/keywords/switch-xlat-error b/src/tests/keywords/switch-xlat-error index 519a74fee07..4464094f609 100644 --- a/src/tests/keywords/switch-xlat-error +++ b/src/tests/keywords/switch-xlat-error @@ -1,7 +1,7 @@ # # PRE: switch # -switch &User-Name { +switch User-Name { case "%no-such-module(bob)" { # ERROR test_fail } diff --git a/src/tests/keywords/timeout b/src/tests/keywords/timeout index 4765ed335af..807c2032dec 100644 --- a/src/tests/keywords/timeout +++ b/src/tests/keywords/timeout @@ -10,7 +10,7 @@ bool c # redundant { timeout 0.01s { - &a := %delay_10s(0.1) + a := %delay_10s(0.1) test_fail } @@ -21,7 +21,7 @@ redundant { redundant { timeout "0.01" { - &a := %delay_10s(0.1) + a := %delay_10s(0.1) test_fail } @@ -33,12 +33,12 @@ redundant { # Regression test - Only the first child of the timeout block was executed redundant { timeout 1s { - &b = true - &c = true + b = true + c = true } } -if (!(&b && &c)) { +if (!(b && c)) { test_fail } diff --git a/src/tests/keywords/tolower b/src/tests/keywords/tolower index c7c1eaf13f7..7e47924da5c 100644 --- a/src/tests/keywords/tolower +++ b/src/tests/keywords/tolower @@ -4,23 +4,23 @@ string test_string string dummy_string -&test_string := "AbCdE" -&test_string := %tolower(%{test_string}) +test_string := "AbCdE" +test_string := %tolower(%{test_string}) -if !(&test_string == "abcde") { +if !(test_string == "abcde") { test_fail } -&test_string := %tolower(AAbbCCdd) -if !(&test_string == "aabbccdd") { +test_string := %tolower(AAbbCCdd) +if !(test_string == "aabbccdd") { test_fail } # # Doesn't exist # -&test_string := "%tolower(%{dummy_string})" -if !(&test_string == "") { +test_string := "%tolower(%{dummy_string})" +if !(test_string == "") { test_fail } diff --git a/src/tests/keywords/toupper b/src/tests/keywords/toupper index 9dd8fa981ee..9a4ba40873d 100644 --- a/src/tests/keywords/toupper +++ b/src/tests/keywords/toupper @@ -4,19 +4,19 @@ string test_string string dummy_string -&test_string := "AbCdE" -&test_string := %toupper(%{test_string}) -if (!(&test_string == "ABCDE")) { +test_string := "AbCdE" +test_string := %toupper(%{test_string}) +if (!(test_string == "ABCDE")) { test_fail } -&test_string := %toupper(AAbbCCdd) -if (!(&test_string == "AABBCCDD")) { +test_string := %toupper(AAbbCCdd) +if (!(test_string == "AABBCCDD")) { test_fail } -&test_string := "%toupper(%{dummy_string})" -if !(&test_string == "") { +test_string := "%toupper(%{dummy_string})" +if !(test_string == "") { test_fail } diff --git a/src/tests/keywords/transaction b/src/tests/keywords/transaction index 222e10b9e0b..6021181faa3 100644 --- a/src/tests/keywords/transaction +++ b/src/tests/keywords/transaction @@ -5,24 +5,24 @@ string foo string bar transaction { - &foo := "hello" + foo := "hello" fail - &bar := "nope" + bar := "nope" } # # This shouldn't have been applied # -if &bar { +if bar { test_fail } # # This should get rolled back, too! # -if &foo { +if foo { test_fail } else { ok # force auth success for the test framework diff --git a/src/tests/keywords/truncation b/src/tests/keywords/truncation index 82912e48007..6dee323f0dd 100644 --- a/src/tests/keywords/truncation +++ b/src/tests/keywords/truncation @@ -4,7 +4,7 @@ octets test_octets string result_string -&test_octets := 0x\ +test_octets := 0x\ d8abccb7834711af1de1812be2579febe946f5d7beef6fa5c7074c0cb917e9b91e23e14b016f27610097c16c0e0fad88176e077b24198c770746159\ 05b8810d1c8b774d98889fa5c6027cde5e9c56dd4f7c48298c7713aeca5ba5dcfd506032ad05b1396f50e825b633d5a6af0dce6181b640287e03a65\ 8734df46a86341556f28455b3f377313a5a2ac8c8267b8a5de559b95f9b493a68b9e0278485f9e3914d702b2b7b90ee85ff393461f197386d09b836\ @@ -85,7 +85,7 @@ if !("0x%hex(%{test_octets})" =~ /^0x([0-9a-f]+)$/) { test_fail } -&result_string := "%{1}" +result_string := "%{1}" if (!(%length(%{result_string}) == 8166)) { test_fail diff --git a/src/tests/keywords/try b/src/tests/keywords/try index d4e20c841e5..6d29b000337 100644 --- a/src/tests/keywords/try +++ b/src/tests/keywords/try @@ -5,21 +5,21 @@ string foo string bar try { - &foo := "hello" + foo := "hello" fail - &bar := "nope" + bar := "nope" } catch disallow { test_fail } catch ok reject fail { - if &foo != "hello" { + if foo != "hello" { test_fail } - if &bar { + if bar { test_fail } diff --git a/src/tests/keywords/try-error b/src/tests/keywords/try-error index 58d082a7119..b16607ea1f7 100644 --- a/src/tests/keywords/try-error +++ b/src/tests/keywords/try-error @@ -1,13 +1,13 @@ string foo try { # ERROR - &foo := "foo" + foo := "foo" } # # No "catch" - that's an issue # -if &foo != "foo" { +if foo != "foo" { test_fail } \ No newline at end of file diff --git a/src/tests/keywords/unknown b/src/tests/keywords/unknown index f498fc91940..cfd97ea757b 100644 --- a/src/tests/keywords/unknown +++ b/src/tests/keywords/unknown @@ -1,23 +1,23 @@ # # PRE: wimax # -&Vendor-Specific.FreeRADIUS.Proxied-To := 127.0.0.2 +Vendor-Specific.FreeRADIUS.Proxied-To := 127.0.0.2 # # Check that a known but malformed attr is malformed # -&26.24757.84.9.5.7 := 0xab +26.24757.84.9.5.7 := 0xab -if (!(&26.24757.84.9.5.7 == 0xab)) { +if (!(26.24757.84.9.5.7 == 0xab)) { test_fail } # # Check that an unknown attr is OK # -&26.24757.84.9.5.15 := 0xabcdef +26.24757.84.9.5.15 := 0xabcdef -if (!(&26.24757.84.9.5.15 == 0xabcdef)) { +if (!(26.24757.84.9.5.15 == 0xabcdef)) { test_fail } @@ -25,35 +25,35 @@ if (!(&26.24757.84.9.5.15 == 0xabcdef)) { # Check that unknown attributes which are defined # get automatically resolved to the real attribute. # -if (&26.11344.1 == 127.0.0.1) { +if (26.11344.1 == 127.0.0.1) { test_fail } -if (!(&26.11344.1 == 127.0.0.2)) { +if (!(26.11344.1 == 127.0.0.2)) { test_fail } -&26.11344.1 := 0x7f000001 +26.11344.1 := 0x7f000001 -if (&Vendor-Specific.FreeRADIUS.Proxied-To == 127.0.0.2) { +if (Vendor-Specific.FreeRADIUS.Proxied-To == 127.0.0.2) { test_fail } -if (!(&Vendor-Specific.FreeRADIUS.Proxied-To == 127.0.0.1)) { +if (!(Vendor-Specific.FreeRADIUS.Proxied-To == 127.0.0.1)) { test_fail } -if (&26.11344.1 == 127.0.0.2) { +if (26.11344.1 == 127.0.0.2) { test_fail } -if (!(&26.11344.1 == 127.0.0.1)) { +if (!(26.11344.1 == 127.0.0.1)) { test_fail } -&26.66.1 = 0x01020304 +26.66.1 = 0x01020304 -if (!(&26.66.1 == 0x01020304)) { +if (!(26.66.1 == 0x01020304)) { test_fail } diff --git a/src/tests/keywords/unknown-if b/src/tests/keywords/unknown-if index 87f9781e375..c137c3d840d 100644 --- a/src/tests/keywords/unknown-if +++ b/src/tests/keywords/unknown-if @@ -1,6 +1,6 @@ # # PRE: unknown-update # -if (&This-Does-Not-Exist == 1) { # ERROR +if (This-Does-Not-Exist == 1) { # ERROR test_fail } diff --git a/src/tests/keywords/unknown-name b/src/tests/keywords/unknown-name index 615fe92e5c2..db581132878 100644 --- a/src/tests/keywords/unknown-name +++ b/src/tests/keywords/unknown-name @@ -5,6 +5,6 @@ # # This delayed binding should result in a parse error # -if (&User-Name == &Foo-Bar-Baz) { # ERROR +if (User-Name == Foo-Bar-Baz) { # ERROR test_fail } diff --git a/src/tests/keywords/unpack b/src/tests/keywords/unpack index da061da57d7..07c23dbf379 100644 --- a/src/tests/keywords/unpack +++ b/src/tests/keywords/unpack @@ -7,126 +7,126 @@ ipaddr result_ipaddr uint32 result_integer string result_string -&Framed-IP-Address := 127.0.0.1 -&test_octets := &Framed-IP-Address +Framed-IP-Address := 127.0.0.1 +test_octets := Framed-IP-Address -&test_string := %unpack(%{test_octets}, 0, 'ipaddr') -&result_ipaddr := %unpack(%{test_octets}, 0, 'ipaddr') +test_string := %unpack(%{test_octets}, 0, 'ipaddr') +result_ipaddr := %unpack(%{test_octets}, 0, 'ipaddr') -if !(&test_string == '127.0.0.1') { +if !(test_string == '127.0.0.1') { test_fail } -if !(&result_ipaddr == 127.0.0.1) { +if !(result_ipaddr == 127.0.0.1) { test_fail } -&test_octets := 0x000001020304 -&result_integer := %unpack(%{test_octets}, 4, 'uint16') +test_octets := 0x000001020304 +result_integer := %unpack(%{test_octets}, 4, 'uint16') # Octets 4 and 5 == 0x0304 == 772 -if ~(&result_integer == 772) { +if ~(result_integer == 772) { test_fail } # truncation -&test_string := '0x0011223344556677' -&result_string := %unpack(%{test_string}, 0, 'ether') -if !(&result_string == '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 } -&test_string := "0x48656C6C6F" -&result_string := %unpack(%{test_string}, 0, 'string') -if !(&result_string == 'Hello') { +test_string := "0x48656C6C6F" +result_string := %unpack(%{test_string}, 0, 'string') +if !(result_string == 'Hello') { test_fail } # Offset beyond data length -&result_string := %unpack(%{test_string}, 10, 'string') +result_string := %unpack(%{test_string}, 10, 'string') -if (&result_string) { +if (result_string) { test_fail } -if (!(&Module-Failure-Message == 'unpack offset 10 is larger than input data length 5')) { +if (!(Module-Failure-Message == 'unpack offset 10 is larger than input data length 5')) { test_fail } -&request -= &Module-Failure-Message[*] +request -= Module-Failure-Message[*] # Invalid destination data type -&result_string := %unpack(%{test_string}, 0, 'thing') -if (&result_string) { +result_string := %unpack(%{test_string}, 0, 'thing') +if (result_string) { test_fail } -if (!(&Module-Failure-Message == "Invalid data type 'thing'")) { +if (!(Module-Failure-Message == "Invalid data type 'thing'")) { test_fail } # Invalid source data type -&result_string := %unpack(%{result_integer}, 0, 'string') -if (&result_string) { +result_string := %unpack(%{result_integer}, 0, 'string') +if (result_string) { test_fail } -if (!(&Module-Failure-Message == "unpack requires the input attribute to be 'string' or 'octets'")) { +if (!(Module-Failure-Message == "unpack requires the input attribute to be 'string' or 'octets'")) { test_fail } -&request -= &Module-Failure-Message[*] +request -= Module-Failure-Message[*] # Invalid hex string -&test_string := '0x014sdgw' -&result_string := %unpack(%{test_string}, 0, 'string') +test_string := '0x014sdgw' +result_string := %unpack(%{test_string}, 0, 'string') -if (&result_string) { +if (result_string) { test_fail } -if (!(&Module-Failure-Message == "Invalid hex string in '0x014sdgw'")) { +if (!(Module-Failure-Message == "Invalid hex string in '0x014sdgw'")) { test_fail } -&request -= &Module-Failure-Message[*] +request -= Module-Failure-Message[*] # Zero length hex string -&test_string := '0x' -&result_string := %unpack(%{test_string}, 0, 'string') +test_string := '0x' +result_string := %unpack(%{test_string}, 0, 'string') -if (&result_string) { +if (result_string) { test_fail } -if (!(&Module-Failure-Message == "Zero length hex string in '0x'")) { +if (!(Module-Failure-Message == "Zero length hex string in '0x'")) { test_fail } # Tests of extracting multiple values -&test_octets := 0x0011223344556677 -&NAS-Port := %unpack(%{test_octets}, 0, 'uint8', '*') +test_octets := 0x0011223344556677 +NAS-Port := %unpack(%{test_octets}, 0, 'uint8', '*') -if (&NAS-Port[#] != 8) { +if (NAS-Port[#] != 8) { test_fail } -if !((&NAS-Port[0] == 0) && (&NAS-Port[1] == 17) && (&NAS-Port[2] == 34) && (&NAS-Port[3] == 51) && (&NAS-Port[4] == 68) && (&NAS-Port[5] == 85) && (&NAS-Port[6] == 102) && (&NAS-Port[7] == 119)) { +if !((NAS-Port[0] == 0) && (NAS-Port[1] == 17) && (NAS-Port[2] == 34) && (NAS-Port[3] == 51) && (NAS-Port[4] == 68) && (NAS-Port[5] == 85) && (NAS-Port[6] == 102) && (NAS-Port[7] == 119)) { test_fail } -&NAS-Port := %unpack(%{test_octets}, 0, 'uint8', 2) +NAS-Port := %unpack(%{test_octets}, 0, 'uint8', 2) -if (&NAS-Port[#] != 2) { +if (NAS-Port[#] != 2) { test_fail } -&NAS-Port := %unpack(%{test_octets}, 0, 'uint8', 10) +NAS-Port := %unpack(%{test_octets}, 0, 'uint8', 10) -if (&NAS-Port[#] != 8) { +if (NAS-Port[#] != 8) { test_fail } -&NAS-Port := %unpack(%{test_octets}, 0, 'uint8', 'invalid') +NAS-Port := %unpack(%{test_octets}, 0, 'uint8', 'invalid') -if (&NAS-Port) { +if (NAS-Port) { test_fail } diff --git a/src/tests/keywords/update b/src/tests/keywords/update index ed7cbeb2bb2..349bb214a98 100644 --- a/src/tests/keywords/update +++ b/src/tests/keywords/update @@ -1,5 +1,5 @@ update control { - &Password.Cleartext := 'hello' + Password.Cleartext := 'hello' } success diff --git a/src/tests/keywords/update-all b/src/tests/keywords/update-all index 01d21237e6b..4811a4a0552 100644 --- a/src/tests/keywords/update-all +++ b/src/tests/keywords/update-all @@ -4,7 +4,7 @@ # A more generic "update" mechanism # update { - &control.Password.Cleartext := 'hello' + control.Password.Cleartext := 'hello' } success diff --git a/src/tests/keywords/update-array b/src/tests/keywords/update-array index 8f57ff0203d..aca47110726 100644 --- a/src/tests/keywords/update-array +++ b/src/tests/keywords/update-array @@ -3,9 +3,9 @@ # update request { - &Class := 0x01020304 - &Class += 0x05060708 - &Class += 0x090a0b0c + Class := 0x01020304 + Class += 0x05060708 + Class += 0x090a0b0c } @@ -15,30 +15,30 @@ update request { # update request { - &Proxy-State += &Class[0] - &Proxy-State += &Class[1] - &Proxy-State += &Class[2] + Proxy-State += Class[0] + Proxy-State += Class[1] + Proxy-State += Class[2] } -if (!(&Proxy-State == 0x01020304)) { +if (!(Proxy-State == 0x01020304)) { test_fail } # Must be the same as above -if (!(&Proxy-State[0] == 0x01020304)) { +if (!(Proxy-State[0] == 0x01020304)) { test_fail } -if (!(&Proxy-State[1] == 0x05060708)) { +if (!(Proxy-State[1] == 0x05060708)) { test_fail } -if (!(&Proxy-State[2] == 0x090a0b0c)) { +if (!(Proxy-State[2] == 0x090a0b0c)) { test_fail } # must not exist -if (&Proxy-State[3]) { +if (Proxy-State[3]) { test_fail } diff --git a/src/tests/keywords/update-delete b/src/tests/keywords/update-delete index 9b43a096d63..fec4c5a42d8 100644 --- a/src/tests/keywords/update-delete +++ b/src/tests/keywords/update-delete @@ -3,30 +3,30 @@ # update request { - &Filter-Id := 'foobarbaz' - &NAS-Port := 123456789 - &Framed-IP-Address := 192.0.2.1 + Filter-Id := 'foobarbaz' + NAS-Port := 123456789 + Framed-IP-Address := 192.0.2.1 } -if (!((&Filter-Id == 'foobarbaz')) || (!(&NAS-Port == 123456789)) || (!(&Framed-IP-Address == 192.0.2.1))) { +if (!((Filter-Id == 'foobarbaz')) || (!(NAS-Port == 123456789)) || (!(Framed-IP-Address == 192.0.2.1))) { test_fail } # Remove all attributes in the control list update { - &request !* ANY + request !* ANY } # All attributes should now of been removed -if ((&Filter-Id && (&Filter-Id == 'foobarbaz')) || \ - (&NAS-Port && (&NAS-Port == 123456789)) || \ - (&Framed-IP-Address && (&Framed-IP-Address == 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 } # This will of been removed too update request { - &User-Password := 'hello' + User-Password := 'hello' } success diff --git a/src/tests/keywords/update-filter b/src/tests/keywords/update-filter index a7a67a80d93..2f264e58efe 100644 --- a/src/tests/keywords/update-filter +++ b/src/tests/keywords/update-filter @@ -2,17 +2,17 @@ # PRE: update # update control { - &NAS-Port := 5 - &NAS-Port += 10 - &NAS-Port += 15 - &NAS-Port += 20 - &Filter-Id := 'foo' - &Filter-Id += 'baz' - &Filter-Id += '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 -&request := &control +request := control # # @fixme - EDIT - all kinds of other things are broken, and no time currently to debug them. @@ -22,10 +22,10 @@ update control { # Integer == # update request { - &NAS-Port == 10 + NAS-Port == 10 } -if (!(&NAS-Port[0] == 10)) { +if (!(NAS-Port[0] == 10)) { test_fail } @@ -38,16 +38,16 @@ if (!(%{Filter-Id[#]} == 3)) { } # Reset the request list -&request := &control +request := control # # String == # update request { - &Filter-Id == 'baz' + Filter-Id == 'baz' } -if (!(&Filter-Id[0] == 'baz')) { +if (!(Filter-Id[0] == 'baz')) { test_fail } @@ -56,16 +56,16 @@ if (!(%{Filter-Id[#]} == 1)) { } # Reset the request list -&request := &control +request := control # # Integer < # update request { - &NAS-Port < 10 + NAS-Port < 10 } -if (!(&NAS-Port[0] == 5)) { +if (!(NAS-Port[0] == 5)) { test_fail } @@ -78,20 +78,20 @@ if (!(%{Filter-Id[#]} == 3)) { } # Reset the request list -&request := &control +request := control # # Integer > # update request { - &NAS-Port > 10 + NAS-Port > 10 } -if (!(&NAS-Port[0] == 15)) { +if (!(NAS-Port[0] == 15)) { test_fail } -if (!(&NAS-Port[1] == 20)) { +if (!(NAS-Port[1] == 20)) { test_fail } @@ -105,21 +105,21 @@ if (!(%{Filter-Id[#]} == 3)) { } # Reset the request list -&request := &control +request := control # # Integer <= # update request { - &NAS-Port <= 10 + NAS-Port <= 10 } -if (!(&NAS-Port[0] == 5)) { +if (!(NAS-Port[0] == 5)) { test_fail } -if (!(&NAS-Port[1] == 10)) { +if (!(NAS-Port[1] == 10)) { test_fail } @@ -132,24 +132,24 @@ if (!(%{Filter-Id[#]} == 3)) { } # Reset the request list -&request := &control +request := control # # Integer >= # update request { - &NAS-Port >= 10 + NAS-Port >= 10 } -if (!(&NAS-Port[0] == 10)) { +if (!(NAS-Port[0] == 10)) { test_fail } -if (!(&NAS-Port[1] == 15)) { +if (!(NAS-Port[1] == 15)) { test_fail } -if (!(&NAS-Port[2] == 20)) { +if (!(NAS-Port[2] == 20)) { test_fail } @@ -162,24 +162,24 @@ if (!(%{Filter-Id[#]} == 3)) { } # Reset the request list -&request := &control +request := control # # Integer != # update request { - &NAS-Port != 10 + NAS-Port != 10 } -if (!(&NAS-Port[0] == 5)) { +if (!(NAS-Port[0] == 5)) { test_fail } -if (!(&NAS-Port[1] == 15)) { +if (!(NAS-Port[1] == 15)) { test_fail } -if (!(&NAS-Port[2] == 20)) { +if (!(NAS-Port[2] == 20)) { test_fail } @@ -192,21 +192,21 @@ if (!(%{Filter-Id[#]} == 3)) { } # Reset the request list -&request := &control +request := control update request { - &Callback-Id := 'baz' - &Callback-Id += 'boink' + Callback-Id := 'baz' + Callback-Id += 'boink' } # # String (Intersection) # update request { - &Filter-Id == &Callback-Id[0] + Filter-Id == Callback-Id[0] } -if (!(&Filter-Id[0] == &Callback-Id[0])) { +if (!(Filter-Id[0] == Callback-Id[0])) { test_fail } @@ -215,7 +215,7 @@ if (!(%{Filter-Id[#]} == 1)) { } update control { - &Auth-Type := ::Accept + Auth-Type := ::Accept } success diff --git a/src/tests/keywords/update-group b/src/tests/keywords/update-group index fd9ae0ba3f5..c54369d6b59 100644 --- a/src/tests/keywords/update-group +++ b/src/tests/keywords/update-group @@ -7,12 +7,12 @@ update reply { # # This was parsed in the old edit code, but never did anything! # - &Tmp-Group-0 := { # ERROR + Tmp-Group-0 := { # ERROR Filter-Id = "foo" } } -if !&reply.Tmp-Group-0.Filter-Id { +if !reply.Tmp-Group-0.Filter-Id { test_fail } diff --git a/src/tests/keywords/update-group-error b/src/tests/keywords/update-group-error index 148ddcd19a2..7f5464743e1 100644 --- a/src/tests/keywords/update-group-error +++ b/src/tests/keywords/update-group-error @@ -6,7 +6,7 @@ update reply { # # This is a string, so it's NOT allowed. # - &Filter-Id := { # ERROR + Filter-Id := { # ERROR Reply-Message := "1.0" } } diff --git a/src/tests/keywords/update-hex b/src/tests/keywords/update-hex index bf22e41b43f..137c3d70495 100644 --- a/src/tests/keywords/update-hex +++ b/src/tests/keywords/update-hex @@ -5,18 +5,18 @@ # update { - &Filter-Id := 0x626f62 + Filter-Id := 0x626f62 } -if (!(&Filter-Id == 'bob')) { +if (!(Filter-Id == 'bob')) { test_fail } update { - &Filter-Id := '0x626f62' + Filter-Id := '0x626f62' } -if (!(&Filter-Id == '0x626f62')) { +if (!(Filter-Id == '0x626f62')) { test_fail } diff --git a/src/tests/keywords/update-index b/src/tests/keywords/update-index index 1340ede4ec3..60a1b02858d 100644 --- a/src/tests/keywords/update-index +++ b/src/tests/keywords/update-index @@ -2,30 +2,30 @@ # PRE: update # update { - &control.Reply-Message += 'a' - &control.Reply-Message += 'b' - &control.Reply-Message += 'c' + control.Reply-Message += 'a' + control.Reply-Message += 'b' + control.Reply-Message += 'c' } -if (!((&control.Reply-Message[0] == 'a')) || (!(&control.Reply-Message[1] == 'b')) || (!(&control.Reply-Message[2] == 'c'))) { +if (!((control.Reply-Message[0] == 'a')) || (!(control.Reply-Message[1] == 'b')) || (!(control.Reply-Message[2] == 'c'))) { test_fail } # Overwrite a specific index, and check the value here is replaced update { - &control.Reply-Message[1] := 'd' + control.Reply-Message[1] := 'd' } -if (!((&control.Reply-Message[0] == 'a')) || (!(&control.Reply-Message[1] == 'd')) || (!(&control.Reply-Message[2] == 'c'))) { +if (!((control.Reply-Message[0] == 'a')) || (!(control.Reply-Message[1] == 'd')) || (!(control.Reply-Message[2] == 'c'))) { test_fail } # Check isolation... update { - &control.Reply-Message[0] := &control.Reply-Message[0] + control.Reply-Message[0] := control.Reply-Message[0] } -if (!((&control.Reply-Message[0] == 'a')) || (!(&control.Reply-Message[1] == 'd')) || (!(&control.Reply-Message[2] == 'c'))) { +if (!((control.Reply-Message[0] == 'a')) || (!(control.Reply-Message[1] == 'd')) || (!(control.Reply-Message[2] == 'c'))) { test_fail } diff --git a/src/tests/keywords/update-list-error b/src/tests/keywords/update-list-error index 601e28d8fe1..ffdfc474c44 100644 --- a/src/tests/keywords/update-list-error +++ b/src/tests/keywords/update-list-error @@ -4,14 +4,14 @@ # It's an error to update lists that don't exist. # update { - &request := &reply - &control += &request - &reply !* ANY + request := reply + control += request + reply !* ANY } update { - &request := nope # ERROR + request := nope # ERROR } -&request += { &User-Password = 'hello' } +request += { User-Password = 'hello' } success diff --git a/src/tests/keywords/update-list-null-rhs b/src/tests/keywords/update-list-null-rhs index 1e835da8e4b..5550ea631bd 100644 --- a/src/tests/keywords/update-list-null-rhs +++ b/src/tests/keywords/update-list-null-rhs @@ -4,26 +4,26 @@ # Form attribute references with xlats # update request { - &Filter-Id += 'foo' - &Filter-Id += 'bar' - &Reply-Message += 'baz' + Filter-Id += 'foo' + Filter-Id += 'bar' + Reply-Message += 'baz' # # @fixme - EDIT - how the heck did this ever work? # - &control !* ANY + control !* ANY } -if (!(&Filter-Id[0] == 'foo')) { +if (!(Filter-Id[0] == 'foo')) { test_fail } # Now delete the LHS by assigning the control list to it (which is empty) update { - &request := &control + request := control } -if (&Filter-Id || &Reply-Message) { +if (Filter-Id || Reply-Message) { test_fail } diff --git a/src/tests/keywords/update-null-value-assign b/src/tests/keywords/update-null-value-assign index e99a3ad8f02..3ac861ad192 100644 --- a/src/tests/keywords/update-null-value-assign +++ b/src/tests/keywords/update-null-value-assign @@ -7,9 +7,9 @@ # State doesn't exist, so Class shouldn't be created # update request { - &Class := &State + Class := State } -if (&Class) { +if (Class) { test_fail } @@ -18,12 +18,12 @@ if (&Class) { # # update request { - &Filter-Id := "%{Reply-Message}" + Filter-Id := "%{Reply-Message}" } -if (!&Filter-Id) { +if (!Filter-Id) { test_fail } -if (!(&Filter-Id == '')) { +if (!(Filter-Id == '')) { test_fail } @@ -33,9 +33,9 @@ if (!(&Filter-Id == '')) { # @fixme - EDIT - the new method is to simply omit the assignment # update request { - &Class := "%{Reply-Message}" + Class := "%{Reply-Message}" } -if (!(&Class == "")) { +if (!(Class == "")) { test_fail } diff --git a/src/tests/keywords/update-prepend b/src/tests/keywords/update-prepend index e431a580fc5..58d10ad06da 100644 --- a/src/tests/keywords/update-prepend +++ b/src/tests/keywords/update-prepend @@ -4,31 +4,31 @@ # Define initial test strings update control { - &Filter-Id := 'foo' - &Filter-Id += '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 -# &Filter-Id += &control.Filter-Id 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 { - &Filter-Id !* ANY - &Filter-Id += &control.Filter-Id[0] - &Filter-Id += &control.Filter-Id[1] + Filter-Id !* ANY + Filter-Id += control.Filter-Id[0] + Filter-Id += control.Filter-Id[1] } # Prepend a single value update request { - &Filter-Id ^= 'boink' + Filter-Id ^= 'boink' } # The prepended value should be first followed by the other two -if (!((&Filter-Id[0] == 'boink')) || (!(&Filter-Id[1] == 'foo')) || (!(%{Filter-Id[2]} == 'baz'))) { +if (!((Filter-Id[0] == 'boink')) || (!(Filter-Id[1] == 'foo')) || (!(%{Filter-Id[2]} == 'baz'))) { test_fail } @@ -38,16 +38,16 @@ if (!(%{Filter-Id[#]} == 3)) { # Add an extra element to the start of control update control { - &Filter-Id ^= 'wibble' + Filter-Id ^= 'wibble' } # Prepend control to request update { - &request ^= &control + request ^= control } # The attributes should now be "wibble", "foo", "baz", "boink", "foo", "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'))) { +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 } @@ -57,21 +57,21 @@ if (!(%{Filter-Id[#]} == 6)) { # Set up an attribute in control with a single value update control { - &Filter-Id := 'initial' + Filter-Id := 'initial' } # Prepend the list of Filter-Id from request to the new attribute #update { -# &control.Filter-Id ^= &Filter-Id +# control.Filter-Id ^= Filter-Id #} # (Temporary method to achieve the same - as per issue noted above) update { - &control ^= &request + control ^= request } # The control attributes should now be "wibble", "foo", "baz", "boink", "foo", "baz", "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'))) { +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 } diff --git a/src/tests/keywords/update-remove-any b/src/tests/keywords/update-remove-any index c6d4bdc1f6f..da7e4420c4b 100644 --- a/src/tests/keywords/update-remove-any +++ b/src/tests/keywords/update-remove-any @@ -2,45 +2,45 @@ # PRE: update # update { - &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 + 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 (!((&Framed-IP-Address[0] == 192.0.2.1)) || (!(&Framed-IP-Address[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 { - &Framed-IP-Address !* ANY + Framed-IP-Address !* ANY } # Non Framed-IP-Address address attributes should still be in the request list -if (!((&Filter-Id == 'foobarbaz')) || (!(&NAS-Port == 123456789))) { +if (!((Filter-Id == 'foobarbaz')) || (!(NAS-Port == 123456789))) { test_fail } # There should be no Framed-IP-Address attributes in the request list -if (&Framed-IP-Address) { +if (Framed-IP-Address) { test_fail } # But there should still be some in the control list -if (!((&control.Framed-IP-Address == 192.0.2.1)) || (!(&control.Framed-IP-Address[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.Framed-IP-Address !* ANY - &control.Login-IP-Host !* ANY + control.Framed-IP-Address !* ANY + control.Login-IP-Host !* ANY } -if (&control.Framed-IP-Address || &control.Login-IP-Host) { +if (control.Framed-IP-Address || control.Login-IP-Host) { test_fail } diff --git a/src/tests/keywords/update-remove-list b/src/tests/keywords/update-remove-list index 9b43a096d63..fec4c5a42d8 100644 --- a/src/tests/keywords/update-remove-list +++ b/src/tests/keywords/update-remove-list @@ -3,30 +3,30 @@ # update request { - &Filter-Id := 'foobarbaz' - &NAS-Port := 123456789 - &Framed-IP-Address := 192.0.2.1 + Filter-Id := 'foobarbaz' + NAS-Port := 123456789 + Framed-IP-Address := 192.0.2.1 } -if (!((&Filter-Id == 'foobarbaz')) || (!(&NAS-Port == 123456789)) || (!(&Framed-IP-Address == 192.0.2.1))) { +if (!((Filter-Id == 'foobarbaz')) || (!(NAS-Port == 123456789)) || (!(Framed-IP-Address == 192.0.2.1))) { test_fail } # Remove all attributes in the control list update { - &request !* ANY + request !* ANY } # All attributes should now of been removed -if ((&Filter-Id && (&Filter-Id == 'foobarbaz')) || \ - (&NAS-Port && (&NAS-Port == 123456789)) || \ - (&Framed-IP-Address && (&Framed-IP-Address == 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 } # This will of been removed too update request { - &User-Password := 'hello' + User-Password := 'hello' } success diff --git a/src/tests/keywords/update-remove-value b/src/tests/keywords/update-remove-value index 3b5e83452e6..7fd1f2a3d78 100644 --- a/src/tests/keywords/update-remove-value +++ b/src/tests/keywords/update-remove-value @@ -3,94 +3,94 @@ # update { - &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 + 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 (!((&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))) { +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 Framed-IP-Address with a specific value update { - &Framed-IP-Address -= 192.0.2.1 + Framed-IP-Address -= 192.0.2.1 } # 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])) { +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 Framed-IP-Address with a specific value (somewhere in the middle) update { - &Framed-IP-Address -= 192.0.2.3 + Framed-IP-Address -= 192.0.2.3 } # 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])) { +if (!((Framed-IP-Address[0] == 192.0.2.2)) || \ + (!(Framed-IP-Address[1] == 192.0.2.4)) || \ + (Framed-IP-Address[2])) { test_fail } # Remove Framed-IP-Address with a specific value (which doesn't exist) update { - &Framed-IP-Address -= 192.0.2.3 + Framed-IP-Address -= 192.0.2.3 } # 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])) { +if (!((Framed-IP-Address[0] == 192.0.2.2)) || \ + (!(Framed-IP-Address[1] == 192.0.2.4)) || \ + (Framed-IP-Address[2])) { test_fail } # Remove NAS-IP-Address (which doesn't exist - more to check for SEGV/assert) update { - &NAS-IP-Address -= 192.0.2.3 + NAS-IP-Address -= 192.0.2.3 } # Remove Framed-IP-Address with a specific value update { - &Framed-IP-Address -= 192.0.2.4 + Framed-IP-Address -= 192.0.2.4 } # 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])) { +if (!((Framed-IP-Address[0] == 192.0.2.2)) || \ + (Framed-IP-Address[1])) { test_fail } # Remove Framed-IP-Address with a specific value update { - &Framed-IP-Address -= 192.0.2.2 + Framed-IP-Address -= 192.0.2.2 } # 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) { +if (Framed-IP-Address) { test_fail } # Non Framed-IP-Address address attributes should still be in the request list -if (!((&Filter-Id == 'foobarbaz')) || (!(&NAS-Port == 123456789))) { +if (!((Filter-Id == 'foobarbaz')) || (!(NAS-Port == 123456789))) { test_fail } # But there should still be some in the control list -if (!((&control.Framed-IP-Address[0] == 192.0.2.1)) || (!(&control.Framed-IP-Address[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 } diff --git a/src/tests/keywords/update-to-edit b/src/tests/keywords/update-to-edit index 700cf5ddce8..30ac6ed97ce 100644 --- a/src/tests/keywords/update-to-edit +++ b/src/tests/keywords/update-to-edit @@ -1,52 +1,52 @@ -&Filter-Id := "foo" +Filter-Id := "foo" update request { - &Filter-Id !* ANY + Filter-Id !* ANY } -if (&Filter-Id) { +if (Filter-Id) { test_fail } -&Filter-Id := "foo" -&reply.Filter-Id := "bar" +Filter-Id := "foo" +reply.Filter-Id := "bar" update { - &request.Filter-Id !* ANY - &reply.[*] !* ANY + request.Filter-Id !* ANY + reply.[*] !* ANY } -if (&Filter-Id) { +if (Filter-Id) { test_fail } -if (&reply.Filter-Id) { +if (reply.Filter-Id) { test_fail } update reply { - &NAS-Port := 12 + NAS-Port := 12 } -if (!&reply.NAS-Port) { +if (!reply.NAS-Port) { test_fail } update reply { - &NAS-Port += 13 + NAS-Port += 13 } -if (!(&reply.NAS-Port[0] == 12)) { +if (!(reply.NAS-Port[0] == 12)) { test_fail } -if (!(&reply.NAS-Port[1] == 13)) { +if (!(reply.NAS-Port[1] == 13)) { test_fail } # # Clear out reply as we don't care about the attributes in it. # -&reply := {} +reply := {} success diff --git a/src/tests/keywords/urlquote b/src/tests/keywords/urlquote index 584f7d2fe75..b93714bf993 100644 --- a/src/tests/keywords/urlquote +++ b/src/tests/keywords/urlquote @@ -9,46 +9,46 @@ 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_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 } -&result_string := "%urlunquote(%{test_string1})" -if (!(&result_string == &test_string1)) { +result_string := "%urlunquote(%{test_string1})" +if (!(result_string == test_string1)) { test_fail } -&result_string := "%urlquote(%{test_string2})" -if (!(&result_string == &encoded_string2)) { +result_string := "%urlquote(%{test_string2})" +if (!(result_string == encoded_string2)) { test_fail } -&result_string := "%urlquote(%{test_string3})" -if (!(&result_string == &encoded_string3)) { +result_string := "%urlquote(%{test_string3})" +if (!(result_string == encoded_string3)) { test_fail } -&result_string := "%urlunquote(%{encoded_string2})" -if (!(&result_string == &test_string2)) { +result_string := "%urlunquote(%{encoded_string2})" +if (!(result_string == test_string2)) { test_fail } -&result_string := "%urlunquote(%{encoded_string3})" -if (!(&result_string == &test_string3)) { +result_string := "%urlunquote(%{encoded_string3})" +if (!(result_string == test_string3)) { test_fail } -&result_string := "%urlunquote(%%E,123)" +result_string := "%urlunquote(%%E,123)" # Test decoding invalid encoded string -if !(&result_string == "") { +if !(result_string == "") { test_fail } diff --git a/src/tests/keywords/vendor-specific.raw b/src/tests/keywords/vendor-specific.raw index 2b168967fc9..8d89b9f3ac0 100644 --- a/src/tests/keywords/vendor-specific.raw +++ b/src/tests/keywords/vendor-specific.raw @@ -1,11 +1,11 @@ # Tests for Vendor-Specific # -&raw.26 := 0x01020304 +raw.26 := 0x01020304 -if (!&raw.26) { +if (!raw.26) { test_fail } -elsif (!(&raw.26 == 0x01020304)) { +elsif (!(raw.26 == 0x01020304)) { test_fail } else { diff --git a/src/tests/keywords/vsa-alias b/src/tests/keywords/vsa-alias index 23458c9dd23..1d320892f55 100644 --- a/src/tests/keywords/vsa-alias +++ b/src/tests/keywords/vsa-alias @@ -1,9 +1,9 @@ # # Alias from Cisco -> Vendor-Specific.Cisco # -&Cisco.AVPair := "foo" +Cisco.AVPair := "foo" -if !(&Vendor-Specific.Cisco.AVPair == "foo") { +if !(Vendor-Specific.Cisco.AVPair == "foo") { test_fail } diff --git a/src/tests/keywords/wimax b/src/tests/keywords/wimax index edb2c8b46d8..4706ab7f0a6 100644 --- a/src/tests/keywords/wimax +++ b/src/tests/keywords/wimax @@ -1,11 +1,11 @@ -&Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Port := 6809 +Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Port := 6809 -if (!(&Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Port == 6809)) { +if (!(Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Port == 6809)) { test_fail } -&26.24757.84.9.5.7 := 0x01 -if (!(&Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Assigned == 1)) { +26.24757.84.9.5.7 := 0x01 +if (!(Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Assigned == 1)) { test_fail } diff --git a/src/tests/keywords/xlat-alternation b/src/tests/keywords/xlat-alternation index 26f950b14c7..719476823e6 100644 --- a/src/tests/keywords/xlat-alternation +++ b/src/tests/keywords/xlat-alternation @@ -3,60 +3,60 @@ # string result_string -&Filter-Id := "foo" -&NAS-Identifier := "bar" +Filter-Id := "foo" +NAS-Identifier := "bar" # # First choice # -&result_string := "%{&Filter-Id || &NAS-Identifier}" -if (!(&result_string == 'foo')) { +result_string := "%{Filter-Id || NAS-Identifier}" +if (!(result_string == 'foo')) { test_fail } # # Second choice # -&request -= &Filter-Id[*] -&result_string := "%{&Filter-Id || &NAS-Identifier}" -if (!(&result_string == 'bar')) { +request -= Filter-Id[*] +result_string := "%{Filter-Id || NAS-Identifier}" +if (!(result_string == 'bar')) { test_fail } # # Multiple things in an alternation # -&result_string := %{%{Filter-Id} || "%{NAS-Identifier} foo"} -if (!(&result_string == 'bar foo')) { +result_string := %{%{Filter-Id} || "%{NAS-Identifier} foo"} +if (!(result_string == 'bar foo')) { test_fail } # # Alternation is empty # -&result_string := "%{&Filter-Id || ''}" -if (!(&result_string == '')) { +result_string := "%{Filter-Id || ''}" +if (!(result_string == '')) { test_fail } # # Everything null # -&request -= &NAS-Identifier[*] +request -= NAS-Identifier[*] # # Both sides are failing, so the assignment returns a NULL string # -&result_string := "%{&Filter-Id || &NAS-Identifier}" -if (!(&result_string == "")) { +result_string := "%{Filter-Id || NAS-Identifier}" +if (!(result_string == "")) { test_fail } # # And unquoted results return nothing. # -&result_string := %{&Filter-Id || &NAS-Identifier} -if (&result_string) { +result_string := %{Filter-Id || NAS-Identifier} +if (result_string) { test_fail } diff --git a/src/tests/keywords/xlat-alternation-fail-then-func b/src/tests/keywords/xlat-alternation-fail-then-func index c1697b0c2fd..c7e3962a0ea 100644 --- a/src/tests/keywords/xlat-alternation-fail-then-func +++ b/src/tests/keywords/xlat-alternation-fail-then-func @@ -2,9 +2,9 @@ # Everything null # string result_string -&request -= &Filter-Id[*] -&request -= &NAS-Identifier[*] +request -= Filter-Id[*] +request -= NAS-Identifier[*] -&result_string := "%{&Filter-Id[0] || &NAS-Identifier[0]}%delay_10s()" +result_string := "%{Filter-Id[0] || NAS-Identifier[0]}%delay_10s()" success diff --git a/src/tests/keywords/xlat-alternation-with-func b/src/tests/keywords/xlat-alternation-with-func index db717b805c4..cbf6a1c4f66 100644 --- a/src/tests/keywords/xlat-alternation-with-func +++ b/src/tests/keywords/xlat-alternation-with-func @@ -5,8 +5,8 @@ string test_string1 string test_string2 string dummy_string -&test_string1 := "foo" -&test_string2 := "bar" +test_string1 := "foo" +test_string2 := "bar" if (!(%{%test.passthrough(%{test_string1}) || %{test_string2}} == 'foo')) { test_fail diff --git a/src/tests/keywords/xlat-attr-index b/src/tests/keywords/xlat-attr-index index b403ec3d31b..f78cbbcab0c 100644 --- a/src/tests/keywords/xlat-attr-index +++ b/src/tests/keywords/xlat-attr-index @@ -1,12 +1,12 @@ -&request += { - &Framed-IP-Address = 192.0.2.1 - &Framed-IP-Address = 192.0.2.2 +request += { + Framed-IP-Address = 192.0.2.1 + Framed-IP-Address = 192.0.2.2 } if (!(%{Framed-IP-Address[#]} == 2)) { test_fail } -if (!((&Framed-IP-Address[0] == 192.0.2.1)) || (!(&Framed-IP-Address[1] == 192.0.2.2))) { +if (!((Framed-IP-Address[0] == 192.0.2.1)) || (!(Framed-IP-Address[1] == 192.0.2.2))) { test_fail } @@ -16,18 +16,18 @@ if (!("%{Framed-IP-Address[*]}" == '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 += { - &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[#]} +request += { + 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 (!(&Filter-Id == '192.0.2.1,192.0.2.2')) { +if (!(Filter-Id == '192.0.2.1,192.0.2.2')) { test_fail } -if (!(&NAS-Port == 2)) { +if (!(NAS-Port == 2)) { test_fail } diff --git a/src/tests/keywords/xlat-cond-missing b/src/tests/keywords/xlat-cond-missing index 20bc6483423..80204b0fc07 100644 --- a/src/tests/keywords/xlat-cond-missing +++ b/src/tests/keywords/xlat-cond-missing @@ -1,8 +1,8 @@ -&request += { - &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 +request += { + 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 (%{Framed-IP-Address[#]} != 4) { diff --git a/src/tests/keywords/xlat-config b/src/tests/keywords/xlat-config index c40a4bbf401..f6d891fad6c 100644 --- a/src/tests/keywords/xlat-config +++ b/src/tests/keywords/xlat-config @@ -4,14 +4,14 @@ string result_string uint32 result_integer -&result_string := "%config(modules.static.test.boolean)" -if (!(&result_string == "no")) { +result_string := "%config(modules.static.test.boolean)" +if (!(result_string == "no")) { test_fail } -&result_string := "test" -&result_integer := %config(modules.static.%{result_string}.integer) -if (!(&result_integer == 1)) { +result_string := "test" +result_integer := %config(modules.static.%{result_string}.integer) +if (!(result_integer == 1)) { test_fail } diff --git a/src/tests/keywords/xlat-delay b/src/tests/keywords/xlat-delay index 1bb59d9e798..5afad94480e 100644 --- a/src/tests/keywords/xlat-delay +++ b/src/tests/keywords/xlat-delay @@ -7,15 +7,15 @@ float32 result_float %delay_10s() # Should 'blip' the request -&result_float := %delay_10s(0.1) -if (!&result_float) { +result_float := %delay_10s(0.1) +if (!result_float) { fail } # # Check the delay was ~100ms # -if (&result_float < 0.1) { +if (result_float < 0.1) { fail } diff --git a/src/tests/keywords/xlat-dhcpv4 b/src/tests/keywords/xlat-dhcpv4 index b9565618e96..69a21a60e10 100644 --- a/src/tests/keywords/xlat-dhcpv4 +++ b/src/tests/keywords/xlat-dhcpv4 @@ -3,27 +3,27 @@ # octets test_octets -&test_octets := 0x520d0103abcdef0206010203040506 +test_octets := 0x520d0103abcdef0206010203040506 # the protocol decoder puts the attributes into a flat namespace if (!(%dhcpv4.decode(%{test_octets}) == 1)) { test_fail } -if !(&Relay-Agent-Information.Circuit-Id == 0xabcdef) { +if !(Relay-Agent-Information.Circuit-Id == 0xabcdef) { test_fail } -if !(&Relay-Agent-Information.Remote-Id == 0x010203040506) { +if !(Relay-Agent-Information.Remote-Id == 0x010203040506) { test_fail } # # Encode all of the Relay-Agent-Information suboptions # -&test_octets := %dhcpv4.encode(&request.Relay-Agent-Information.[*]) +test_octets := %dhcpv4.encode(request.Relay-Agent-Information.[*]) -if !(&test_octets == 0x520d0103abcdef0206010203040506) { +if !(test_octets == 0x520d0103abcdef0206010203040506) { test_fail } diff --git a/src/tests/keywords/xlat-double-alternation b/src/tests/keywords/xlat-double-alternation index 7138d646b77..517712c43b2 100644 --- a/src/tests/keywords/xlat-double-alternation +++ b/src/tests/keywords/xlat-double-alternation @@ -1,8 +1,8 @@ # Regression test for double consecutive alternations uint64 result_int64 -&result_int64 := "%{&Acct-Input-Octets || "2"}%{&Acct-Input-Gigawords || "1"}" -if (!(&result_int64 == 21)) { +result_int64 := "%{Acct-Input-Octets || "2"}%{Acct-Input-Gigawords || "1"}" +if (!(result_int64 == 21)) { test_fail } diff --git a/src/tests/keywords/xlat-eval b/src/tests/keywords/xlat-eval index e48806969c6..eda0fed3773 100644 --- a/src/tests/keywords/xlat-eval +++ b/src/tests/keywords/xlat-eval @@ -1,11 +1,11 @@ -&request += { - &Filter-Id = 'foo' - &Filter-Id = 'bar' - &NAS-Port = '4' - &NAS-Port = '8' - &NAS-Port = '1' - - &Reply-Message = '%{Filter-Id}' +request += { + Filter-Id = 'foo' + Filter-Id = 'bar' + NAS-Port = '4' + NAS-Port = '8' + NAS-Port = '1' + + Reply-Message = '%{Filter-Id}' } # @@ -47,13 +47,13 @@ group { uint32 idx string stackstr - &idx := 1 + idx := 1 if (!(%eval("\%{Filter-Id[%{idx}]}") == 'bar')) { test_fail } - &stackstr := 'foo' + stackstr := 'foo' if (!(%eval("\%{stackstr}") == 'foo')) { test_fail diff --git a/src/tests/keywords/xlat-exec b/src/tests/keywords/xlat-exec index 41292107b9e..c1d76ccb86a 100644 --- a/src/tests/keywords/xlat-exec +++ b/src/tests/keywords/xlat-exec @@ -1,24 +1,24 @@ string test_string string result_string -&test_string = "foo" -&result_string := %exec('/bin/echo', "hello 1234:%{test_string} world") +test_string = "foo" +result_string := %exec('/bin/echo', "hello 1234:%{test_string} world") -if (!(&result_string == "hello 1234:foo world")) { +if (!(result_string == "hello 1234:foo world")) { test_fail } -&result_string := %exec('/bin/echo', "hello %{test_string}:1234 world") -if (!(&result_string == "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 -&result_string := %exec('/bin/echo', "%{User-Password}") -if (!(&result_string == &User-Password)) { +result_string := %exec('/bin/echo', "%{User-Password}") +if (!(result_string == User-Password)) { test_fail } else { - &User-Password := "hello" + User-Password := "hello" } success diff --git a/src/tests/keywords/xlat-explode b/src/tests/keywords/xlat-explode index 7b8d775180a..1581e82910e 100644 --- a/src/tests/keywords/xlat-explode +++ b/src/tests/keywords/xlat-explode @@ -5,40 +5,40 @@ # string result_string -&request += { - &Class = '1=1|my_attr=2|my_attr=hello|' - &Calling-Station-ID = '|' +request += { + Class = '1=1|my_attr=2|my_attr=hello|' + Calling-Station-ID = '|' } -&control += { - &User-Name = '|hello|goodbye' - &User-Name = '|morning|night|1|' - &Reply-Message = 'Can\'t touch this' - &Filter-Id = 'here. are . some. words. ' +control += { + User-Name = '|hello|goodbye' + User-Name = '|morning|night|1|' + Reply-Message = 'Can\'t touch this' + Filter-Id = 'here. are . some. words. ' } -&result_string := "%concat(%explode(%{Class}, '|'), ',')" -if (!(&result_string == "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 } -&result_string := "%concat(%explode(%{Calling-Station-ID}, '|'), ',')" -if (!(&result_string == "")) { +result_string := "%concat(%explode(%{Calling-Station-ID}, '|'), ',')" +if (!(result_string == "")) { test_fail } -&result_string := "%concat(%explode(%{control.User-Name[*]}, |), ',')" -if (!(&result_string == "hello,goodbye,morning,night,1")) { +result_string := "%concat(%explode(%{control.User-Name[*]}, |), ',')" +if (!(result_string == "hello,goodbye,morning,night,1")) { test_fail } -&result_string := "%concat(%explode(%{control.Reply-Message}, |), ',')" -if !(&result_string == 'Can\'t touch this') { +result_string := "%concat(%explode(%{control.Reply-Message}, |), ',')" +if !(result_string == 'Can\'t touch this') { test_fail } -&result_string := "%concat(%explode(%{control.Filter-Id}, '. '), ',')" -if !(&result_string == 'here, are ,some, words') { +result_string := "%concat(%explode(%{control.Filter-Id}, '. '), ',')" +if !(result_string == 'here, are ,some, words') { test_fail } diff --git a/src/tests/keywords/xlat-inline b/src/tests/keywords/xlat-inline index 4194810f601..ef5ea2dbdd3 100644 --- a/src/tests/keywords/xlat-inline +++ b/src/tests/keywords/xlat-inline @@ -1,7 +1,7 @@ # Set debug to something high, recording the old level uint32 test_integer -&test_integer := %debug(4) +test_integer := %debug(4) # Check debug level is now 4 if (!(%debug(4) == 4)) { @@ -17,10 +17,10 @@ if (!(%debug(%{test_integer}) == "%{test_integer}")) { } # Check for 'splosions -"%{&control.Password.Cleartext || &control.User-Name}" -"%{&control.User-Name || &control.Password.Cleartext}" +"%{control.Password.Cleartext || control.User-Name}" +"%{control.User-Name || control.Password.Cleartext}" -if (&control.Password.Cleartext =~ /(h)(e)(l)(l)(o)/) { +if (control.Password.Cleartext =~ /(h)(e)(l)(l)(o)/) { "%{0}" "%{1}" "%{2}" diff --git a/src/tests/keywords/xlat-interpreter b/src/tests/keywords/xlat-interpreter index fa13c7f1067..2cd14105834 100644 --- a/src/tests/keywords/xlat-interpreter +++ b/src/tests/keywords/xlat-interpreter @@ -7,24 +7,24 @@ string result_string uint32 result_integer -&result_string := "%interpreter(.filename)" -&result_integer := "%interpreter(.line)" +result_string := "%interpreter(.filename)" +result_integer := "%interpreter(.line)" -if (!(&result_string == "src/tests/keywords/xlat-interpreter")) { +if (!(result_string == "src/tests/keywords/xlat-interpreter")) { test_fail } -&result_string := "%interpreter(.name)" -if (!(&result_string == "&result_string")) { +result_string := "%interpreter(.name)" +if (!(result_string == "result_string")) { test_fail } -&result_string := "%interpreter(.type)" -if (!(&result_string == "edit")) { +result_string := "%interpreter(.type)" +if (!(result_string == "edit")) { test_fail } -if (!(&result_integer == 11)) { +if (!(result_integer == 11)) { test_fail } diff --git a/src/tests/keywords/xlat-list b/src/tests/keywords/xlat-list index 7426ac65c62..690ca5e84bf 100644 --- a/src/tests/keywords/xlat-list +++ b/src/tests/keywords/xlat-list @@ -1,6 +1,6 @@ -&control := { - &Framed-IP-Address = 192.0.2.1 - &Framed-IP-Address = 192.0.2.2 +control := { + Framed-IP-Address = 192.0.2.1 + Framed-IP-Address = 192.0.2.2 } if !(%{control.[#]} == 2) { @@ -28,18 +28,18 @@ 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 += { - &NAS-IP-Address = %{control.[1]} - &NAS-IP-Address = %{control.[0]} - &Filter-Id = %concat(%{control.[*]}, ',') - &NAS-Port = %{control.[#]} +request += { + NAS-IP-Address = %{control.[1]} + NAS-IP-Address = %{control.[0]} + Filter-Id = %concat(%{control.[*]}, ',') + NAS-Port = %{control.[#]} } -if !(&Filter-Id == '192.0.2.1,192.0.2.2') { +if !(Filter-Id == '192.0.2.1,192.0.2.2') { test_fail } -if !(&NAS-Port == 2) { +if !(NAS-Port == 2) { test_fail } diff --git a/src/tests/keywords/xlat-octets b/src/tests/keywords/xlat-octets index d04621893b8..565f6448a99 100644 --- a/src/tests/keywords/xlat-octets +++ b/src/tests/keywords/xlat-octets @@ -5,16 +5,16 @@ # Regression test for 0x prefix. xlat expanded # octet strings must NOT have a 0x prefix added # -&request += { - &Class = 0x0001020304050607 - &Class = 0x0706050403020100 +request += { + Class = 0x0001020304050607 + Class = 0x0706050403020100 } -if (!(&Class == 0x0001020304050607)) { +if (!(Class == 0x0001020304050607)) { test_fail } -if (!(&Class[0] == 0x0001020304050607)) { +if (!(Class[0] == 0x0001020304050607)) { test_fail } diff --git a/src/tests/keywords/xlat-printable b/src/tests/keywords/xlat-printable index 01522c27fd2..92b591f86a4 100644 --- a/src/tests/keywords/xlat-printable +++ b/src/tests/keywords/xlat-printable @@ -4,8 +4,8 @@ string printable string unprintable -&printable = "🍩abcdef🍩" -&unprintable = "\t🍩\n" +printable = "🍩abcdef🍩" +unprintable = "\t🍩\n" # Relaxed mode allows tabs and spaces if (!%str.printable("\t 🍩", "yes")) { diff --git a/src/tests/keywords/xlat-string b/src/tests/keywords/xlat-string index 6bc5c89864b..4b5939fbed2 100644 --- a/src/tests/keywords/xlat-string +++ b/src/tests/keywords/xlat-string @@ -9,15 +9,15 @@ octets test_octets5 octets test_octets6 string result_string -&test_octets1 := 0x5c5c -&test_octets2 := 0x49206c696b6520636869636b656e2049206c696b65206c69766572 -&test_octets3 := 0x490049 -&test_octets4 = 0x00 -&test_octets5 = 0x7465737431 -&test_octets6 = 0x7465737432 +test_octets1 := 0x5c5c +test_octets2 := 0x49206c696b6520636869636b656e2049206c696b65206c69766572 +test_octets3 := 0x490049 +test_octets4 = 0x00 +test_octets5 = 0x7465737431 +test_octets6 = 0x7465737432 -&result_string := %{(string) %{test_octets1}} -if (!(&result_string == "\\\\")) { +result_string := %{(string) %{test_octets1}} +if (!(result_string == "\\\\")) { test_fail } @@ -45,7 +45,7 @@ if (!(%{(string) (%{test_octets5} + %{test_octets6})} == "test1test2")) { # # We don't need %{(string) ...) either. # -if !("%{(string) &test_octets5}%{(string) &test_octets6}" == "test1test2") { +if !("%{(string) test_octets5}%{(string) test_octets6}" == "test1test2") { test_fail } @@ -57,18 +57,18 @@ if (!("%{(string) %{test_octets5}}%{(string) %{test_octets6}}test3" == "test1tes test_fail } -&result_string := %{(string) %{test_octets2}} -if !(&result_string == 'I like chicken I like liver') { +result_string := %{(string) %{test_octets2}} +if !(result_string == 'I like chicken I like liver') { test_fail } -&result_string := %{(string) %{test_octets3}} -if (!(&result_string == "I\000I")) { +result_string := %{(string) %{test_octets3}} +if (!(result_string == "I\000I")) { test_fail } -&result_string := %{(string) %{test_octets4}} -if (!(&result_string == "\000")) { +result_string := %{(string) %{test_octets4}} +if (!(result_string == "\000")) { test_fail } diff --git a/src/tests/keywords/xlat-subst b/src/tests/keywords/xlat-subst index 582cdf20dbd..3c63d2d058e 100644 --- a/src/tests/keywords/xlat-subst +++ b/src/tests/keywords/xlat-subst @@ -3,10 +3,10 @@ string test_string2 string test_string3 string empty_string -&test_string1 := 'aaa' -&test_string2 := "\n\n\n" -&test_string3 := "the quick brown fox jumped over the lazy dog" -&empty_string := '' +test_string1 := 'aaa' +test_string2 := "\n\n\n" +test_string3 := "the quick brown fox jumped over the lazy dog" +empty_string := '' # # Non-regex base substitutions diff --git a/src/tests/keywords/xlat-unknown b/src/tests/keywords/xlat-unknown index 43a1950dbe3..cfc9af8abb7 100644 --- a/src/tests/keywords/xlat-unknown +++ b/src/tests/keywords/xlat-unknown @@ -2,7 +2,7 @@ # PRE: update escape # update reply { - &Vendor-Specific.WiMAX.Capability.Release = "foo" + Vendor-Specific.WiMAX.Capability.Release = "foo" } # @@ -10,7 +10,7 @@ update reply { # reference here should be to an unknown attribute, # and the dereference should fail. # -if (&reply.Capability.Release == "foo") { # ERROR +if (reply.Capability.Release == "foo") { # ERROR test_fail } else { diff --git a/src/tests/keywords/xlat-utf8 b/src/tests/keywords/xlat-utf8 index 03bab555722..04f8151114d 100644 --- a/src/tests/keywords/xlat-utf8 +++ b/src/tests/keywords/xlat-utf8 @@ -4,8 +4,8 @@ string valid_utf8 string invalid_utf8 -&valid_utf8 = "🍩abcdef🍩\n\t" -&invalid_utf8 = "🍩\x80" +valid_utf8 = "🍩abcdef🍩\n\t" +invalid_utf8 = "🍩\x80" if (%str.utf8("\xFE")) { test_fail