Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
smradius
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smradius
smradius
Commits
0be68221
Commit
0be68221
authored
Oct 08, 2016
by
Nigel Kukard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: Better authentication test to test blank and default realm
parent
196bb8f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
t/200-dbtests.t
t/200-dbtests.t
+39
-2
No files found.
t/200-dbtests.t
View file @
0be68221
...
...
@@ -157,6 +157,7 @@ if ($child = fork()) {
$client1_ID
,'
SMRadius-Config-Secret
','
:=
','
secret123
'
);
# Blank realm
my
$realm1_ID
=
testDBInsert
("
Create realm ''
",
"
INSERT INTO realms (Name,Disabled) VALUES ('',0)
"
);
...
...
@@ -168,7 +169,7 @@ if ($child = fork()) {
#
# Check we get an Access-Accept for a bare user
# Check we get an Access-Accept for a bare user
using a blank realm
#
my
$user1_ID
=
testDBInsert
("
Create user 'testuser1'
",
...
...
@@ -189,7 +190,43 @@ if ($child = fork()) {
'
User-Password=test123
',
);
is
(
ref
(
$res
),"
HASH
","
smradclient should return a HASH
");
is
(
$res
->
{'
response
'}
->
{'
code
'},"
Access-Accept
","
Check our return is 'Access-Accept' for bare user
");
is
(
$res
->
{'
response
'}
->
{'
code
'},"
Access-Accept
","
Check our return is 'Access-Accept' for bare user blank '' realm
");
#
# Modify data for the default realm
#
testDBDelete
("
Delete blank realm '' link to client
",
"
DELETE FROM clients_to_realms WHERE ID = ?
",
$clientTOrealm1_ID
);
testDBDelete
("
Delete blank realm '' for realm '<DEFAULT>' test
",
"
DELETE FROM realms WHERE ID = ?
",
$realm1_ID
);
my
$realm1b_ID
=
testDBInsert
("
Create default realm '<DEFAULT>'
",
"
INSERT INTO realms (Name,Disabled) VALUES ('<DEFAULT>',0)
"
);
my
$clientTOrealm1b_ID
=
testDBInsert
("
Link client 'localhost' to realm '<DEFAULT>'
",
"
INSERT INTO clients_to_realms (ClientID,RealmID,Disabled) VALUES (?,?,0)
",
$client1_ID
,
$realm1b_ID
);
#
# Check we get an Access-Accept for a bare user using the default realm
#
$res
=
smradius::
client
->
run
(
"
--raddb
","
dicts
",
"
127.0.0.1
",
"
auth
",
"
secret123
",
'
User-Name=testuser1
',
'
User-Password=test123
',
);
is
(
ref
(
$res
),"
HASH
","
smradclient should return a HASH
");
is
(
$res
->
{'
response
'}
->
{'
code
'},"
Access-Accept
","
Check our return is 'Access-Accept' for bare user on <DEFAULT> realm
");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment