1
0
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:
Ruben S. Montero 2011-06-09 12:05:46 +02:00
parent 3a9a535518
commit 60294c229b
3 changed files with 5 additions and 5 deletions

View File

@ -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(){};

View File

@ -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);

View File

@ -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 );