mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #407: Fixes tests for Users. Groups are added in allocate
This commit is contained in:
parent
3a9a535518
commit
60294c229b
@ -193,9 +193,7 @@ protected:
|
||||
PoolObjectSQL(id,_username,-1,_gid,table),
|
||||
ObjectCollection("GROUPS"),
|
||||
password(_password), enabled(_enabled)
|
||||
{
|
||||
add_collection_id(_gid); //Adds the primary group to the collection
|
||||
};
|
||||
{ };
|
||||
|
||||
virtual ~User(){};
|
||||
|
||||
|
@ -145,6 +145,8 @@ int UserPool::allocate (
|
||||
// Build a new User object
|
||||
user = new User(-1, gid, username, password, enabled);
|
||||
|
||||
user->add_collection_id(gid); //Adds the primary group to the collection
|
||||
|
||||
// Insert the Object in the pool
|
||||
*oid = PoolSQL::allocate(user, error_str);
|
||||
|
||||
|
@ -198,13 +198,13 @@ public:
|
||||
CPPUNIT_ASSERT( oid == 0 );
|
||||
|
||||
session = "one_user_test:wrong_password";
|
||||
oid = user_pool->authenticate( session, oid, gid );
|
||||
rc = user_pool->authenticate( session, oid, gid );
|
||||
CPPUNIT_ASSERT( rc == false );
|
||||
CPPUNIT_ASSERT( oid == -1 );
|
||||
CPPUNIT_ASSERT( gid == -1 );
|
||||
|
||||
session = "unknown_user:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8";
|
||||
oid = user_pool->authenticate( session, oid, gid );
|
||||
rc = user_pool->authenticate( session, oid, gid );
|
||||
CPPUNIT_ASSERT( rc == false );
|
||||
CPPUNIT_ASSERT( oid == -1 );
|
||||
CPPUNIT_ASSERT( gid == -1 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user