cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/3] git commit: updated refs/heads/master to fcc8dcd
Date Mon, 29 Aug 2016 06:46:10 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 38259a9a8 -> fcc8dcd5d


test/integration: fix tearDown order in list_acl_ tests

In several of the list_acl_tests, the tests run for simulator only where
in the (class) setup domains and accounts are created for the test. When the
tests end the (class) teardown methods would delete and remove these resources.
Due to dependence of one of the resources on the other, domain2 on domain1,
domain2 needs to be removed/cleaned up before domain1. Due to this issue,
several Travis test runs have failed in the past such as:

https://travis-ci.org/apache/cloudstack/jobs/152610967
https://travis-ci.org/apache/cloudstack/jobs/152610968

Changing the order of cleanup fixes the tests.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/master
Commit: 157b8147b91733e401ef0be8e2300518822c55e2
Parents: e49ca1e
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Fri Aug 19 17:12:09 2016 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Aug 23 14:49:21 2016 +0530

----------------------------------------------------------------------
 test/integration/component/test_acl_listsnapshot.py | 9 +++++----
 test/integration/component/test_acl_listvm.py       | 9 +++++----
 test/integration/component/test_acl_listvolume.py   | 9 +++++----
 3 files changed, 15 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/157b8147/test/integration/component/test_acl_listsnapshot.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_acl_listsnapshot.py b/test/integration/component/test_acl_listsnapshot.py
index 36ec59e..f0fa7b7 100644
--- a/test/integration/component/test_acl_listsnapshot.py
+++ b/test/integration/component/test_acl_listsnapshot.py
@@ -360,8 +360,8 @@ class TestSnapshotList(cloudstackTestCase):
                             cls.service_offering,
                             ]
         except Exception as e:
-                cls.domain_1.delete(cls.apiclient,cleanup="true")
                 cls.domain_2.delete(cls.apiclient,cleanup="true")
+                cls.domain_1.delete(cls.apiclient,cleanup="true")
                 cleanup_resources(cls.apiclient, cls.cleanup)
                 raise Exception("Failed to create the setup required to execute the test
cases: %s" % e)
 
@@ -370,10 +370,11 @@ class TestSnapshotList(cloudstackTestCase):
         cls.apiclient = super(TestSnapshotList, cls).getClsTestClient().getApiClient()
         cls.apiclient.connection.apiKey = cls.default_apikey
         cls.apiclient.connection.securityKey = cls.default_secretkey
-        cls.domain_1.delete(cls.apiclient,cleanup="true")
-        cls.domain_2.delete(cls.apiclient,cleanup="true")
+        try:
+            cls.domain_2.delete(cls.apiclient,cleanup="true")
+            cls.domain_1.delete(cls.apiclient,cleanup="true")
+        except: pass
         cleanup_resources(cls.apiclient, cls.cleanup)
-        return
 
     def setUp(cls):
         cls.apiclient = cls.testClient.getApiClient()

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/157b8147/test/integration/component/test_acl_listvm.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_acl_listvm.py b/test/integration/component/test_acl_listvm.py
index de99718..5ed937f 100644
--- a/test/integration/component/test_acl_listvm.py
+++ b/test/integration/component/test_acl_listvm.py
@@ -333,8 +333,8 @@ class TestVMList(cloudstackTestCase):
                             cls.service_offering,
                             ]
     	except Exception as e:
-        	cls.domain_1.delete(cls.apiclient,cleanup="true")
         	cls.domain_2.delete(cls.apiclient,cleanup="true")
+		cls.domain_1.delete(cls.apiclient,cleanup="true")
         	cleanup_resources(cls.apiclient, cls.cleanup)
 		raise Exception("Failed to create the setup required to execute the test cases: %s" % e)
 
@@ -343,10 +343,11 @@ class TestVMList(cloudstackTestCase):
         cls.apiclient = super(TestVMList, cls).getClsTestClient().getApiClient()
         cls.apiclient.connection.apiKey = cls.default_apikey
         cls.apiclient.connection.securityKey = cls.default_secretkey
-        cls.domain_1.delete(cls.apiclient,cleanup="true")
-        cls.domain_2.delete(cls.apiclient,cleanup="true")
+        try:
+            cls.domain_2.delete(cls.apiclient,cleanup="true")
+            cls.domain_1.delete(cls.apiclient,cleanup="true")
+        except: pass
         cleanup_resources(cls.apiclient, cls.cleanup)
-        return
 
     def setUp(cls):
         cls.apiclient = cls.testClient.getApiClient()

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/157b8147/test/integration/component/test_acl_listvolume.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_acl_listvolume.py b/test/integration/component/test_acl_listvolume.py
index 12e514d..05cabeb 100644
--- a/test/integration/component/test_acl_listvolume.py
+++ b/test/integration/component/test_acl_listvolume.py
@@ -345,8 +345,8 @@ class TestVolumeList(cloudstackTestCase):
                             cls.service_offering,
                             ]
         except Exception as e:
-                cls.domain_1.delete(cls.apiclient,cleanup="true")
                 cls.domain_2.delete(cls.apiclient,cleanup="true")
+                cls.domain_1.delete(cls.apiclient,cleanup="true")
                 cleanup_resources(cls.apiclient, cls.cleanup)
                 raise Exception("Failed to create the setup required to execute the test
cases: %s" % e)
 
@@ -358,9 +358,10 @@ class TestVolumeList(cloudstackTestCase):
         cls.apiclient.connection.apiKey = cls.default_apikey
         cls.apiclient.connection.securityKey = cls.default_secretkey
         cleanup_resources(cls.apiclient, cls.cleanup)
-        cls.domain_1.delete(cls.apiclient,cleanup="true")
-        cls.domain_2.delete(cls.apiclient,cleanup="true")
-        return
+        try:
+            cls.domain_2.delete(cls.apiclient,cleanup="true")
+            cls.domain_1.delete(cls.apiclient,cleanup="true")
+        except: pass
 
     def setUp(cls):
         cls.apiclient = cls.testClient.getApiClient()


Mime
View raw message