You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2013/07/17 15:58:18 UTC

[4/4] git commit: updated refs/heads/master to 22cb5be

CLOUDSTACK-3592: Fix project email reference.

Emails belong to user's within accounts. Refer to the first user within
the account and use his email for account invites.

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/22cb5be8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/22cb5be8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/22cb5be8

Branch: refs/heads/master
Commit: 22cb5be8b6e38fb9e27f86e264c6438e10192311
Parents: 234db05
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Wed Jul 17 19:22:58 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Wed Jul 17 19:26:21 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_projects.py | 28 ++++++++++++++----------
 1 file changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/22cb5be8/test/integration/component/test_projects.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py
index 5f37f96..39e9bee 100644
--- a/test/integration/component/test_projects.py
+++ b/test/integration/component/test_projects.py
@@ -170,8 +170,7 @@ class TestMultipleProjectCreation(cloudstackTestCase):
 
     @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
     def test_01_create_multiple_projects_by_account(self):
-        """ Verify an account can own multiple projects and can belong to
-            multiple projects
+        """ Verify an account can own multiple projects and can belong to multiple projects
         """
         # Validate the following
         # 1. Create multiple project. Verify at step 1 An account is allowed
@@ -245,22 +244,27 @@ class TestMultipleProjectCreation(cloudstackTestCase):
                         "Check list project response returns a valid project"
                         )
 
+        self.assert_(isinstance(self.user.user, list))
+        self.assert_(len(self.user.user) > 0, msg="Account %s has no users" % self.user.name)
+        self.debug("Adding account %s to project with email %s" % (self.user.name, self.user.user[0].email))
+        email = self.user.user[0].email
+
         # Add user to the project
         project_1.addAccount(
                            self.apiclient,
                            self.user.name,
-                           self.user.email
+                           email
                            )
 
         # listProjectAccount to verify the user is added to project or not
-        accounts_reponse = Project.listAccounts(
+        accounts_response = Project.listAccounts(
                                             self.apiclient,
                                             projectid=project_1.id,
                                             account=self.user.name,
                                             )
-        self.debug(accounts_reponse)
+        self.debug(accounts_response)
         self.assertEqual(
-                            isinstance(accounts_reponse, list),
+                            isinstance(accounts_response, list),
                             True,
                             "Check for a valid list accounts response"
                             )
@@ -270,7 +274,7 @@ class TestMultipleProjectCreation(cloudstackTestCase):
                     0,
                     "Check list project response returns a valid project"
                     )
-        account = accounts_reponse[0]
+        account = accounts_response[0]
 
         self.assertEqual(
                             account.role,
@@ -281,18 +285,18 @@ class TestMultipleProjectCreation(cloudstackTestCase):
         project_2.addAccount(
                            self.apiclient,
                            self.user.name,
-                           self.user.email
+                           email
                            )
 
         # listProjectAccount to verify the user is added to project or not
-        accounts_reponse = Project.listAccounts(
+        accounts_response = Project.listAccounts(
                                             self.apiclient,
                                             projectid=project_2.id,
                                             account=self.user.name,
                                             )
-        self.debug(accounts_reponse)
+        self.debug(accounts_response)
         self.assertEqual(
-                            isinstance(accounts_reponse, list),
+                            isinstance(accounts_response, list),
                             True,
                             "Check for a valid list accounts response"
                             )
@@ -302,7 +306,7 @@ class TestMultipleProjectCreation(cloudstackTestCase):
                     0,
                     "Check list project response returns a valid project"
                     )
-        account = accounts_reponse[0]
+        account = accounts_response[0]
 
         self.assertEqual(
                             account.role,