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

bug #847 - #913: Fixes AuthManager tests

This commit is contained in:
Ruben S. Montero 2011-10-13 18:55:04 +02:00
parent 07321ac3d3
commit 07c8236945
2 changed files with 11 additions and 9 deletions

View File

@ -148,7 +148,7 @@ public:
{
AuthRequest ar(2, 2);
ar.add_authenticate("timeout","the_pass","the_secret");
ar.add_authenticate("test","timeout","the_pass","the_secret");
am->trigger(AuthManager::AUTHENTICATE,&ar);
@ -164,7 +164,7 @@ public:
{
AuthRequest ar(2, 2);
ar.add_authenticate("the_user","the_pass","the_secret");
ar.add_authenticate("test","the_user","the_pass","the_secret");
am->trigger(AuthManager::AUTHENTICATE,&ar);
ar.wait();
@ -326,10 +326,10 @@ public:
AuthRequest ar(2, 2);
AuthRequest ar1(2,2);
ar.add_authenticate("the_user","the_pass","the_secret");
ar.add_authenticate("core","the_user","the_pass","the_secret");
CPPUNIT_ASSERT(ar.core_authenticate() == false);
ar1.add_authenticate("the_user","the_pass","the_pass");
ar1.add_authenticate("core","the_user","e2e509d8358df1d5fa3bc825173f93904baa4906", "the_pass");
CPPUNIT_ASSERT(ar1.core_authenticate() == true);
}
};

View File

@ -16,12 +16,12 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
echo "MAD started" >> mad.log
echo "MAD started" 1>&2 >> mad.log
while read COMMAND ARG1 ARG2 ARG3 ARG4
while read COMMAND ARG1 ARG2 ARG3 ARG4 ARG5
do
echo "$COMMAND $ARG1 $ARG2 $ARG3 $ARG4" >> mad.log
echo "$COMMAND $ARG1 $ARG2 $ARG3 $ARG4 $ARG5" 1>&2 >> mad.log
case $COMMAND in
"INIT")
echo "INIT SUCCESS"
@ -31,12 +31,14 @@ do
exit 0
;;
"AUTHORIZE")
echo "AUTHORIZE FAILURE $ARG1 $ARG3 $ARG4"
echo "AUTHORIZE FAILURE $ARG1 $ARG3 $ARG4 $ARG5"
;;
"AUTHENTICATE")
if [ "$ARG3" = "timeout" ] ; then
date 1>&2 >> mad.log
if [ "$ARG4" = "timeout" ] ; then
sleep 4
fi
date 1>&2 >> mad.log
echo "AUTHENTICATE SUCCESS $ARG1"
;;