Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lemonldap-ng
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
206
Issues
206
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
69a43172
Commit
69a43172
authored
Dec 29, 2018
by
Christophe Maudoux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unit test (
#1603
)
parent
3496d898
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
lemonldap-ng-manager/t/15-combination.t
lemonldap-ng-manager/t/15-combination.t
+5
-1
lemonldap-ng-manager/t/test-lib.pm
lemonldap-ng-manager/t/test-lib.pm
+28
-0
No files found.
lemonldap-ng-manager/t/15-combination.t
View file @
69a43172
...
...
@@ -18,7 +18,7 @@ ok( $res = &client->_post( '/confs/', 'cfgNum=1', &body, 'application/json' ),
"
Request succeed
"
);
ok
(
$res
->
[
0
]
==
200
,
"
Result code is 200
"
);
ok
(
$resBody
=
from_json
(
$res
->
[
2
]
->
[
0
]
),
"
Result body contains JSON text
"
);
ok
(
$resBody
->
{
result
}
==
0
,
"
JSON response contains
\"
result:0
\"
"
)
ok
(
$resBody
->
{
result
}
==
1
,
"
JSON response contains
\"
result:1
\"
"
)
or
print
STDERR
Dumper
(
$res
);
ok
(
$res
=
&
client
->
_get
(
'
/confs/2/combModules
',
'
application/json
'
),
...
...
@@ -37,4 +37,8 @@ count(9);
done_testing
(
count
()
);
unlink
'
t/conf/lmConf-2.json
';
unlink
'
t/sessions/*
';
`
rm t/sessions/*
`;
\ No newline at end of file
lemonldap-ng-manager/t/test-lib.pm
View file @
69a43172
...
...
@@ -25,4 +25,32 @@ sub count {
return
$count
;
}
sub
clean_sessions
{
opendir
D
,
'
t/sessions
'
or
die
$!
;
foreach
(
grep
{
/^[^\.]/
}
readdir
(
D
)
)
{
unlink
"
t/sessions/
$_
",
"
t/sessions/lock/Apache-Session-
$_
.lock
";
}
foreach
my
$dir
(
qw(t/sessions/lock t/sessions/saml/lock t/sessions/saml)
)
{
if
(
-
d
$dir
)
{
opendir
D
,
$dir
or
die
$!
;
foreach
(
grep
{
/^[^\.]/
}
readdir
(
D
)
)
{
unlink
"
$dir
/
$_
";
}
}
}
my
$cache
=
getCache
();
$cache
->
clear
;
}
sub
getCache
{
require
Cache::
FileCache
;
return
Cache::
FileCache
->
new
(
{
namespace
=>
'
lemonldap-ng-session
',
cache_root
=>
'
t/
',
cache_depth
=>
0
,
}
);
}
1
;
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