cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject git commit: updated refs/heads/master to 5b238fa
Date Tue, 23 Jul 2013 19:12:49 GMT
Updated Branches:
  refs/heads/master 2cf8ecd3e -> 5b238fa4a


Automation: Fix enormous missing tearDown() for test cases

This result in countless test case failure because many test case units didn't
clean up after it.

The regression test result should be improved quite a bit after this change.


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

Branch: refs/heads/master
Commit: 5b238fa4af45e92224a9562de556bb67be9edee9
Parents: 2cf8ecd
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Tue Jul 23 12:05:42 2013 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Tue Jul 23 12:10:37 2013 -0700

----------------------------------------------------------------------
 test/integration/component/test_blocker_bugs.py | 21 +++++++++-----
 .../component/test_redundant_router.py          | 29 +++++++++++++++++++-
 .../component/test_redundant_router_cleanups.py | 10 ++++++-
 ...test_redundant_router_deployment_planning.py | 10 ++++++-
 .../test_redundant_router_network_rules.py      | 10 ++++++-
 .../component/test_redundant_router_services.py |  7 +++++
 .../component/test_redundant_router_upgrades.py |  7 +++++
 test/integration/component/test_volumes.py      |  8 ++++++
 test/integration/component/test_vpc.py          |  8 ++++++
 test/integration/component/test_vpc_network.py  | 24 ++++++++++++++++
 .../integration/component/test_vpc_offerings.py |  7 +++++
 11 files changed, 130 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_blocker_bugs.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py
index 1f7ac97..8a73b91 100644
--- a/test/integration/component/test_blocker_bugs.py
+++ b/test/integration/component/test_blocker_bugs.py
@@ -103,9 +103,7 @@ class TestTemplate(cloudstackTestCase):
 
     def tearDown(self):
         try:
-            #Clean up, terminate the created templates
             cleanup_resources(self.apiclient, self.cleanup)
-
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
@@ -285,6 +283,13 @@ class TestNATRules(cloudstackTestCase):
         self.cleanup = []
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @classmethod
     def tearDownClass(cls):
         try:
@@ -293,10 +298,6 @@ class TestNATRules(cloudstackTestCase):
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
-    def tearDown(self):
-        cleanup_resources(self.apiclient, self.cleanup)
-        return
-
     @attr(tags = ["advanced"])
     def test_01_firewall_rules_port_fw(self):
         """"Checking firewall rules deletion after static NAT disable"""
@@ -493,7 +494,6 @@ class TestRouters(cloudstackTestCase):
 
     def tearDown(self):
         try:
-            #Clean up, terminate the created instance, users etc
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
@@ -610,6 +610,13 @@ class TestRouterRestart(cloudstackTestCase):
         self.apiclient = self.testClient.getApiClient()
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags = ["advanced", "basic", "sg", "advancedns", "eip"])
     def test_01_restart_network_cleanup(self):
         """TS_BUG_008-Test restart network

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_redundant_router.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_redundant_router.py b/test/integration/component/test_redundant_router.py
index 8414d2f..08abd09 100644
--- a/test/integration/component/test_redundant_router.py
+++ b/test/integration/component/test_redundant_router.py
@@ -165,7 +165,6 @@ class TestCreateRvRNetworkOffering(cloudstackTestCase):
 
     def tearDown(self):
         try:
-            #Clean up, terminate the created network offerings
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
@@ -287,6 +286,13 @@ class TestCreateRvRNetwork(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags=["advanced", "advancedns", "ssh"])
     def test_createRvRNetwork(self):
         """Test create network with redundant routers
@@ -478,6 +484,13 @@ class TestCreateRvRNetworkNonDefaultGuestCidr(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags=["advanced", "advancedns"])
     def test_createRvRNetwork(self):
         """Test create network with non-default guest cidr with redundant routers
@@ -678,6 +691,13 @@ class TestRVRInternals(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags=["advanced", "advancedns", "ssh"])
     def test_redundantVR_internals(self):
         """Test redundant router internals
@@ -991,6 +1011,13 @@ class TestRvRRedundancy(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags=["advanced", "advancedns", "ssh"])
     def test_stopMasterRvR(self):
         """Test stop master RVR

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_redundant_router_cleanups.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_redundant_router_cleanups.py b/test/integration/component/test_redundant_router_cleanups.py
index 694db86..b7ef355 100644
--- a/test/integration/component/test_redundant_router_cleanups.py
+++ b/test/integration/component/test_redundant_router_cleanups.py
@@ -192,6 +192,14 @@ class TestRedundantRouterNetworkCleanups(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self._cleanup)
+        except Exception as e:
+            self.debug("Warning: Exception during cleanup : %s" % e)
+            #raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags=["advanced", "advancedns", "ssh"])
     def test_restart_ntwk_no_cleanup(self):
         """Test restarting RvR network without cleanup
@@ -672,4 +680,4 @@ class TestRedundantRouterNetworkCleanups(cloudstackTestCase):
                              "Stopped",
                              "Router should be in stopped state"
                              )
