diff --git a/src/vm/test/VirtualMachinePoolTest.cc b/src/vm/test/VirtualMachinePoolTest.cc index d87f1104ae..9c4bcf27bb 100644 --- a/src/vm/test/VirtualMachinePoolTest.cc +++ b/src/vm/test/VirtualMachinePoolTest.cc @@ -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; diff --git a/src/vm/test/one_auth b/src/vm/test/one_auth new file mode 100644 index 0000000000..2f55c9c47b --- /dev/null +++ b/src/vm/test/one_auth @@ -0,0 +1 @@ +one_user_test:password