Unit test for #2351

v2.11
Maxime Besson 4 years ago
parent 48b96dbaae
commit f221a5bdfb
  1. 29
      lemonldap-ng-common/t/60-Session-Cli.t

@ -87,6 +87,22 @@ Lemonldap::NG::Common::Session->new( {
}
}
);
Lemonldap::NG::Common::Session->new( {
@sessionsOpts,
id => "1234",
info => {
"uid" => "foo",
}
}
);
Lemonldap::NG::Common::Session->new( {
@sessionsOpts,
id => "1235",
info => {
"uid" => "foo",
}
}
);
Lemonldap::NG::Common::Session->new( {
@psessionsOpts,
@ -194,7 +210,7 @@ is(
# Test search
$res = getJson( "search", {} );
is( @{$res}, 3, "Found 3 sessions" );
is( @{$res}, 5, "Found 5 sessions" );
# Test search with different backend
$res = getJson( "search", { backend => 'persistent' } );
@ -237,6 +253,17 @@ $res = getJson(
);
is( @{$res}, 0, "Session was removed" );
# We should have 2 foo sessions now
$res = getJson( "search", { where => "uid=foo" } );
is( @{$res}, 2, "Found 2 foo sessions" );
# Test delete by filter, remove two foo sessions
$cli->run( 'delete', { where => "uid=foo" } );
# We should have no foo sessions left
$res = getJson( "search", { where => "uid=foo" } );
is( @{$res}, 0, "Found 0 foo sessions" );
# Set key
$cli->run( "setKey", {}, "f90f597566f5cce47d9641377776c0c2",

Loading…
Cancel
Save