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/18 11:36:45 UTC

[1/5] git commit: updated refs/heads/4.2 to f2d9a7b

Updated Branches:
  refs/heads/4.2 8cd3a9725 -> f2d9a7b65


CLOUDSTACK-3618: When project account does not exist, API now throws exception

API call listprojectaccounts failed, and test case
test_projects.py:test_08_cleanup_after_project_delete failed due to
this

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/52fa8532
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/52fa8532
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/52fa8532

Branch: refs/heads/4.2
Commit: 52fa8532bb2821f9b5472e713a905bc6b7f712b5
Parents: 8cd3a97
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Thu Jul 18 14:35:33 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 18 14:57:03 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_projects.py | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/52fa8532/test/integration/component/test_projects.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py
index 39e9bee..68964e8 100644
--- a/test/integration/component/test_projects.py
+++ b/test/integration/component/test_projects.py
@@ -1431,13 +1431,10 @@ class TestProjectResources(cloudstackTestCase):
                     "Resources (volume) should be deleted as part of cleanup"
                     )
 
-        accounts = Project.listAccounts(self.apiclient, projectid=project.id)
-
-        self.assertEqual(
-                         accounts,
-                         None,
-                         "Accounts should be un-assigned from project"
-                    )
+        # Accounts should be un-assigned from project,
+        # so this call will raise an exception: Unable to find the project id=
+        with self.assertRaises(Exception):
+            Project.listAccounts(self.apiclient, projectid=project.id)
         return
 
 


[2/5] git commit: updated refs/heads/4.2 to f2d9a7b

Posted by ts...@apache.org.
CLOUDSTACK-3619: Cleanup of volume is not required as gc takes care.

We don't need to delete the volume resource as part of cleanup as the
storage gc is expected to cleanup orphaned volumes in deleted
accounts/projects.

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/8bc3757e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8bc3757e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8bc3757e

Branch: refs/heads/4.2
Commit: 8bc3757e80d20575d1eeee530309ab61c02857d8
Parents: 52fa853
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Thu Jul 18 14:59:35 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 18 14:59:35 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_projects.py | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc3757e/test/integration/component/test_projects.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py
index 68964e8..510542a 100644
--- a/test/integration/component/test_projects.py
+++ b/test/integration/component/test_projects.py
@@ -1203,10 +1203,9 @@ class TestProjectResources(cloudstackTestCase):
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
 
-    @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"])
+    @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator", "needle"])
     def test_07_project_resources_account_delete(self):
