Skip to content

Commit

Permalink
Remove Tmp- attributes from remaining module tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ndptech authored and jejones3141 committed Jan 8, 2024
1 parent 953e584 commit cca1290
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/tests/modules/files/compound_key
Original file line number Diff line number Diff line change
@@ -1 +1 @@
test0:test1 Tmp-String-0 := 'matched'
test0:test1 Realm := 'matched'
8 changes: 4 additions & 4 deletions src/tests/modules/files/compound_key.unlang
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
&Tmp-String-0 := 'test0'
&Tmp-String-1 := 'test1'
&Filter-Id := 'test0'
&Callback-Id := 'test1'

compound_key
if (!ok) {
test_fail
}

if (!(&control.Tmp-String-0 == 'matched')) {
debug_all
if (!(&control.Realm == 'matched')) {
test_fail
}

Expand Down
4 changes: 2 additions & 2 deletions src/tests/modules/files/module.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ files subnet2 {
}

files compound_key {
key = "%{Tmp-String-0}:%{Tmp-String-1}"
key = "%{Filter-Id}:%{Callback-Id}"
filename = $ENV{MODULE_TEST_DIR}/compound_key
}

#
#
#
#
#
#
Expand Down
5 changes: 3 additions & 2 deletions src/tests/modules/icmp/ping.unlang
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
&control.Tmp-String-0 := %ping(127.0.0.1)
string test_string
&test_string := %ping(127.0.0.1)

#
# @todo - conditions do not yet support YIELD
#
if (&control.Tmp-String-0 == "yes") {
if (&test_string == "yes") {
&control.Password.Cleartext := "hello"

&reply += {
Expand Down
26 changes: 13 additions & 13 deletions src/tests/modules/idn/idn.unlang
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
string test_string
#
# PRE: update if
#

&Tmp-String-0 := "%idn('example.com')"
&Tmp-String-1 := "%idn('èxâmpłé.com')"
&Tmp-String-2 := "%idn('пример.com')"
&Tmp-String-3 := "%idn('παράδειγμα.com')"
&Tmp-String-4 := "%idn('ตัวอย่าง.com')"

if (&Tmp-String-0 != "example.com") {
&test_string := "%idn('example.com')"
if (&test_string != "example.com") {
test_fail
}

if (&Tmp-String-1 != "xn--xmp-ila2ak63d.com") {
&test_string := "%idn('èxâmpłé.com')"
if (&test_string != "xn--xmp-ila2ak63d.com") {
test_fail
}

if (&Tmp-String-2 != "xn--e1afmkfd.com") {
&test_string := "%idn('пример.com')"
if (&test_string != "xn--e1afmkfd.com") {
test_fail
}

if (&Tmp-String-3 != "xn--hxajbheg2az3al.com") {
&test_string := "%idn('παράδειγμα.com')"
if (&test_string != "xn--hxajbheg2az3al.com") {
test_fail
}

if (&Tmp-String-4 != "xn--72c1a1bt4awk9o.com") {
&test_string := "%idn('ตัวอย่าง.com')"
if (&test_string != "xn--72c1a1bt4awk9o.com") {
test_fail
}

&Tmp-String-0 := "%idn('invalid_example.com')"
&test_string := "%idn('invalid_example.com')"

if (&Module-Failure-Message != "Non-digit/letter/hyphen in input") {
test_fail
Expand All @@ -40,7 +40,7 @@ if (&Module-Failure-Message == "") {

&request -= &Module-Failure-Message[*]

&Tmp-String-0 := "%idn('a.véry.löng.ņàme.whîch.when.expânded.exceedş.ţhe.dns.stanđard.fór.string.łength.of.twø.hündred.ând.fifty.threé.charáctèrs.and.therefore.is.invalid.for.idn.conversion')"
&test_string := "%idn('a.véry.löng.ņàme.whîch.when.expânded.exceedş.ţhe.dns.stanđard.fór.string.łength.of.twø.hündred.ând.fifty.threé.charáctèrs.and.therefore.is.invalid.for.idn.conversion')"

if (&Module-Failure-Message != "Conversion was truncated") {
test_fail
Expand Down
4 changes: 2 additions & 2 deletions src/tests/modules/redis/cluster_node_fail.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (!(%redis(SET, b, 'boom') == 'OK')) {
}

# Leave some time (500ms) for the synchronisation
%(delay:0.5)
%delay(0.5)

# Note the current master
&redismaster := %redis.node(b, 0)
Expand Down Expand Up @@ -51,7 +51,7 @@ if (%redis(@%redis.node(b), DEBUG, SEGFAULT)) {
}

# No alternatives...
%(delay:0.5)
%delay(0.5)
if (%redis(GET, b) == 'boom') {
test_fail
}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/modules/redis_ippool/pool_tool_static.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if !(&reply.Framed-IP-Address == 192.168.0.10) {
#
# Check the ZSCORE hasn't changed
#
if !(%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) == %{zscore}) {
if !(%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) == %{zscore}) {
test_fail
}

Expand Down

0 comments on commit cca1290

Please sign in to comment.