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:58 UTC

[1/6] git commit: updated refs/heads/master to e25cbd6

Updated Branches:
  refs/heads/master b4662af0a -> e25cbd66d


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>
(cherry picked from commit 8bc3757e80d20575d1eeee530309ab61c02857d8)


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

Branch: refs/heads/master
Commit: c3a04b63a7ce3015ee430c1aac38696539def17c
Parents: e90ef2b
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 15:05:56 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/c3a04b63/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/6] git commit: updated refs/heads/master to e25cbd6

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>
(cherry picked from commit af9a8de9019d2759fb121dfd0230b8cfbe1850ea)


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

Branch: refs/heads/master
Commit: 8442e35a79907b5a317dca08e885bdebf43ea90d
Parents: c0de2c5
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:05:57 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/8442e35a/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:


[2/6] git commit: updated refs/heads/master to e25cbd6

Posted by ts...@apache.org.
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>
(cherry picked from commit 52fa8532bb2821f9b5472e713a905bc6b7f712b5)


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

Branch: refs/heads/master
Commit: d52d2c850591d169f6b3cf7d9596965fd16ad1f8
Parents: b4662af
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 15:05:56 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/d52d2c85/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
 
 


[6/6] git commit: updated refs/heads/master to e25cbd6

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

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

Branch: refs/heads/master
Commit: e25cbd66d2b13db684f2f339b05aafa6b119bcfe
Parents: 8442e35
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:22 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/e25cbd66/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
 


[4/6] git commit: updated refs/heads/master to e25cbd6

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>
(cherry picked from commit 296c2f6a7018cc6d6ee94262600b71847965cbfd)


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

Branch: refs/heads/master
Commit: c0de2c5857c6178a76d75ffd59d91de010879308
Parents: c3a04b6
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:05:57 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/c0de2c58/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",


[3/6] git commit: updated refs/heads/master to e25cbd6

Posted by ts...@apache.org.
remove the wait during 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/e90ef2b4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e90ef2b4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e90ef2b4

Branch: refs/heads/master
Commit: e90ef2b4b5c94d2f14c912b1819d02590b3d970e
Parents: d52d2c8
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Thu Jul 18 15:04:41 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 18 15:05:56 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_accounts.py | 25 +++---------------------
 1 file changed, 3 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e90ef2b4/test/integration/component/test_accounts.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py
index f9498bc..55b7331 100644
--- a/test/integration/component/test_accounts.py
+++ b/test/integration/component/test_accounts.py
@@ -415,7 +415,7 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
                                   self.apiclient,
                                   self.services["virtual_machine"],
                                   accountid=self.account.name,
-				  domainid=self.account.domainid,	
+                                  domainid=self.account.domainid,
                                   serviceofferingid=self.service_offering.id
                                   )
         self.debug("Deployed VM in account: %s, ID: %s" % (
@@ -426,7 +426,7 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
                                   self.apiclient,
                                   self.services["virtual_machine"],
                                   accountid=self.account.name,
-				  domainid=self.account.domainid,
+                                  domainid=self.account.domainid,
                                   serviceofferingid=self.service_offering.id
                                   )
         self.debug("Deployed VM in account: %s, ID: %s" % (
@@ -930,7 +930,6 @@ class TesttemplateHierarchy(cloudstackTestCase):
         # 2. Verify template is also visible for domain_2
 
         # Sleep to ensure that template state is reflected across
-        time.sleep(self.services["sleep"])
 
         templates = list_templates(
                                     self.apiclient,
@@ -1169,12 +1168,6 @@ class TestUserDetails(cloudstackTestCase):
 
     def tearDown(self):
         try:
-            interval = list_configurations(
-                                    self.apiclient,
-                                    name='account.cleanup.interval'
-                                    )
-            # Sleep to ensure that all resources are deleted
-            time.sleep(int(interval[0].value) * 2)
             #Clean up, terminate the created network offerings
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
@@ -1475,12 +1468,6 @@ class TestUserLogin(cloudstackTestCase):
 
     def tearDown(self):
         try:
-            interval = list_configurations(
-                                    self.apiclient,
-                                    name='account.cleanup.interval'
-                                    )
-            # Sleep to ensure that all resources are deleted
-            time.sleep(int(interval[0].value) * 2)
             #Clean up, terminate the created network offerings
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
@@ -1651,19 +1638,13 @@ class TestDomainForceRemove(cloudstackTestCase):
         try:
             #Clean up, terminate the created resources
             cleanup_resources(self.apiclient, self.cleanup)
-            interval = list_configurations(
-                                    self.apiclient,
-                                    name='account.cleanup.interval'
-                                    )
-            # Sleep to ensure that all resources are deleted
-            time.sleep(int(interval[0].value) * 2)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
 
     @attr(tags=["domains", "advanced", "advancedns", "simulator"])
     def test_forceDeleteDomain(self):
-        """ Test delete domain with force option"""
+        """ Test delete domain without force option"""
 
         # Steps for validations
         # 1. create a domain DOM