-        """ Test Verify after an account is removed from the project, all his
-            resources stay with the project.
+        """ Test Verify after an account is removed from the project, all its resources stay with the project.
         """
         # Validate the following
         # 1. Create a project.
@@ -1261,13 +1260,13 @@ class TestProjectResources(cloudstackTestCase):
                            )
 
         # listProjectAccount to verify the user is added to project or not
-        accounts_reponse = Project.listAccounts(
+        accounts_response = Project.listAccounts(
                                         self.apiclient,
                                         projectid=project.id,
                                         account=self.user.name,
                                         )
         self.assertEqual(
-                            isinstance(accounts_reponse, list),
+                            isinstance(accounts_response, list),
                             True,
                             "Check for a valid list accounts response"
                             )
@@ -1277,7 +1276,7 @@ class TestProjectResources(cloudstackTestCase):
                     0,
                     "Check list project response returns a valid project"
                     )
-        account = accounts_reponse[0]
+        account = accounts_response[0]
 
         self.assertEqual(
                             account.role,
@@ -1292,9 +1291,8 @@ class TestProjectResources(cloudstackTestCase):
                                diskofferingid=self.disk_offering.id,
                                projectid=project.id
                                )
-        self.cleanup.append(volume)
 
-        # Delete the project user
+        # Delete the project user ie the account
         self.user.delete(self.apiclient)
 
         volumes = Volume.list(self.apiclient, id=volume.id)


[5/5] git commit: updated refs/heads/4.2 to f2d9a7b

Posted by ts...@apache.org.
CLOUDSTACK-3168: Change in try_ssh function

Signed-off-by: Prasanna Santhanam <ts...@apache.org>
(cherry picked from commit e25cbd66d2b13db684f2f339b05aafa6b119bcfe)


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

Branch: refs/heads/4.2
Commit: f2d9a7b659087e599494ca98f7cfed2721179c49
Parents: af9a8de
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue Jul 16 03:08:55 2013 -0400
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 18 15:06:33 2013 +0530

----------------------------------------------------------------------
 test/integration/smoke/test_loadbalance.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f2d9a7b6/test/integration/smoke/test_loadbalance.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_loadbalance.py b/test/integration/smoke/test_loadbalance.py
index 7bf560c..4e1f0c1 100644
--- a/test/integration/smoke/test_loadbalance.py
+++ b/test/integration/smoke/test_loadbalance.py
@@ -188,17 +188,17 @@ class TestLoadBalance(cloudstackTestCase):
         cleanup_resources(cls.api_client, cls._cleanup)
         return
 
-    def try_ssh(self, src_nat_ip_addr, hostnames):
+    def try_ssh(self, ip_addr, hostnames):
         try:
             self.debug(
                 "SSH into VM (IPaddress: %s) & NAT Rule (Public IP: %s)" %
-                (self.vm_1.ipaddress, src_nat_ip_addr.ipaddress)
+                (self.vm_1.ipaddress, ip_addr)
             )
            # If Round Robin Algorithm is chosen,
             # each ssh command should alternate between VMs
 
             ssh_1  = remoteSSHClient(
-                src_nat_ip_addr.ipaddress,
+                ip_addr,
                 self.services['lbrule']["publicport"],
                 self.vm_1.username,
                 self.vm_1.password
@@ -207,7 +207,7 @@ class TestLoadBalance(cloudstackTestCase):
             self.debug(hostnames)
         except Exception as e:
             self.fail("%s: SSH failed for VM with IP Address: %s" %
-                                    (e, src_nat_ip_addr.ipaddress))
+                                    (e, ip_addr))
         time.sleep(self.services["lb_switch_wait"])
         return
 


[3/5] git commit: updated refs/heads/4.2 to f2d9a7b

Posted by ts...@apache.org.
Delete the affinity group by id and not name

Adding some docstrings to the tests so the test runner reports them.

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/296c2f6a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/296c2f6a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/296c2f6a

Branch: refs/heads/4.2
Commit: 296c2f6a7018cc6d6ee94262600b71847965cbfd
Parents: 8bc3757
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Thu Jul 18 15:01:32 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 18 15:01:32 2013 +0530

----------------------------------------------------------------------
 .../component/test_affinity_groups.py           | 39 ++++++++++++++++----
 1 file changed, 32 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/296c2f6a/test/integration/component/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py
index be93827..dfef21d 100644
--- a/test/integration/component/test_affinity_groups.py
+++ b/test/integration/component/test_affinity_groups.py
@@ -163,22 +163,31 @@ class TestCreateAffinityGroup(cloudstackTestCase):
             domainid = self.domain.id
 
         try:
-            self.aff_grp = AffinityGroup.create(api_client, aff_grp, acc, domainid)
+            return AffinityGroup.create(api_client, aff_grp, acc, domainid)
         except Exception as e:
             raise Exception("Error: Creation of Affinity Group failed : %s" %e)
 
-    @attr(tags=["simulator", "basic", "advanced"])
+    @attr(tags=["simulator", "basic", "advanced", "needle"])
     def test_01_admin_create_aff_grp(self):
+        """
+        Test create affinity group as admin
+        @return:
+        """
 
-        self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
-        self.debug("Created Affinity Group: %s" %self.aff_grp.name)
+        aff_group = self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+                                        acc=self.account.name, domainid=self.account.domainid)
+        self.debug("Created Affinity Group: %s" % aff_group.name)
 
-        list_aff_grps = AffinityGroup.list(self.api_client)
-        AffinityGroup.delete(self.api_client, list_aff_grps[0].name)
-        self.debug("Deleted Affinity Group: %s" %list_aff_grps[0].name)
+        list_aff_grps = AffinityGroup.list(self.api_client, id=aff_group.id)
+        AffinityGroup.delete(self.api_client, id=list_aff_grps[0].id)
+        self.debug("Deleted Affinity Group: %s" % list_aff_grps[0].name)
 
     @attr(tags=["simulator", "basic", "advanced"])
     def test_02_doadmin_create_aff_grp(self):
+        """
+        Test create affinity group as domain admin
+        @return:
+        """
 
         self.new_domain = Domain.create(self.api_client, self.services["new_domain"])
         self.do_admin = Account.create(self.api_client, self.services["new_account"],
@@ -196,6 +205,10 @@ class TestCreateAffinityGroup(cloudstackTestCase):
 
     @attr(tags=["simulator", "basic", "advanced"])
     def test_03_user_create_aff_grp(self):
+        """
+        Test create affinity group as user
+        @return:
+        """
 
         self.user = Account.create(self.api_client, self.services["new_account"],
                                   domainid=self.domain.id)
@@ -211,6 +224,10 @@ class TestCreateAffinityGroup(cloudstackTestCase):
 
     @attr(tags=["simulator", "basic", "advanced"])
     def test_04_user_create_aff_grp_existing_name(self):
+        """
+        Test create affinity group that exists (same name)
+        @return:
+        """
 
         self.user = Account.create(self.api_client, self.services["new_account"],
                                   domainid=self.domain.id)
@@ -228,6 +245,10 @@ class TestCreateAffinityGroup(cloudstackTestCase):
 
     @attr(tags=["simulator", "basic", "advanced"])
     def test_05_create_aff_grp_same_name_diff_acc(self):
+        """
+        Test create affinity group with existing name but within different account
+        @return:
+        """
 
         self.user = Account.create(self.api_client, self.services["new_account"],
                                   domainid=self.domain.id)
@@ -247,6 +268,10 @@ class TestCreateAffinityGroup(cloudstackTestCase):
 
     @attr(tags=["simulator", "basic", "advanced"])
     def test_06_create_aff_grp_nonexisting_type(self):
+        """
+        Test create affinity group of non-existing type
+        @return:
+        """
 
         self.non_existing_aff_grp = {
                     "name": "TestAffGrp_HA",


[4/5] git commit: updated refs/heads/4.2 to f2d9a7b

Posted by ts...@apache.org.
tearDownClass and not teardown

Include the affinity group in the deletion/cleanup

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/af9a8de9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/af9a8de9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/af9a8de9

Branch: refs/heads/4.2
Commit: af9a8de9019d2759fb121dfd0230b8cfbe1850ea
Parents: 296c2f6
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Thu Jul 18 15:02:16 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 18 15:02:16 2013 +0530

----------------------------------------------------------------------
 test/integration/smoke/test_affinity_groups.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/af9a8de9/test/integration/smoke/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py
index e63b916..db11ada 100644
--- a/test/integration/smoke/test_affinity_groups.py
+++ b/test/integration/smoke/test_affinity_groups.py
@@ -103,6 +103,7 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
 
         cls._cleanup = [
             cls.service_offering,
+            cls.ag,
             cls.account,
         ]
         return
@@ -185,9 +186,8 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
 
 
         @classmethod
-        def tearDown(cls):
+        def tearDownClass(cls):
             try:
-                #cls.api_client = super(TestDeployVmWithAffinityGroup, cls).getClsTestClient().getApiClient()
                 #Clean up, terminate the created templates
                 cleanup_resources(cls.api_client, cls._cleanup)
             except Exception as e: