From 18fbbcfc5a3bea98576cc819a37b00b227616cae Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Mon, 22 Jul 2013 19:13:11 +0530 Subject: [PATCH] CLOUDSTACK-3610: Fix regression test "test_accounts.TestUserLogin" Now password is sent as clear text as per CLOUDSTACK-1734 So changed marvin to handle this. Plus domainid was not passed in the testcase and marvin used "domainid" instead of "domainId" as a parameter. Fixed these two errors. Signed-off-by: Prasanna Santhanam (cherry picked from commit dba09791fc99c342974d8ca1c69609c04f1a5512) --- test/integration/component/test_accounts.py | 5 ++--- tools/marvin/marvin/integration/lib/base.py | 12 +++--------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index b5861766f5e..3c284bd0fcd 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -1559,9 +1559,8 @@ class TestUserLogin(cloudstackTestCase): respose = User.login( self.apiclient, username=self.account.name, - password=self.services["account"]["password"] - ) - self.assertEqual(respose, None, "Login response should not be none") + password=self.services["account"]["password"], + domainid=domain.id) self.debug("Login API response: %s" % respose) self.assertNotEqual( diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py index 00dc506f1b1..6e49ae5e70a 100755 --- a/tools/marvin/marvin/integration/lib/base.py +++ b/tools/marvin/marvin/integration/lib/base.py @@ -148,10 +148,7 @@ class User: if "userUUID" in services: cmd.userid = "-".join([services["userUUID"],random_gen()]) - # Password Encoding - mdf = hashlib.md5() - mdf.update(services["password"]) - cmd.password = mdf.hexdigest() + cmd.password = services["password"] cmd.username = "-".join([services["username"], random_gen()]) user = apiclient.createUser(cmd) @@ -201,14 +198,11 @@ class User: cmd = login.loginCmd() cmd.username = username - # MD5 hashcoded password - mdf = hashlib.md5() - mdf.update(password) - cmd.password = mdf.hexdigest() + cmd.password = password if domain: cmd.domain = domain if domainid: - cmd.domainid = domainid + cmd.domainId = domainid return apiclient.login(cmd)