#
# 1.2 - Get the original IMSI back again sans tag
#
-&control.Tmp-String-1 := "%(3gpp_temporary_id_decrypt:%{control.User-Name} %{control.Tmp-String-0} false)"
+&control.Tmp-String-1 := %3gpp_temporary_id_decrypt(%{control.User-Name}, %{control.Tmp-String-0}, 'false')
if ("%{User-Name}" =~ /^0(.*)/) {
if (!&control.Tmp-String-1 || (&control.Tmp-String-1 == '') || (%{control.Tmp-String-1} != "%{1}")) {
#
# Sync calls return the response
#
-&Tmp-String-0 := "%(exec_sync:/bin/sh -c 'echo hello')"
+&Tmp-String-0 := %exec_sync('/bin/sh', '-c', "echo 'hello'")
if (&Tmp-String-0 != 'hello') {
test_fail
}
# Call something which will take longer than the timeout
#
&request -= &Tmp-String-0
-&Tmp-String-0 := "%(exec_sync:/bin/sleep 10)"
+&request -= &Module-Failure-Message
-if (&Module-Failure-Message[*] != "Execution of external program failed: Timeout running program") {
+&Tmp-String-0 := %exec_sync('/bin/sleep', '10')
+
+if (&Module-Failure-Message != "Execution of external program failed: Timeout running program") {
test_fail
}
-if !(&Tmp-String-0 == "") {
+if &Tmp-String-0 {
test_fail
}
&request -= &Tmp-String-0
-&Tmp-String-0 := "%(exec_sync:/bin/sh $ENV{MODULE_TEST_DIR}/fail.sh)"
+&request -= &Module-Failure-Message
+
+&Tmp-String-0 := %exec_sync('/bin/sh', "$ENV{MODULE_TEST_DIR}/fail.sh")
-if !(&Tmp-String-0 == "") {
+if &Tmp-String-0 {
test_fail
}
test_fail
}
-&Tmp-String-0 := "%(dns:localhost AAAA)"
+&Tmp-String-0 := %dns('localhost', 'AAAA')
if (&Tmp-String-0 != "::1") {
test_fail
}
-&Tmp-String-1 := %dns(1.0.0.127.in-addr.arpa,PTR)
+&Tmp-String-1 := %dns(1.0.0.127.in-addr.arpa, 'PTR')
if (&Tmp-String-1 != "localhost") {
test_fail
}
# Use local data in module config to allow for dotted names
-&Tmp-IP-Address-0 := %dns(www.example.com,A)
+&Tmp-IP-Address-0 := %dns('www.example.com', 'A')
if (&Tmp-IP-Address-0 != 192.168.1.1) {
test_fail
# Try a real, known, network response
# Temporarily disabled while there is a bug in unbound
-#&Tmp-String-0 := %dns(8.8.8.8.in-addr.arpa,PTR)
+#&Tmp-String-0 := %dns('8.8.8.8.in-addr.arpa', 'PTR')
#if (&Tmp-String-0 != "dns.google") {
# test_fail
#}
# Invalid query
-&Tmp-String-0 := %dns(www.example.com,ABC)
+&Tmp-String-0 := %dns('www.example.com', 'ABC')
if (&Module-Failure-Message != "Invalid / unsupported DNS query type") {
test_fail
}
&Tmp-String-0 := ""
-&Tmp-String-1 := %dns(%{Tmp-String-0},A)
+&Tmp-String-1 := %dns(%{Tmp-String-0}, 'A')
if (&Module-Failure-Message != "Can't resolve zero length host") {
test_fail
}
-&Tmp-String-1 := "%dns(example.com,MX)"
+&Tmp-String-1 := %dns('example.com', 'MX')
# Until we can handle multiple boxes in xlat expansion, the results
# are concatenated into a single string