Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Access Check - Account manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Access Check - Account manager
Commits
99b88a5d
Commit
99b88a5d
authored
6 years ago
by
Guillaume ROUSSE
Browse files
Options
Downloads
Patches
Plain Diff
test update
- fix expected results - generate configuration file on-the-fly
parent
d816e940
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile.am
+0
-1
0 additions, 1 deletion
Makefile.am
t/cgi.t
+76
-28
76 additions, 28 deletions
t/cgi.t
t/manager.conf
+0
-23
0 additions, 23 deletions
t/manager.conf
with
76 additions
and
52 deletions
Makefile.am
+
0
−
1
View file @
99b88a5d
...
...
@@ -17,5 +17,4 @@ EXTRA_DIST = \
README.md
\
CHANGES.md
\
t/edugain.xml
\
t/manager.conf
\
$(
TESTS
)
This diff is collapsed.
Click to expand it.
t/cgi.t
+
76
−
28
View file @
99b88a5d
...
...
@@ -8,18 +8,44 @@ use File::Temp;
use
IPC::
Run
qw(run)
;
use
Test::
More
;
plan
tests
=>
4
;
plan
tests
=>
5
;
$ENV
{
ACCOUNTMANAGER_CONFIG
}
=
'
t/manager.conf
';
my
$log
=
File::
Temp
->
new
(
UNLINK
=>
$ENV
{
TEST_DEBUG
}
?
0
:
1
);
diag
("
log file:
$log
")
if
$ENV
{
TEST_DEBUG
};
my
$has_database
=
$ENV
{
TEST_DB_TYPE
}
&&
$ENV
{
TEST_DB_HOST
}
&&
$ENV
{
TEST_DB_NAME
}
&&
$ENV
{
TEST_DB_USER
}
&&
$ENV
{
TEST_DB_PASSWORD
};
my
$config
=
File::
Temp
->
new
(
UNLINK
=>
$ENV
{
TEST_DEBUG
}
?
0
:
1
);
print
{
$config
}
<<EOF;
[setup]
templates_dir = templates
subtest
start_page
=>
sub
{
[federations]
edugain = t/edugain.xml
[app]
url = https://my.fqdn/accountmanager
support_email = support\@my.fqdn
[logger]
file = $log
level = debug
[mailer]
[idp]
[database]
type = mysql
host = localhost
name = account_manager
username = user
password = password
EOF
$config
->
flush
();
diag
("
test configuration:
$config
")
if
$ENV
{
TEST_DEBUG
};
$ENV
{
ACCOUNTMANAGER_CONFIG
}
=
$config
;
subtest
"
index page
"
=>
sub
{
plan
tests
=>
4
;
...
...
@@ -27,10 +53,9 @@ subtest start_page => sub {
local
$ENV
{
QUERY_STRING
}
=
'';
my
(
$out
,
$err
,
$rc
)
=
run_executable
('
access-check-manager.cgi
');
diag
(
$out
)
if
$ENV
{
TEST_DEBUG
};
like
(
$out
,
qr{^Content-Type: text/html; charset=utf8\r\n\r\n}
,
qr{^Content-Type: text/html; charset=utf8\r\n\r\n}
m
,
'HTTP headers'
);
like(
...
...
@@ -40,24 +65,49 @@ subtest start_page => sub {
);
like
(
$out
,
qr{<a href="\?action=s
elect_sp
" class="button">Get started</a>}
,
qr{<a href="\?action=s
tart
" class="button">Get started</a>}
,
'
start button
'
);
is
(
$err
,
'',
'
empty stderr
');
};
subtest
sp_selection_page
=>
sub
{
subtest
"
SP selection page, implicit federation selection
"
=>
sub
{
plan
tests
=>
4
;
local
$ENV
{
REQUEST_METHOD
}
=
'
GET
';
local
$ENV
{
QUERY_STRING
}
=
'
action=start
';
my
(
$out
,
$err
,
$rc
)
=
run_executable
('
access-check-manager.cgi
');
like
(
$out
,
qr{^Content-Type: text/html; charset=utf8\r\n\r\n}
m,
'HTTP headers'
);
like(
$out,
qr{<title>eduGAIN Access Check</title>}
,
'
page title
'
);
like
(
$out
,
qr{<select id="entityid" name="entityid" class="required">}
,
'
page content contains SP list
'
);
is
(
$err
,
'',
'
empty stderr
');
};
subtest
"
SP selection page, explicit federation selection
"
=>
sub
{
plan
tests
=>
4
;
local
$ENV
{
REQUEST_METHOD
}
=
'
GET
';
local
$ENV
{
QUERY_STRING
}
=
'
action=select_sp
';
local
$ENV
{
QUERY_STRING
}
=
'
action=select_sp
&federation=edugain
';
my
(
$out
,
$err
,
$rc
)
=
run_executable
('
access-check-manager.cgi
');
diag
(
$out
)
if
$ENV
{
TEST_DEBUG
};
like
(
$out
,
qr{^Content-Type: text/html; charset=utf8\r\n\r\n}
,
qr{^Content-Type: text/html; charset=utf8\r\n\r\n}
m
,
'HTTP headers'
);
like(
...
...
@@ -73,24 +123,23 @@ subtest sp_selection_page => sub {
is
(
$err
,
'',
'
empty stderr
');
};
subtest
email
_
selection
_
page
_
missing
_
parameter
=>
sub
{
subtest
"
email
selection
page
,
missing
entityid
parameter
"
=>
sub
{
plan
tests
=>
4
;
local
$ENV
{
REQUEST_METHOD
}
=
'
GET
';
local
$ENV
{
QUERY_STRING
}
=
'
action=select_email
';
local
$ENV
{
QUERY_STRING
}
=
'
action=select_email
&federation=edugain
';
my
(
$out
,
$err
,
$rc
)
=
run_executable
('
access-check-manager.cgi
');
diag
(
$out
)
if
$ENV
{
TEST_DEBUG
};
like
(
$out
,
qr{^Content-Type: text/html; charset=utf8\r\n\r\n}
,
qr{^Content-Type: text/html; charset=utf8\r\n\r\n}
m
,
'HTTP headers'
);
un
like
(
like(
$out,
qr{<title>eduGAIN Access Check</title>}
,
'
no
page title
'
'
page title
'
);
like
(
$out
,
...
...
@@ -100,24 +149,23 @@ subtest email_selection_page_missing_parameter => sub {
is
(
$err
,
'',
'
empty stderr
');
};
subtest
email
_
selection
_
page
_wrong_
parameter
=>
sub
{
subtest
"
email
selection
page
, invalid entityid
parameter
"
=>
sub
{
plan
tests
=>
4
;
local
$ENV
{
REQUEST_METHOD
}
=
'
GET
';
local
$ENV
{
QUERY_STRING
}
=
'
action=select_email&entityid=foo
';
local
$ENV
{
QUERY_STRING
}
=
'
action=select_email&
federation=edugain&
entityid=foo
';
my
(
$out
,
$err
,
$rc
)
=
run_executable
('
access-check-manager.cgi
');
diag
(
$out
)
if
$ENV
{
TEST_DEBUG
};
like
(
$out
,
qr{^Content-Type: text/html; charset=utf8\r\n\r\n}
,
qr{^Content-Type: text/html; charset=utf8\r\n\r\n}
m
,
'HTTP headers'
);
un
like
(
like(
$out,
qr{<title>eduGAIN Access Check</title>}
,
'
no
page title
'
'
page title
'
);
like
(
$out
,
...
...
This diff is collapsed.
Click to expand it.
t/manager.conf
deleted
100755 → 0
+
0
−
23
View file @
d816e940
[
setup
]
templates_dir
=
templates
federation_metadata_file
=
t
/
edugain
.
xml
[
app
]
url
=
https
://
my
.
fqdn
/
accountmanager
support_email
=
support
@
my
.
fqdn
[
logger
]
file
= /
dev
/
null
level
=
debug
[
mailer
]
sendmail_path
= /
bin
/
true
[
database
]
type
=
mysql
host
=
localhost
name
=
account_manager
user
=
user
password
=
password
[
idp
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment