}
if (&Class != 0x01020304) {
- update reply {
- Filter-Id := "fail 0"
- }
+ test_fail
}
# Must be the same as above
if (&Class[0] != 0x01020304) {
- update reply {
- Filter-Id += "fail 0a"
- }
+ test_fail
}
if (&Class[1] != 0x05060708) {
- update reply {
- Filter-Id += "fail 1"
- }
+ test_fail
}
if (&Class[2] != 0x090a0b0c) {
- update reply {
- Filter-Id += "fail 2"
- }
+ test_fail
}
# must not exist
if (&Class[3]) {
- update reply {
- Filter-Id += "fail 3"
- }
+ test_fail
}
# Last element of the array
if (&Class[n] != 0x090a0b0c) {
- update reply {
- Filter-Id += "fail 4"
- }
+ test_fail
}
success
-M#
+#
# PRE: update if redundant
#
update {
}
if (<ipaddr>Tmp-Integer-0 != NAS-IP-Address) {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPv6addr != ::ffff:203.0.113.1) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPaddr != 203.0.113.1) {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPv6Prefix != ::ffff:203.0.113.0/120) {
- update reply {
- Filter-Id += 'Fail 31'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPv4Prefix != 203.0.113.1/24) {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPv6Addr != ::ffff:203.0.113.1) {
- update reply {
- Filter-Id += 'Fail 5'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-Ipaddr != 203.0.113.1/32) {
- update reply {
- Filter-Id += 'Fail 6'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPv6Prefix != ::ffff:203.0.113.1/128) {
- update reply {
- Filter-Id += 'Fail 7'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPv4Prefix != 203.0.113.1/32) {
- update reply {
- Filter-Id += 'Fail 8'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPv4Prefix != 203.0.113.1/32) {
- update reply {
- Filter-Id += 'Fail 9'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPv6Prefix != 2001:DB8::1/128) {
- update reply {
- Filter-Id += 'Fail 11'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-Ipaddr != 203.0.113.1) {
- update reply {
- Filter-Id += 'Fail 12'
- }
+ test_fail
}
#
}
if (&control:Tmp-Cast-IPv6Addr != ::ffff:203.0.113.1) {
- update reply {
- Filter-Id += 'Fail 13'
- }
+ test_fail
}
#
update control {
Tmp-Cast-IPv6Addr := Tmp-Cast-IPv6Prefix
}
- update reply {
- Filter-Id += 'Fail 14'
- }
+ test_fail
}
group {
if ("%{Module-Failure-Message}" != 'Attribute conversion failed: Invalid cast from ipv6prefix to ipv6addr. Only /128 (not /32) prefixes may be cast to IP address types') {
- update reply {
- Filter-Id += 'Fail 14.5'
- }
+ test_fail
}
update request {
Module-Failure-Message !* ANY
update control {
Tmp-Cast-Ipaddr := &Tmp-Cast-IPv6Prefix[2]
}
- update reply {
- Filter-Id += 'Fail 15'
- }
+ test_fail
}
group {
if ("%{Module-Failure-Message}" != 'Attribute conversion failed: Invalid cast from ipv6prefix to ipaddr. Only /128 (not /64) prefixes may be cast to IP address types') {
- update reply {
- Filter-Id += 'Fail 15.5'
- }
+ test_fail
}
update request {
Module-Failure-Message !* ANY
update control {
Tmp-Cast-Ipv4Prefix := &Tmp-Cast-IPv6Prefix[2]
}
- update reply {
- Filter-Id += 'Fail 16'
- }
+ test_fail
}
group {
if ("%{Module-Failure-Message}" != 'Attribute conversion failed: Invalid cast from ipv6prefix to ipv4prefix. No IPv4-IPv6 mapping prefix') {
- update reply {
- Filter-Id += 'Fail 16.5'
- }
+ test_fail
}
update request {
Module-Failure-Message !* ANY
update control {
Tmp-Cast-IPv6Addr := &Tmp-Cast-IPv4Prefix
}
- update reply {
- Filter-Id += 'Fail 17'
- }
+ test_fail
}
group {
if ("%{Module-Failure-Message}" != 'Attribute conversion failed: Invalid cast from ipv4prefix to ipv6addr. Only /32 (not /24) prefixes may be cast to IP address types') {
- update reply {
- Filter-Id += 'Fail 17.5'
- }
+ test_fail
}
update request {
Module-Failure-Message !* ANY
update control {
Tmp-Cast-Ipaddr := &Tmp-Cast-IPv4Prefix
}
- update reply {
- Filter-Id += 'Fail 17.1'
- }
+ test_fail
}
group {
if ("%{Module-Failure-Message}" != 'Attribute conversion failed: Invalid cast from ipv4prefix to ipaddr. Only /32 (not 24/) prefixes may be cast to IP address types') {
- update reply {
- Filter-Id += 'Fail 17.6'
- }
+ test_fail
}
update request {
Module-Failure-Message !* ANY
update control {
Tmp-Cast-Ipaddr := &Tmp-Cast-IPv6Prefix
}
- update reply {
- Filter-Id += 'Fail 18'
- }
+ test_fail
}
group {
if ("%{Module-Failure-Message}" != 'Attribute conversion failed: Invalid cast from ipv6prefix to ipaddr. Only /128 (not /32) prefixes may be cast to IP address types') {
- update reply {
- Filter-Id += 'Fail 18.5'
- }
+ test_fail
}
update request {
Module-Failure-Message !* ANY
update control {
Tmp-Cast-IPv4Prefix := &Tmp-Cast-IPv6Prefix
}
- update reply {
- Filter-Id += 'Fail 19'
- }
+ test_fail
}
group {
if ("%{Module-Failure-Message}" != 'Attribute conversion failed: Invalid cast from ipv6prefix to ipv4prefix. No IPv4-IPv6 mapping prefix') {
- update reply {
- Filter-Id += 'Fail 19.5'
- }
+ test_fail
}
update request {
Module-Failure-Message !* ANY
update control {
Tmp-Cast-Ipaddr := &Tmp-Cast-IPv6Addr
}
- update reply {
- Filter-Id += 'Fail 20'
- }
+ test_fail
}
group {
if ("%{Module-Failure-Message}" != 'Attribute conversion failed: Invalid cast from ipv6addr to ipaddr. No IPv4-IPv6 mapping prefix') {
- update reply {
- Filter-Id += 'Fail 20'
- }
+ test_fail
}
update request {
Module-Failure-Message !* ANY
update control {
Tmp-Cast-IPv4Prefix := &Tmp-Cast-IPv6Addr
}
- update reply {
- Filter-Id += 'Fail 21'
- }
+ test_fail
}
group {
if ("%{Module-Failure-Message}" != 'Attribute conversion failed: Invalid cast from ipv6addr to ipv4prefix. No IPv4-IPv6 mapping prefix') {
- update reply {
- Filter-Id += 'Fail 21.5'
- }
+ test_fail
}
update request {
Module-Failure-Message !* ANY
}
if (<string>"%{escape:%{request:Tmp-String-0}}" != &Tmp-String-0) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
if (<string>"%{escape:%{request:Tmp-String-1}}" != &Tmp-String-3) {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
if (<string>"%{escape:%{request:Tmp-String-2}}" != &Tmp-String-4) {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
if (<string>"%{unescape:%{request:Tmp-String-0}}" != &Tmp-String-0) {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
if (<string>"%{unescape:%{request:Tmp-String-3}}" != "%{Tmp-String-1}") {
- update reply {
- Filter-Id += 'Fail 5'
- }
+ test_fail
}
if (<string>"%{unescape:%{request:Tmp-String-4}}" != &Tmp-String-2) {
- update reply {
- Filter-Id += 'Fail 6'
- }
+ test_fail
}
if (<string>"%{escape:%{request:Tmp-String-6}}" != &Tmp-String-7) {
- update reply {
- Filter-Id += 'Fail 7'
- }
+ test_fail
}
if (<string>"%{unescape:%{request:Tmp-String-7}}" != &Tmp-String-6) {
- update reply {
- Filter-Id += 'Fail 8'
- }
+ test_fail
}
success
}
if (!&Tmp-String-0[0] || !&Tmp-String-0[1] || !&Tmp-String-0[2] || !&Tmp-String-0[3]) {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
if ((&Tmp-String-0[0] != '0') || (&Tmp-String-0[1] != '1') || (&Tmp-String-0[2] != '2') || (&Tmp-String-0[3] != '3')) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
if (!&control:Tmp-String-0[0] || &control:Tmp-String-0[1] || &control:Tmp-String-0[2] || &control:Tmp-String-0[3]) {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
success
}
if (control:Cleartext-Password !~ /hell(o)(.*)/) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
#
# Verify non-empty capture groups evaluate to true
#
if (!"%{1}") {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
#
# Verify empty capture groups evaluate to false
#
if ("%{2}") {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
if (control:Cleartext-Password !~ /hello(.*)/) {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
#
# Check for stale capture group values
#
if ("%{1}") {
- update reply {
- Filter-Id += 'Fail 5'
- }
+ test_fail
}
success
# Non matching on attribute ref
if (User-Name !~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{Tmp-String-0}/) {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
# Matching on xlat expanded value
if ("%{User-Name}" !~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])%{Tmp-String-0}/) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
# Matching on attribute ref with capture groups
}
}
else {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
# Checking capture groups are cleared out correctly
if (User-Name =~ /^([0-9])_%{Tmp-String-0}/) {
if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" != '1_1') {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 3.5'
- }
+ test_fail
}
# Checking capture groups are cleared out correctly when there are no matches
if (User-Name =~ /^.%{Tmp-String-0}/) {
if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" != '1') {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 4.5'
- }
+ test_fail
}
# Checking full capture group range
if ('a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_F' =~ /^(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)$/) {
if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}%{8}%{9}%{10}%{11}%{12}%{13}%{14}%{15}%{16}%{17}%{18}%{19}%{20}%{21}%{22}%{23}%{24}%{25}%{26}%{27}%{28}%{29}%{30}%{31}%{32}" != 'a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_FabcdefghijklmnopqrstuvwxyzABCDEF') {
- update reply {
- Filter-Id += 'Fail 6'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 6.5'
- }
+ test_fail
}
# Checking full capture group overun
if ('a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_F_G' =~ /^(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)$/) {
if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}%{8}%{9}%{10}%{11}%{12}%{13}%{14}%{15}%{16}%{17}%{18}%{19}%{20}%{21}%{22}%{23}%{24}%{25}%{26}%{27}%{28}%{29}%{30}%{31}%{32}" != 'a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_F_GabcdefghijklmnopqrstuvwxyzABCDEF') {
- update reply {
- Filter-Id += 'Fail 7'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 7.5'
- }
+ test_fail
}
# uncompiled - ref - insensitive
if (Calling-Station-Id !~ /:roamyroam%{Tmp-String-0}$/i) {
- update reply {
- Filter-Id += 'Fail 8'
- }
+ test_fail
}
# uncompiled - expansion - insensitive
if ("%{Calling-Station-Id}" !~ /:roamyroam%{Tmp-String-0}$/i) {
- update reply {
- Filter-Id += 'Fail 9'
- }
+ test_fail
}
# uncompiled - enum - ref - insensitive
if (Service-Type !~ /^framed-user%{Tmp-String-0}$/i) {
- update reply {
- Filter-Id += 'Fail 10'
- }
+ test_fail
}
# uncompiled - enum - expansion - insensitive
if ("%{Service-Type}" !~ /^framed-user%{Tmp-String-0}$/i) {
- update reply {
- Filter-Id += 'Fail 11'
- }
+ test_fail
}
# uncompiled - enum - ref
if (Service-Type =~ /^framed-user%{Tmp-String-0}$/) {
- update reply {
- Filter-Id += 'Fail 12'
- }
+ test_fail
}
# uncompiled - integer - ref
if (Tmp-Integer-0 !~ /%{Tmp-Integer-0}/) {
- update reply {
- Filter-Id += 'Fail 13'
- }
+ test_fail
}
update request {
# uncompiled - ref - multiline
if (&Tmp-String-0 !~ /^foo$%{Tmp-String-8}/m) {
- update reply {
- Filter-Id += 'Fail 14'
- }
+ test_fail
}
# uncompiled - ref - non-multiline
if (&Tmp-String-0 =~ /^foo$%{Tmp-String-8}/) {
- update reply {
- Filter-Id += 'Fail 15'
- }
+ test_fail
}
# uncompiled - ref - non-multiline
if (&Tmp-String-0 !~ /^foo\nbar%{Tmp-String-8}$/) {
- update reply {
- Filter-Id += 'Fail 16'
- }
+ test_fail
}
# uncompiled - ref - multiline
if (&Tmp-String-0 !~ /^bar%{Tmp-String-8}$/m) {
- update reply {
- Filter-Id += 'Fail 17'
- }
+ test_fail
}
# uncompiled - ref - multiline - sensitive
if (&Tmp-String-0 =~ /^BAR%{Tmp-String-8}$/m) {
- update reply {
- Filter-Id += 'Fail 18'
- }
+ test_fail
}
# uncompiled - ref - multiline - insensitive
if (&Tmp-String-0 !~ /^BAR%{Tmp-String-8}$/mi) {
- update reply {
- Filter-Id += 'Fail 19'
- }
+ test_fail
}
# uncompiled - ref - multiline - insensitive (flag order reversed)
if (&Tmp-String-0 !~ /^BAR%{Tmp-String-8}$/im) {
- update reply {
- Filter-Id += 'Fail 20'
- }
+ test_fail
}
# Non matching on attribute ref
if (User-Name !~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])/) {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
# Matching on xlat expanded value
if ("%{User-Name}" !~ /^([0-9])_([0-9])?_([0-9]*)_([0-9]+)_([^_])_(6)_([7-8])/) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
# Matching on attribute ref with capture groups
}
}
else {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
# Checking capture groups are cleared out correctly
if (User-Name =~ /^([0-9])_/) {
if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" != '1_1') {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 3.5'
- }
+ test_fail
}
# Checking capture groups are cleared out correctly when there are no matches
if (User-Name =~ /^./) {
if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" != '1') {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 4.5'
- }
+ test_fail
}
# compiled - ref - insensitive
if (Calling-Station-Id !~ /:roamyroam$/i) {
- update reply {
- Filter-Id += 'Fail 5'
- }
+ test_fail
}
# compiled - expansion - insensitive
if ("%{Calling-Station-Id}" !~ /:roamyroam$/i) {
- update reply {
- Filter-Id += 'Fail 6'
- }
+ test_fail
}
# compiled - enum - ref - insensitive
if (Service-Type !~ /^framed-user$/i) {
- update reply {
- Filter-Id += 'Fail 7'
- }
+ test_fail
}
# compiled - enum - expansion - insensitive
if ("%{Service-Type}" !~ /^framed-user$/i) {
- update reply {
- Filter-Id += 'Fail 8'
- }
+ test_fail
}
# compiled - enum - ref
if (Service-Type =~ /^framed-user$/) {
- update reply {
- Filter-Id += 'Fail 9'
- }
+ test_fail
}
update request {
# compiled - ref - multiline
if (&Tmp-String-0 !~ /^foo$/m) {
- update reply {
- Filter-Id += 'Fail 14'
- }
+ test_fail
}
# compiled - ref - non-multiline
if (&Tmp-String-0 =~ /^foo$/) {
- update reply {
- Filter-Id += 'Fail 15'
- }
+ 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') && (&Tmp-String-0 !~ /^foo\nbar$/)) {
- update reply {
- Filter-Id += 'Fail 16'
- }
+ test_fail
}
# compiled - ref - multiline
if (&Tmp-String-0 !~ /^bar$/m) {
- update reply {
- Filter-Id += 'Fail 17'
- }
+ test_fail
}
# compiled - ref - multiline - sensitive
if (&Tmp-String-0 =~ /^BAR$/m) {
- update reply {
- Filter-Id += 'Fail 17'
- }
+ test_fail
}
# compiled - ref - multiline - insensitive
if (&Tmp-String-0 !~ /^BAR$/mi) {
- update reply {
- Filter-Id += 'Fail 17'
- }
+ test_fail
}
# compiled - ref - multiline - insensitive (flag order reversed)
if (&Tmp-String-0 !~ /^BAR$/im) {
- update reply {
- Filter-Id += 'Fail 18'
- }
+ test_fail
}
# uncompiled - ref - named capture groups
if (User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])%{Tmp-String-0}/) {
if ("%{regex:seven}_%{regex:six}_%{regex:five}_%{regex:four}_%{regex:three}_%{regex:two}_%{regex:one}_%{0}" != '7_6_5_4_3_2_1_1_2_3_4_5_6_7') {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 1.5'
- }
+ test_fail
}
# Checking capture groups are cleared out correctly
if (User-Name =~ /^(?<one>[0-9])_%{Tmp-String-0}/) {
if ("%{0}%{regex:one}%{regex:two}%{regex:three}%{regex:four}%{regex:five}%{regex:six}%{regex:seven}" != '1_1') {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 2.5'
- }
+ test_fail
}
# Checking capture groups are cleared out correctly when there are no matches
if (User-Name =~ /^.%{Tmp-String-0}/) {
if ("%{0}%{regex:one}%{regex:two}%{regex:three}%{regex:four}%{regex:five}%{regex:six}%{regex:seven}" != '1') {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 3.5'
- }
+ test_fail
}
# compiled - ref - named capture groups
if (User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
if ("%{regex:seven}_%{regex:six}_%{regex:five}_%{regex:four}_%{regex:three}_%{regex:two}_%{regex:one}_%{0}" != '7_6_5_4_3_2_1_1_2_3_4_5_6_7') {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 4.5'
- }
+ test_fail
}
# compiled - xlat - named capture groups
if ('1_2_3_4_5_6_7' =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
if ("%{regex:seven}_%{regex:six}_%{regex:five}_%{regex:four}_%{regex:three}_%{regex:two}_%{regex:one}_%{0}" != '7_6_5_4_3_2_1_1_2_3_4_5_6_7') {
- update reply {
- Filter-Id += 'Fail 5'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 5.5'
- }
+ test_fail
}
# compiled - ref - named capture groups (numeric indexes)
if (User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
if ("%{7}_%{6}_%{5}_%{4}_%{3}_%{2}_%{1}_%{0}" != '7_6_5_4_3_2_1_1_2_3_4_5_6_7') {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 4.5'
- }
+ test_fail
}
}
if (&Cisco-AVPair[*] =~ /bar=(.*)/) {
if ("%{1}" != 'baz') {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
}
else {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
success
}
if ("%{control:Tmp-Cast-IPv6Prefix}" != '::198.51.0.0/112') {
- update reply {
- Filter-Id += "Fail 0"
- }
+ test_fail
}
if ("%{control:Tmp-Cast-IPv4Prefix}" != '198.51.0.0/16') {
- update reply {
- Filter-Id += "Fail 1"
- }
+ test_fail
}
if (control:Tmp-Cast-IPv6Prefix != ::198.51.0.0/112) {
- update reply {
- Filter-Id += "Fail 2"
- }
+ test_fail
}
if (control:Tmp-Cast-IPv4Prefix != 198.51.0.0/16) {
- update reply {
- Filter-Id += "Fail 3"
- }
+ test_fail
}
if (!(&control:Tmp-Cast-IPv4Prefix < 198.0.0.0/8)) {
- update reply {
- Filter-Id += "Fail 4"
- }
+ test_fail
}
if (!(&control:Framed-IP-Address < 198.51.0.0/16)) {
- update reply {
- Filter-Id += "Fail 5"
- }
+ test_fail
}
success
}
if ("%{map:%{Tmp-String-0}}" != 1) {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
if (&control:Tmp-String-0 != 'testing123') {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
success
}
if (&Tmp-Integer-2 != 1) {
- update reply {
- Filter-Id += "Fail 3a - expected 1 got %{Tmp-Integer-2}"
- }
+ test_fail
return
}
if (&Tmp-Integer-3 != 1) {
- update reply {
- Filter-Id += "'Fail 3b - expected 1 got %{Tmp-Integer-3}"
- }
+ test_fail
return
}
if (&Tmp-Integer-4 != 1) {
- update reply {
- Filter-Id += "Fail 3c - expected 1 got %{Tmp-Integer-4}"
- }
+ test_fail
return
}
if (&Tmp-Integer-5 != 1) {
- update reply {
- Filter-Id += "Fail 3d - expected 1 got %{Tmp-Integer-5}"
- }
+ test_fail
return
}
#
switch &Service-Type {
case "%{expr: 1 + 2}" {
- update reply {
- Filter-Id := "3"
- }
+ test_fail
}
case Login-User {
- update reply {
- Filter-Id := "Login-User"
- }
+ test_fail
}
case No-Such-Value { # ERROR
- update reply {
- Filter-Id := "FAILED"
- }
+ test_fail
}
case {
- update reply {
- Filter-Id := "default"
- }
+ test_fail
}
}
#
switch "%{Service-Type}" {
case "%{expr: 1 + 2}" {
- update reply {
- Filter-Id := "3"
- }
+ test_fail
}
case Login-User {
- update reply {
- Filter-Id := "Login-User"
- }
+ test_fail
}
case No-Such-Value { # ERROR
- update reply {
- Filter-Id := "FAILED"
- }
+ test_fail
}
case {
- update reply {
- Filter-Id := "default"
- }
+ test_fail
}
}
}
if (Tmp-Integer-0 != 4084) {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
# Octets are expanded to 8168 hexits
if ("%{Tmp-Octets-0}" !~ /^0x([0-9a-f]+)$/) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
update request {
}
if ("%{length:Tmp-String-0}" != 8168) {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
# We can't do any more until all the xlat code uses dynamically allocated buffers
}
if (&Attr-26.24757.84.9.5.7 != 0xab) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
#
}
if (&Attr-26.24757.84.9.5.15 != 0xabcdef) {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
#
# get automatically resolved to the real attribute.
#
if (&Attr-26.11344.1 == 127.0.0.1) {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
if (&Attr-26.11344.1 != 127.0.0.2) {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
update request {
}
if (&FreeRADIUS-Proxied-To == 127.0.0.2) {
- update reply {
- Filter-Id += 'Fail 5'
- }
+ test_fail
}
if (&FreeRADIUS-Proxied-To != 127.0.0.1) {
- update reply {
- Filter-Id += 'Fail 6'
- }
+ test_fail
}
if (&Attr-26.11344.1 == 127.0.0.2) {
- update reply {
- Filter-Id += 'Fail 7'
- }
+ test_fail
}
if (&Attr-26.11344.1 != 127.0.0.1) {
- update reply {
- Filter-Id += 'Fail 8'
- }
+ test_fail
}
update request {
}
if (&Attr-26.66.1 != 0x01020304) {
- update reply {
- Filter-Id += 'Fail 9'
- }
+ test_fail
}
success
}
if (Tmp-String-0 != 'bob') {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
update {
}
if (Tmp-String-0 != '0x626f62') {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
success
}
if ((&control:Reply-Message[0] != 'a') || (&control:Reply-Message[1] != 'b') || (&control:Reply-Message[2] != 'c')) {
- update {
- reply:Filter-Id := 'Fail 0'
- }
+ test_fail
}
# Overwrite a specific index, and check the value here is replaced
}
if ((&control:Reply-Message[0] != 'a') || (&control:Reply-Message[1] != 'd') || (&control:Reply-Message[2] != 'c')) {
- update {
- reply:Filter-Id := 'Fail 1'
- }
+ test_fail
}
# Check isolation...
}
if ((&control:Reply-Message[0] != 'a') || (&control:Reply-Message[1] != 'd') || (&control:Reply-Message[2] != 'c')) {
- update {
- reply:Filter-Id := 'Fail 2'
- }
+ test_fail
}
# Verify we haven't acquired any extra..
if ("%{control:Reply-Message[#]}" != 3) {
- update {
- reply:Filter-Id := 'Fail 3'
- }
+ test_fail
}
success
}
if (&Tmp-String-1 != 'hello') {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
if (&Tmp-String-0 == 'hello') {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
if (0) { # XXX
}
if (&Vendor-66-Attr-1 != 0x01020304) {
- update reply {
- Filter-Id += 'Fail 1a'
- }
+ test_fail
}
#
}
if (&FreeRADIUS-Proxied-To != 127.0.0.1) {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
update {
}
if (&Tmp-String-1 != 'hello2') {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
} # XXX
if (<string>"%{urlquote:%{request:Tmp-String-0}}" != &Tmp-String-0) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
if (<string>"%{urlquote:%{request:Tmp-String-1}}" != &Tmp-String-3) {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
if (<string>"%{urlquote:%{request:Tmp-String-2}}" != &Tmp-String-4) {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
if (<string>"%{urlunquote:%{request:Tmp-String-0}}" != &Tmp-String-0) {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
if (<string>"%{urlunquote:%{request:Tmp-String-3}}" != &Tmp-String-1) {
- update reply {
- Filter-Id += 'Fail 5'
- }
+ test_fail
}
if (<string>"%{urlunquote:%{request:Tmp-String-4}}" != &Tmp-String-2) {
- update reply {
- Filter-Id += 'Fail 6'
- }
+ test_fail
}
success
}
if ("%{attr:&FreeRADIUS-Proxied-To}" != 'FreeRADIUS-Proxied-To') {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
if ("%{attr_num:&FreeRADIUS-Proxied-To}" != 1) {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
if ("%{vendor:&FreeRADIUS-Proxied-To}" != 'FreeRADIUS') {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
if ("%{vendor_num:&FreeRADIUS-Proxied-To}" != 11344) {
- update reply {
- Filter-Id += 'Fail 4'
- }
+ test_fail
}
if ("%{attr:&Reply-Message}" != 'Reply-Message') {
- update reply {
- Filter-Id += 'Fail 5'
- }
+ test_fail
}
if ("%{attr_num:&Reply-Message}" != 18) {
- update reply {
- Filter-Id += 'Fail 6'
- }
+ test_fail
}
if ("%{vendor:&Reply-Message}" != '') {
- update reply {
- Filter-Id += 'Fail 7'
- }
+ test_fail
}
if ("%{vendor_num:&Reply-Message}" != 0) {
- update reply {
- Filter-Id += 'Fail 8'
- }
+ test_fail
}
success
}
if ("%{explode:&Class |}" != 3) {
- update reply {
- Filter-Id += 'Fail 0'
- }
+ test_fail
}
if ("%{Class[#]}" != 3) {
- update reply {
- Filter-Id += 'Fail 1'
- }
+ test_fail
}
if ((&Class[0] != '1=1') || (&Class[1] != 'my_attr=2') || (&Class[2] != 'my_attr=hello')) {
- update reply {
- Filter-Id += 'Fail 2'
- }
+ test_fail
}
if (&Class[3]) {
- update reply {
- Filter-Id += 'Fail 3'
- }
+ test_fail
}
if ("%{explode:&control:Calling-Station-Id |}" != 0) {
}
if ("%{explode:&control:User-Name[*] |}" != 5) {
- update reply {
- Filter-Id += 'Fail 5'
- }
+ test_fail
}
if ("%{control:User-Name[#]}" != 5) {
- update reply {
- Filter-Id += 'Fail 6'
- }
+ test_fail
}
if ((&control:User-Name[0] != 'hello') || \
(&control:User-Name[2] != 'morning') || \
(&control:User-Name[3] != 'night') || \
(&control:User-Name[4] != '1')) {
- update reply {
- Filter-Id += 'Fail 7'
- }
+ test_fail
}
if (&control:User-Name[5]) {
- update reply {
- Filter-Id += 'Fail 8'
- }
+ test_fail
}
if ("%{explode:&control:Reply-Message |}" != 0) {
- update reply {
- Filter-Id += 'Fail 9'
- }
+ test_fail
}
if ("%{control:Reply-Message[#]}" != 1) {
- update reply {
- Filter-Id += 'Fail 10'
- }
+ test_fail
}
if (&control:Reply-Message != 'Can\'t touch this') {
- update reply {
- Filter-Id += 'Fail 11'
- }
+ test_fail
}
debug_all
test_fail
}
-if (("%{control:[n]}" != 192.0.2.2)) {
- test_fail
-}
+#if (("%{control:[n]}" != 192.0.2.2)) {
+# test_fail
+#}
if ("%{control:[*]}" != '192.0.2.1,192.0.2.2') {
test_fail