-        return
\ No newline at end of file
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_redundant_router_deployment_planning.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_redundant_router_deployment_planning.py b/test/integration/component/test_redundant_router_deployment_planning.py
index cd37fa6..d4d00ca 100644
--- a/test/integration/component/test_redundant_router_deployment_planning.py
+++ b/test/integration/component/test_redundant_router_deployment_planning.py
@@ -191,6 +191,14 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self._cleanup)
+        except Exception as e:
+            self.debug("Warning: Exception during cleanup : %s" % e)
+            #raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags=["advanced", "advancedns"])
     def test_RvR_multipods(self):
         """Test RvR with multi pods
@@ -1003,4 +1011,4 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
                 cmd.id = cluster.id
                 cmd.allocationstate = 'Enabled'
                 self.apiclient.updateCluster(cmd)
-        return
\ No newline at end of file
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_redundant_router_network_rules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_redundant_router_network_rules.py b/test/integration/component/test_redundant_router_network_rules.py
index d2d63b4..d54b470 100644
--- a/test/integration/component/test_redundant_router_network_rules.py
+++ b/test/integration/component/test_redundant_router_network_rules.py
@@ -191,6 +191,14 @@ class TestRedundantRouterRulesLifeCycle(cloudstackTestCase):
         self._clean.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self._cleanup)
+        except Exception as e:
+            self.debug("Warning: Exception during cleanup : %s" % e)
+            #raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags=["advanced", "advancedns", "ssh"])
     def test_applyNetworkRules_MasterDown_deleteNetworkRules(self):
         """Test apply network rules when master & backup routers rebooted
@@ -1413,4 +1421,4 @@ class TestRedundantRouterRulesLifeCycle(cloudstackTestCase):
                              "Running",
                              "Router state should be running"
                              )
-        return
\ No newline at end of file
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_redundant_router_services.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_redundant_router_services.py b/test/integration/component/test_redundant_router_services.py
index cc4d367..d5afe29 100644
--- a/test/integration/component/test_redundant_router_services.py
+++ b/test/integration/component/test_redundant_router_services.py
@@ -193,6 +193,13 @@ class TestEnableVPNOverRvR(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags=["advanced", "advancedns", "ssh"])
     def test_enableVPNOverRvR(self):
         """Test redundant router internals

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_redundant_router_upgrades.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_redundant_router_upgrades.py b/test/integration/component/test_redundant_router_upgrades.py
index 654faeb..da3b9b0 100644
--- a/test/integration/component/test_redundant_router_upgrades.py
+++ b/test/integration/component/test_redundant_router_upgrades.py
@@ -192,6 +192,13 @@ class TestRvRUpgradeDowngrade(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags=["advanced", "advancedns", "ssh"])
     def test_upgradeVR_to_redundantVR(self):
         """Test upgrade virtual router to redundant virtual router

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py
index e06bac9..b894b1f 100644
--- a/test/integration/component/test_volumes.py
+++ b/test/integration/component/test_volumes.py
@@ -160,6 +160,14 @@ class TestAttachVolume(cloudstackTestCase):
         self.dbclient = self.testClient.getDbConnection()
         self.cleanup = []
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self._cleanup)
+        except Exception as e:
+            self.debug("Warning: Exception during cleanup : %s" % e)
+            #raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     @attr(tags = ["advanced", "advancedns"])
     def test_01_volume_attach(self):
         """Test Attach volumes (max capacity)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_vpc.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc.py b/test/integration/component/test_vpc.py
index 3a661d5..08bfb5c 100644
--- a/test/integration/component/test_vpc.py
+++ b/test/integration/component/test_vpc.py
@@ -226,6 +226,14 @@ class TestVPC(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self._cleanup)
+        except Exception as e:
+            self.debug("Warning: Exception during cleanup : %s" % e)
+            #raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     def validate_vpc_offering(self, vpc_offering):
         """Validates the VPC offering"""
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_vpc_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_network.py b/test/integration/component/test_vpc_network.py
index 477c79e..8b43dcd 100644
--- a/test/integration/component/test_vpc_network.py
+++ b/test/integration/component/test_vpc_network.py
@@ -230,6 +230,14 @@ class TestVPCNetwork(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self._cleanup)
+        except Exception as e:
+            self.debug("Warning: Exception during cleanup : %s" % e)
+            #raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     def validate_vpc_offering(self, vpc_offering):
         """Validates the VPC offering"""
 
@@ -1078,6 +1086,14 @@ class TestVPCNetworkRanges(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self._cleanup)
+        except Exception as e:
+            self.debug("Warning: Exception during cleanup : %s" % e)
+            #raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     def validate_vpc_offering(self, vpc_offering):
         """Validates the VPC offering"""
 
@@ -1573,6 +1589,14 @@ class TestVPCNetworkUpgrade(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self._cleanup)
+        except Exception as e:
+            self.debug("Warning: Exception during cleanup : %s" % e)
+            #raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     def validate_vpc_offering(self, vpc_offering):
         """Validates the VPC offering"""
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b238fa4/test/integration/component/test_vpc_offerings.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_offerings.py b/test/integration/component/test_vpc_offerings.py
index cf37d90..28af16a 100644
--- a/test/integration/component/test_vpc_offerings.py
+++ b/test/integration/component/test_vpc_offerings.py
@@ -183,6 +183,13 @@ class TestVPCOffering(cloudstackTestCase):
         self._cleanup.insert(0, self.account)
         return
 
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
     def validate_vpc_offering(self, vpc_offering):
         """Validates the VPC offering"""
 


Mime
View raw message