Skip to content

Commit

Permalink
Re-enable testing of nested attributes from Perl
Browse files Browse the repository at this point in the history
  • Loading branch information
ndptech committed Sep 23, 2024
1 parent ba9d4c2 commit 8e0c6d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/tests/modules/perl/auth.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ if (!ok) {
test_fail
}

# TODO: Re-enable when nested attributes are handled
#if !(&reply.Vendor-Specific.Cisco.h323-credit-amount == 100) {
# test_fail
#}
if (&reply.Vendor-Specific.Cisco.h323-credit-amount != 100) {
test_fail
}
if (&reply.Filter-Id != 'Hello 127.0.0.1 172.16.1.1') {
test_fail
}
Expand All @@ -41,7 +40,7 @@ if (&control.NAS-Identifier) {
test_fail
}

&reply -= &Vendor-Specific.Cisco.h323-credit-amount[*]
&reply -= &Vendor-Specific[*]
&reply -= &Filter-Id[*]

test_pass
5 changes: 2 additions & 3 deletions src/tests/modules/perl/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ sub authenticate {
# Accept user and set some attribute
if (&radiusd::xlat("%client(group)") eq 'UltraAllInclusive') {
# User called from NAS with unlim plan set, set higher limits
# TODO - re-enabled when nested attributes are handled
# $RAD_REPLY{'Vendor-Specific.Cisco.h323-credit-amount'} = "1000000";
$RAD_REPLY{'Vendor-Specific'}{'Cisco'}{'h323-credit-amount'} = "1000000";
$RAD_REPLY{'Filter-Id'} = 'Everything'
} else {
# Check we received two values for Cisco.AVPair
Expand All @@ -84,7 +83,7 @@ sub authenticate {
if ($RAD_REQUEST{'Class'} ne 'abcdef') {
return RLM_MODULE_REJECT;
}
# $RAD_REPLY{'Vendor-Specific.Cisco.h323-credit-amount'} = "100";
$RAD_REPLY{'Vendor-Specific'}{'Cisco'}{'h323-credit-amount'} = "100";
$RAD_REPLY{'Filter-Id'} = 'Hello '.$RAD_REQUEST{'Net'}{'Src'}{'IP'}.' '.$RAD_REQUEST{'Vendor-Specific'}{'3GPP2'}{'Remote-IP'}[1]{'Address'};
$RAD_REQUEST{'User-Name'} = 'tim';
$RAD_CONFIG{'NAS-Identifier'} = 'dummy';
Expand Down

0 comments on commit 8e0c6d7

Please sign in to comment.