Skip to content

Commit

Permalink
remove '&' from the start of the line
Browse files Browse the repository at this point in the history
earlier commits didn't do that.

 perl -p -i -e 's/^&//' $(git grep -l '^&' src/tests/modules)
  • Loading branch information
alandekok committed Jan 20, 2025
1 parent 74cebc6 commit 793cde1
Show file tree
Hide file tree
Showing 106 changed files with 572 additions and 572 deletions.
2 changes: 1 addition & 1 deletion src/tests/modules/always/set_rcode.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ if (notfound) {
}
}

&control.Password.Cleartext := "hello"
control.Password.Cleartext := "hello"
2 changes: 1 addition & 1 deletion src/tests/modules/always/set_status_dead.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ if (fail) {
reply.Reply-Message := "success"
}

&control.Password.Cleartext := "hello"
control.Password.Cleartext := "hello"
2 changes: 1 addition & 1 deletion src/tests/modules/always/set_status_revive.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ if (ok) {
}
}

&control.Password.Cleartext := "hello"
control.Password.Cleartext := "hello"
4 changes: 2 additions & 2 deletions src/tests/modules/attr_filter/bob.unlang
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
attr_filter

&control.Password.Cleartext := "goodbye"
control.Password.Cleartext := "goodbye"

&reply += {
reply += {
Reply-Message = "success"
}
8 changes: 4 additions & 4 deletions src/tests/modules/attr_filter/operators.unlang
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copy request to reply for later
&reply := request
reply := request

attr_filter

Expand Down Expand Up @@ -44,7 +44,7 @@ if (reply.Idle-Timeout) {
test_fail
}

&reply := {}
reply := {}

&control.Password.Cleartext := "goodbye"
&reply.Reply-Message := Reply-Message
control.Password.Cleartext := "goodbye"
reply.Reply-Message := Reply-Message
36 changes: 18 additions & 18 deletions src/tests/modules/cache_rbtree/cache-bin.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Series of tests to check for binary safe operation of the cache module
# both keys and values should be binary safe.
#
&Class := 0xaa00bb00cc00dd00
&Callback-Id := "foo\000bar\000baz"
Class := 0xaa00bb00cc00dd00
Callback-Id := "foo\000bar\000baz"

# 0. Sanity check
if (Callback-Id != "foo\000bar\000baz") {
Expand All @@ -21,20 +21,20 @@ if (!updated) {
}

# Now add a second entry, with the value diverging after the first null byte
&Class := 0xaa00bb00cc00ee00
&Callback-Id := "bar\000baz"
Class := 0xaa00bb00cc00ee00
Callback-Id := "bar\000baz"

# 2. Should create a *new* entry and not update the existing one
cache_bin_key_octets.store
if (!updated) {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

# If the key is binary safe, we should now be able to retrieve the first entry
# if it's not, the above test will likely fail, or we'll get the second entry.
&Class := 0xaa00bb00cc00dd00
Class := 0xaa00bb00cc00dd00

cache_bin_key_octets
if (!updated) {
Expand All @@ -49,10 +49,10 @@ if (Callback-Id != "foo\000bar\000baz") {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

# Now try and get the second entry
&Class := 0xaa00bb00cc00ee00
Class := 0xaa00bb00cc00ee00

cache_bin_key_octets
if (!updated) {
Expand All @@ -67,33 +67,33 @@ if (Callback-Id != "bar\000baz") {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

#
# We should also be able to use any fixed length data type as a key
# though there are no guarantees this will be portable.
#
&Framed-IP-Address := 192.168.0.1
&Callback-Id := "foo\000bar\000baz"
Framed-IP-Address := 192.168.0.1
Callback-Id := "foo\000bar\000baz"

cache_bin_key_ipaddr
if (!ok) {
test_fail
}

# Now add a second entry
&Framed-IP-Address:= 192.168.0.2
&Callback-Id := "bar\000baz"
Framed-IP-Address:= 192.168.0.2
Callback-Id := "bar\000baz"

cache_bin_key_ipaddr
if (!ok) {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

# Now retrieve the first entry
&Framed-IP-Address := 192.168.0.1
Framed-IP-Address := 192.168.0.1

cache_bin_key_ipaddr
if (!updated) {
Expand All @@ -108,10 +108,10 @@ if (Callback-Id != "foo\000bar\000baz") {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

# Now try and get the second entry
&Framed-IP-Address := 192.168.0.2
Framed-IP-Address := 192.168.0.2

cache_bin_key_ipaddr
if (!updated) {
Expand All @@ -126,6 +126,6 @@ if (Callback-Id != "bar\000baz") {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

test_pass
36 changes: 18 additions & 18 deletions src/tests/modules/cache_rbtree/cache-logic.unlang
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
# PRE:
#
&Filter-Id := 'testkey'
Filter-Id := 'testkey'

#
# 0. Basic store and retrieve
#
&control.Callback-Id := 'cache me'
control.Callback-Id := 'cache me'

cache
if (!ok) {
Expand All @@ -19,7 +19,7 @@ if (Callback-Id) {
}

# 2. Check status-only works correctly (should return ok and consume attribute)
&control.Cache-Status-Only := 'yes'
control.Cache-Status-Only := 'yes'

cache
if (!ok) {
Expand All @@ -43,7 +43,7 @@ if (Callback-Id != control.Callback-Id) {
}

# 6. Retrieving the entry should not expire it
&request -= Callback-Id[*]
request -= Callback-Id[*]

cache
if (!updated) {
Expand All @@ -59,17 +59,17 @@ else {
}

# 8. Force expiry of the entry
&control.Cache-Allow-Merge := no
&control.Cache-Allow-Insert := no
&control.Cache-TTL := 0
control.Cache-Allow-Merge := no
control.Cache-Allow-Insert := no
control.Cache-TTL := 0

cache
if (!ok) {
test_fail
}

# 9. Check status-only works correctly (should return notfound and consume attribute)
&control.Cache-Status-Only := 'yes'
control.Cache-Status-Only := 'yes'

cache
if (!notfound) {
Expand All @@ -82,8 +82,8 @@ if (control.Cache-Status-Only) {
}

# 11. Check merge-only works correctly (should return notfound and consume attribute)
&control.Cache-Allow-Merge := 'yes'
&control.Cache-Allow-Insert := 'no'
control.Cache-Allow-Merge := 'yes'
control.Cache-Allow-Insert := 'no'

cache
if (!notfound) {
Expand All @@ -96,15 +96,15 @@ if (control.Cache-Allow-Merge) {
}

# 13. ...and check the entry wasn't recreated
&control.Cache-Status-Only := 'yes'
control.Cache-Status-Only := 'yes'

cache
if (!notfound) {
test_fail
}

# 14. This should still allow the creation of a new entry
&control.Cache-TTL := -2
control.Cache-TTL := -2

cache
if (!ok) {
Expand All @@ -127,10 +127,10 @@ if (Callback-Id != control.Callback-Id) {
test_fail
}

&control.Callback-Id := 'cache me2'
control.Callback-Id := 'cache me2'

# 18. Updating the Cache-TTL shouldn't make things go boom (we can't really check if it works)
&control.Cache-TTL := 30
control.Cache-TTL := 30

cache
if (!updated) {
Expand All @@ -143,7 +143,7 @@ if (Callback-Id == control.Callback-Id) {
}

# 20. Check that a new entry is created
&control.Cache-TTL := -2
control.Cache-TTL := -2

cache
if (!updated) {
Expand All @@ -167,9 +167,9 @@ if (Callback-Id != control.Callback-Id) {
}

# 24. Check Cache-Merge = yes works as expected (should update current request)
&control.Callback-Id := 'cache me3'
&control.Cache-TTL := -2
&control.Cache-Merge-New := yes
control.Callback-Id := 'cache me3'
control.Cache-TTL := -2
control.Cache-Merge-New := yes

cache
if (!updated) {
Expand Down
36 changes: 18 additions & 18 deletions src/tests/modules/cache_rbtree/cache-method-bin.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Series of tests to check for binary safe operation of the cache module
# both keys and values should be binary safe.
#
&Class := 0xaa11bb00cc00dd00
&Callback-Id := "foo\000bar\000baz"
Class := 0xaa11bb00cc00dd00
Callback-Id := "foo\000bar\000baz"

# 0. Sanity check
if (Callback-Id != "foo\000bar\000baz") {
Expand All @@ -21,20 +21,20 @@ if (!updated) {
}

# Now add a second entry, with the value diverging after the first null byte
&Class := 0xaa11bb00cc00ee00
&Callback-Id := "bar\000baz"
Class := 0xaa11bb00cc00ee00
Callback-Id := "bar\000baz"

# 2. Should create a *new* entry and not update the existing one
cache_bin_key_octets.store
if (!updated) {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

# If the key is binary safe, we should now be able to retrieve the first entry
# if it's not, the above test will likely fail, or we'll get the second entry.
&Class := 0xaa11bb00cc00dd00
Class := 0xaa11bb00cc00dd00

cache_bin_key_octets.load
if (!updated) {
Expand All @@ -49,10 +49,10 @@ if (Callback-Id != "foo\000bar\000baz") {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

# Now try and get the second entry
&Class := 0xaa11bb00cc00ee00
Class := 0xaa11bb00cc00ee00

cache_bin_key_octets.load
if (!updated) {
Expand All @@ -67,33 +67,33 @@ if (Callback-Id != "bar\000baz") {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

#
# We should also be able to use any fixed length data type as a key
# though there are no guarantees this will be portable.
#
&Framed-IP-Address := 192.168.1.1
&Callback-Id := "foo\000bar\000baz"
Framed-IP-Address := 192.168.1.1
Callback-Id := "foo\000bar\000baz"

cache_bin_key_ipaddr.store
if (!updated) {
test_fail
}

# Now add a second entry
&Framed-IP-Address:= 192.168.1.2
&Callback-Id := "bar\000baz"
Framed-IP-Address:= 192.168.1.2
Callback-Id := "bar\000baz"

cache_bin_key_ipaddr.store
if (!updated) {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

# Now retrieve the first entry
&Framed-IP-Address := 192.168.1.1
Framed-IP-Address := 192.168.1.1

cache_bin_key_ipaddr.load
if (!updated) {
Expand All @@ -108,10 +108,10 @@ if (Callback-Id != "foo\000bar\000baz") {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

# Now try and get the second entry
&Framed-IP-Address := 192.168.1.2
Framed-IP-Address := 192.168.1.2

cache_bin_key_ipaddr.load
if (!updated) {
Expand All @@ -126,6 +126,6 @@ if (Callback-Id != "bar\000baz") {
test_fail
}

&request -= Callback-Id[*]
request -= Callback-Id[*]

test_pass
Loading

0 comments on commit 793cde1

Please sign in to comment.