#
# Set CHAP-Password
#
-&CHAP-Password := "%(chap.password:%{CHAP-Password})"
+&CHAP-Password := %chap.password("%{CHAP-Password}")
#
# Set CHAP-Password
#
-&request.CHAP-Password := %(chap.password:%{request.CHAP-Password})
+&request.CHAP-Password := %chap.password("%{request.CHAP-Password}")
}
recv Identity-Response {
- "%(debug_attr:&session-state.)"
+# %debug_attr(&session-state.)
if (!&session-state.Tmp-String-0) {
&reply.Any-ID-Req := yes
&session-state.Tmp-String-0 := yes
}
recv Identity-Response {
- "%(debug_attr:&session-state.)"
+# %debug_attr(&session-state.)
if (!&session-state.Tmp-String-0) {
&reply.Any-ID-Req := yes
&session-state.Tmp-String-0 := yes
namespace = eap-sim
recv Identity-Response {
- "%(debug_attr:&session-state.)"
+# %debug_attr(&session-state.)
if (!&session-state.Tmp-String-0) {
&reply.Any-ID-Req := yes
&session-state.Tmp-String-0 := yes
#
# MD5 HMAC with missing key should fail
#
-&Tmp-Octets-1 := "%(hmacmd5:%{Tmp-String-1} )" # ERROR
-
-test_fail
+&Tmp-Octets-1 := %hmacmd5(%{Tmp-String-1}, )
+if &Tmp-Octets-1 {
+ test_fail
+}
+success
#
&Tmp-String-1 := "{clear}%{User-Password}"
&control := {
- &Password.With-Header = "%(base64.encode:%{Tmp-String-1})"
+ &Password.With-Header = %base64.encode(%{Tmp-String-1})
}
pap.authorize
&control.Tmp-Octets-0 := "%bin(%{control.Tmp-String-1})"
# To Base64
-&control.Tmp-String-1 := "{ssha512}%(base64.encode:%{control.Tmp-Octets-0})"
+&control.Tmp-String-1 := "{ssha512}%base64.encode(%{control.Tmp-Octets-0})"
&control += {
&Password.With-Header = "%base64.encode(%{control.Tmp-String-1})"
#
# SHA1 HMAC with missing key should fail
#
-&Tmp-Octets-1 := "%(hmacsha1:%{Tmp-String-1} )" # ERROR
-
-
-test_fail
+&Tmp-Octets-1 := %hmacsha1(%{Tmp-String-1}, ) # ERROR
+if &Tmp-Octets-1 {
+ test_fail
+}
+success
#
redundant {
timeout 0.01s {
- &Tmp-Float-0 := "%(delay_10s:0.1)"
+ &Tmp-Float-0 := %delay_10s(0.1)
test_fail
}
redundant {
timeout "0.01" {
- &Tmp-Float-0 := "%(delay_10s:0.1)"
+ &Tmp-Float-0 := %delay_10s(0.1)
test_fail
}
&request -= &Tmp-String-0[*]
&request -= &Tmp-String-1[*]
-&Tmp-String-2 := "%{&Tmp-String-0[0] || &Tmp-String-1[0]}%(delay_10s:)"
+&Tmp-String-2 := "%{&Tmp-String-0[0] || &Tmp-String-1[0]}%delay_10s()"
success
# This is mainly a smoke test... i.e. if it crashes there's smoke
-"%(delay_10s:)" # Should 'blip' the request
+%delay_10s() # Should 'blip' the request
-&Tmp-Float-0 := "%(delay_10s:0.1)"
+&Tmp-Float-0 := %delay_10s(0.1)
if (!&Tmp-Float-0) {
fail
}
#
# Set status to "notfound". xlat should expand to previous status, "alive"
#
-if ("%(db_status:notfound)" != "alive") {
+if (%db_status('notfound') != "alive") {
&reply += {
- &Reply-Message = "Failure in test at line %(interpreter:...line)"
+ &Reply-Message = "Failure in test at line %interpreter(...line)"
}
}
db_status
if (!notfound) {
&reply += {
- &Reply-Message = "Failure in test at line %(interpreter:...line)"
+ &Reply-Message = "Failure in test at line %interpreter(...line)"
}
}
#
# Fetch status using xlat without setting the status
#
-if ("%(db_status:)" != "notfound") {
+if (%db_status() != "notfound") {
&reply += {
- &Reply-Message = "Failure in test at line %(interpreter:...line)"
+ &Reply-Message = "Failure in test at line %interpreter(...line)"
}
}
#
# Set the module status to dead, call it and check that it fails
#
-%(db_status:fail)
+%db_status('fail')
db_status {
fail = 1
#
# Fail a module...
#
-%(db_status:fail)
+%db_status('fail')
db_status {
fail = 1
}
if (!fail) {
&reply += {
- &Reply-Message = "Failure in test at line %(interpreter:...line)"
+ &Reply-Message = "Failure in test at line %interpreter(...line)"
}
}
#
# ... Now revive it
#
-%(db_status:alive)
+%db_status('alive')
db_status
if (ok) {
&reply += {