1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

feature #192: VM tests don't need one_auth

This commit is contained in:
Carlos Martin 2010-04-30 12:52:52 +02:00 committed by Constantino Vázquez Blanco
parent 3f9611e0ed
commit b2a8d1afc5
2 changed files with 13 additions and 2 deletions

View File

@ -146,9 +146,19 @@ protected:
CPPUNIT_ASSERT( ((VirtualMachine*)obj)->get_name() == names[index] );
CPPUNIT_ASSERT( xml_str == xmls[index]);
};
void set_up_user_pool()
void set_up_user_pool()
{
// The UserPool constructor checks if the DB contains at least
// one user, and adds one automatically from the ONE_AUTH file.
// So the ONE_AUTH environment is forced to point to a test one_auth
// file.
ostringstream oss;
oss << getenv("PWD") << "/one_auth";
setenv("ONE_AUTH", oss.str().c_str(), 1);
UserPool::bootstrap(db);
UserPool * user_pool = new UserPool(db);
int uid_1, uid_2;

1
src/vm/test/one_auth Normal file
View File

@ -0,0 +1 @@
one_user_test:password