You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@apache.org on 2014/06/13 15:39:06 UTC
git commit: updated refs/heads/master to 59a9883
Repository: cloudstack
Updated Branches:
refs/heads/master 0c28f36ff -> 59a98839c
CLOUDSTACK-6887: Fixing account cleanup issue across multiple test cases
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/59a98839
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/59a98839
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/59a98839
Branch: refs/heads/master
Commit: 59a98839ce895cef6e4864f37fd831805d1da8f1
Parents: 0c28f36
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Fri Jun 13 00:17:32 2014 -0700
Committer: Girish Shilamkar <gi...@clogeny.com>
Committed: Fri Jun 13 19:08:29 2014 +0530
----------------------------------------------------------------------
.../component/test_add_remove_network.py | 7 +-
.../component/test_persistent_networks.py | 214 +++++++++++--------
test/integration/component/test_projects.py | 1 +
test/integration/component/test_snapshot_gc.py | 77 +++----
.../component/test_snapshot_limits.py | 2 -
test/integration/component/test_usage.py | 7 +-
test/integration/component/test_volumes.py | 2 +
test/integration/smoke/test_affinity_groups.py | 14 +-
8 files changed, 176 insertions(+), 148 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59a98839/test/integration/component/test_add_remove_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py
index 20aefe4..7479cee 100644
--- a/test/integration/component/test_add_remove_network.py
+++ b/test/integration/component/test_add_remove_network.py
@@ -924,22 +924,25 @@ class TestUpdateVirtualMachineNIC(cloudstackTestCase):
# Create Accounts & networks
cls.services["isolated_network"]["zoneid"] = cls.zone.id
cls.services["shared_network"]["zoneid"] = cls.zone.id
+ cls._cleanup = []
cls.account = Account.create(cls.api_client,cls.services["account"],domainid = cls.domain.id)
+ cls._cleanup.append(cls.account)
cls.service_offering = ServiceOffering.create(cls.api_client,cls.services["service_offering"])
+ cls._cleanup.append(cls.service_offering)
cls.virtual_machine = VirtualMachine.create(cls.api_client,cls.services["virtual_machine"],
accountid=cls.account.name,domainid=cls.account.domainid,
serviceofferingid=cls.service_offering.id,
mode=cls.zone.networktype)
# Create Shared Network Offering
- cls.isolated_network_offering = NetworkOffering.create(cls.api_client,cls.services["isolated_network_offering"],)
+ cls.isolated_network_offering = NetworkOffering.create(cls.api_client,cls.services["isolated_network_offering"])
+ cls._cleanup.append(cls.isolated_network_offering)
# Enable Isolated Network offering
cls.isolated_network_offering.update(cls.api_client, state='Enabled')
cls.isolated_network = Network.create(cls.api_client,cls.services["isolated_network"],cls.account.name,
cls.account.domainid,networkofferingid=cls.isolated_network_offering.id)
- cls._cleanup = [cls.account,cls.service_offering,cls.isolated_network_offering,]
return
def setUp(self):
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59a98839/test/integration/component/test_persistent_networks.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_persistent_networks.py b/test/integration/component/test_persistent_networks.py
index 21ede66..b90d621 100644
--- a/test/integration/component/test_persistent_networks.py
+++ b/test/integration/component/test_persistent_networks.py
@@ -1849,59 +1849,88 @@ class TestVPCNetworkOperations(cloudstackTestCase):
# 3. Restart/delete VPC network
# Validations
- # 1. In case of Restart operation, restart should be successful and persistent networks should be back in persistent state
- # 2. In case of Delete operation, VR servicing the VPC should get destroyed and sourceNAT ip should get released
+ # 1. In case of Restart operation, restart should be successful
+ # and persistent networks should be back in persistent state
+ # 2. In case of Delete operation, VR servicing the VPC should
+ # get destroyed and sourceNAT ip should get released
- child_domain = Domain.create(self.apiclient,services=self.services["domain"],
+ child_domain = Domain.create(self.apiclient,
+ services=self.services["domain"],
parentdomainid=self.domain.id)
- account_1 = Account.create(self.apiclient,self.services["account"],domainid=child_domain.id)
- account_2 = Account.create(self.apiclient,self.services["account"],domainid=child_domain.id)
+ try:
+ account_1 = Account.create(
+ self.apiclient,self.services["account"],
+ domainid=child_domain.id
+ )
+ account_2 = Account.create(
+ self.apiclient,self.services["account"],
+ domainid=child_domain.id
+ )
- self.services["vpc"]["cidr"] = "10.1.1.1/16"
- vpc_1 = VPC.create(self.apiclient, self.services["vpc"],
+ self.services["vpc"]["cidr"] = "10.1.1.1/16"
+ vpc_1 = VPC.create(self.apiclient, self.services["vpc"],
vpcofferingid=self.vpc_off.id, zoneid=self.zone.id,
account=account_1.name, domainid=account_1.domainid)
- vpcs = VPC.list(self.apiclient, id=vpc_1.id)
- self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs)
+ vpcs = VPC.list(self.apiclient, id=vpc_1.id)
+ self.assertEqual(validateList(vpcs)[0], PASS,\
+ "VPC list validation failed, vpc list is %s" % vpcs)
- vpc_2 = VPC.create(self.apiclient, self.services["vpc"],
+ vpc_2 = VPC.create(self.apiclient, self.services["vpc"],
vpcofferingid=self.vpc_off.id, zoneid=self.zone.id,
account=account_2.name, domainid=account_2.domainid)
- vpcs = VPC.list(self.apiclient, id=vpc_2.id)
- self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs)
-
- persistent_network_1 = Network.create(self.api_client,self.services["isolated_network"],
- networkofferingid=self.persistent_network_offering_NoLB.id,
- accountid=account_1.name,domainid=account_1.domainid,
- zoneid=self.zone.id, vpcid=vpc_1.id, gateway="10.1.1.1", netmask="255.255.255.0")
- response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented")
- exceptionOccured = response[0]
- isNetworkInDesiredState = response[1]
- exceptionMessage = response[2]
-
- if (exceptionOccured or (not isNetworkInDesiredState)):
- self.fail(exceptionMessage)
- self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id)
+ vpcs = VPC.list(self.apiclient, id=vpc_2.id)
+ self.assertEqual(validateList(vpcs)[0], PASS,\
+ "VPC list validation failed, vpc list is %s" % vpcs)
+
+ persistent_network_1 = Network.create(
+ self.api_client,self.services["isolated_network"],
+ networkofferingid=self.persistent_network_offering_NoLB.id,
+ accountid=account_1.name,domainid=account_1.domainid,
+ zoneid=self.zone.id, vpcid=vpc_1.id, gateway="10.1.1.1",
+ netmask="255.255.255.0")
+
+ response = verifyNetworkState(self.apiclient,
+ persistent_network_1.id,
+ "implemented"
+ )
+ exceptionOccured = response[0]
+ isNetworkInDesiredState = response[1]
+ exceptionMessage = response[2]
- persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"],
- networkofferingid=self.persistent_network_offering_NoLB.id,
- accountid=account_2.name,domainid=account_2.domainid,
- zoneid=self.zone.id, vpcid=vpc_2.id, gateway="10.1.1.1", netmask="255.255.255.0")
- response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented")
- exceptionOccured = response[0]
- isNetworkInDesiredState = response[1]
- exceptionMessage = response[2]
+ if (exceptionOccured or (not isNetworkInDesiredState)):
+ raise Exception(exceptionMessage)
+ self.assertIsNotNone(
+ persistent_network_1.vlan,\
+ "vlan must not be null for persistent network %s" %\
+ persistent_network_1.id)
+
+ persistent_network_2 = Network.create(
+ self.api_client,self.services["isolated_network"],
+ networkofferingid=self.persistent_network_offering_NoLB.id,
+ accountid=account_2.name,domainid=account_2.domainid,
+ zoneid=self.zone.id, vpcid=vpc_2.id, gateway="10.1.1.1",
+ netmask="255.255.255.0")
+ response = verifyNetworkState(self.apiclient, persistent_network_2.id,
+ "implemented")
+ exceptionOccured = response[0]
+ isNetworkInDesiredState = response[1]
+ exceptionMessage = response[2]
- if (exceptionOccured or (not isNetworkInDesiredState)):
- self.fail(exceptionMessage)
- self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id)
+ if (exceptionOccured or (not isNetworkInDesiredState)):
+ raise Exception(exceptionMessage)
+ self.assertIsNotNone(persistent_network_2.vlan,\
+ "vlan must not be null for persistent network: %s" %\
+ persistent_network_2.id)
- # Force delete domain
- try:
+ # Force delete domain
child_domain.delete(self.apiclient, cleanup=True)
+
except Exception as e:
- self.fail("Failed to delete domain: %s" % e)
+ self.cleanup.append(account_1)
+ self.cleanup.append(account_2)
+ self.cleanup.append(child_domain)
+ self.fail(e)
self.debug("Waiting for account.cleanup.interval" +
" to cleanup any remaining resouces")
@@ -1909,11 +1938,17 @@ class TestVPCNetworkOperations(cloudstackTestCase):
wait_for_cleanup(self.apiclient, ["account.cleanup.interval"]*3)
self.VerifyDomainCleanup(child_domain.id)
- with self.assertRaises(Exception) as e:
- Account.list(self.apiclient,name=account_1.name, domainid=account_1.domainid,listall=True)
+ with self.assertRaises(Exception):
+ Account.list(
+ self.apiclient,name=account_1.name,
+ domainid=account_1.domainid,listall=True
+ )
- with self.assertRaises(Exception) as e:
- Account.list(self.apiclient,name=account_2.name, domainid=account_2.domainid,listall=True)
+ with self.assertRaises(Exception):
+ Account.list(
+ self.apiclient,name=account_2.name,
+ domainid=account_2.domainid,listall=True
+ )
self.VerifyVpcCleanup(vpc_1.id)
self.VerifyVpcCleanup(vpc_2.id)
@@ -1932,46 +1967,46 @@ class TestVPCNetworkOperations(cloudstackTestCase):
# 1. In case of Restart operation, restart should be successful and persistent networks should be back in persistent state
# 2. In case of Delete operation, VR servicing the VPC should get destroyed and sourceNAT ip should get released
- # Create Account
- account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id)
+ try:
+ # Create Account
+ account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id)
- # Create VPC
- self.services["vpc"]["cidr"] = "10.1.1.1/16"
- vpc = VPC.create(self.apiclient, self.services["vpc"],
+ # Create VPC
+ self.services["vpc"]["cidr"] = "10.1.1.1/16"
+ vpc = VPC.create(self.apiclient, self.services["vpc"],
vpcofferingid=self.vpc_off.id, zoneid=self.zone.id,
account=account.name, domainid=account.domainid)
- vpcs = VPC.list(self.apiclient, id=vpc.id)
- self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs)
+ vpcs = VPC.list(self.apiclient, id=vpc.id)
+ self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs)
- # Create Persistent Networks as tiers of VPC
- persistent_network_1 = Network.create(self.api_client,self.services["isolated_network"],
+ # Create Persistent Networks as tiers of VPC
+ persistent_network_1 = Network.create(self.api_client,self.services["isolated_network"],
networkofferingid=self.persistent_network_offering_NoLB.id,
accountid=account.name,domainid=account.domainid,
zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.1.1", netmask="255.255.255.0")
- response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented")
- exceptionOccured = response[0]
- isNetworkInDesiredState = response[1]
- exceptionMessage = response[2]
+ response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented")
+ exceptionOccured = response[0]
+ isNetworkInDesiredState = response[1]
+ exceptionMessage = response[2]
- if (exceptionOccured or (not isNetworkInDesiredState)):
- self.fail(exceptionMessage)
- self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id)
+ if (exceptionOccured or (not isNetworkInDesiredState)):
+ raise Exception(exceptionMessage)
+ self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id)
- persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"],
+ persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"],
networkofferingid=self.persistent_network_offering_LB.id,
accountid=account.name,domainid=account.domainid,
zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.2.1", netmask="255.255.255.0")
- response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented")
- exceptionOccured = response[0]
- isNetworkInDesiredState = response[1]
- exceptionMessage = response[2]
+ response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented")
+ exceptionOccured = response[0]
+ isNetworkInDesiredState = response[1]
+ exceptionMessage = response[2]
- if (exceptionOccured or (not isNetworkInDesiredState)):
- self.fail(exceptionMessage)
- self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id)
+ if (exceptionOccured or (not isNetworkInDesiredState)):
+ raise Exception(exceptionMessage)
+ self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id)
- # Deploy VMs in above networks (VM1, VM2 in network1 and VM3, VM4 in network2)
- try:
+ # Deploy VMs in above networks (VM1, VM2 in network1 and VM3, VM4 in network2)
virtual_machine_1 = VirtualMachine.create(self.apiclient,self.services["virtual_machine"],
networkids=[persistent_network_1.id],serviceofferingid=self.service_offering.id,
accountid=account.name,domainid=self.domain.id)
@@ -1987,38 +2022,39 @@ class TestVPCNetworkOperations(cloudstackTestCase):
virtual_machine_4 = VirtualMachine.create(self.apiclient,self.services["virtual_machine"],
networkids=[persistent_network_2.id],serviceofferingid=self.service_offering.id,
accountid=account.name,domainid=self.domain.id)
- except Exception as e:
- self.fail("vm creation failed: %s" % e)
- # Associate IP addresses to persistent networks
- ipaddress_1 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account)
- ipaddress_2 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account)
- ipaddress_3 = self.GetAssociatedIpForNetwork(persistent_network_2.id, vpcid=vpc.id, account=account)
+ # Associate IP addresses to persistent networks
+ ipaddress_1 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account)
+ ipaddress_2 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account)
+ ipaddress_3 = self.GetAssociatedIpForNetwork(persistent_network_2.id, vpcid=vpc.id, account=account)
- # Create NAT rule for VM 1
- NATRule.create(self.api_client, virtual_machine_1,
+ # Create NAT rule for VM 1
+ NATRule.create(self.api_client, virtual_machine_1,
self.services["natrule"],ipaddressid=ipaddress_1.ipaddress.id,
networkid=persistent_network_1.id)
- # Create Static NAT rule for VM 2
- StaticNATRule.enable(self.apiclient, ipaddressid=ipaddress_2.ipaddress.id,
+ # Create Static NAT rule for VM 2
+ StaticNATRule.enable(self.apiclient, ipaddressid=ipaddress_2.ipaddress.id,
virtualmachineid=virtual_machine_2.id,
networkid=persistent_network_1.id)
- # Create load balancer rule for ipaddress3 and assign to VM3 and VM4
- lb_rule = LoadBalancerRule.create(self.apiclient,self.services["lbrule"],
+ # Create load balancer rule for ipaddress3 and assign to VM3 and VM4
+ lb_rule = LoadBalancerRule.create(self.apiclient,self.services["lbrule"],
ipaddressid=ipaddress_3.ipaddress.id, accountid=account.name,
networkid=persistent_network_2.id, domainid=account.domainid)
- lb_rule.assign(self.api_client, [virtual_machine_3, virtual_machine_4])
+ lb_rule.assign(self.api_client, [virtual_machine_3, virtual_machine_4])
- # Create network ACL for both ther persistent networks (tiers of VPC)
- ingressAclNetwork1, egressAclNetwork1 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_1.id)
- ingressAclNetwork2, egressAclNetwork2 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_2.id)
+ # Create network ACL for both ther persistent networks (tiers of VPC)
+ ingressAclNetwork1, egressAclNetwork1 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_1.id)
+ ingressAclNetwork2, egressAclNetwork2 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_2.id)
- self.CheckIngressEgressConnectivityofVM(virtual_machine_1, ipaddress_1.ipaddress.ipaddress)
- self.CheckIngressEgressConnectivityofVM(virtual_machine_2, ipaddress_2.ipaddress.ipaddress)
- self.CheckIngressEgressConnectivityofVM(virtual_machine_3, ipaddress_3.ipaddress.ipaddress)
- self.CheckIngressEgressConnectivityofVM(virtual_machine_4, ipaddress_3.ipaddress.ipaddress)
+ self.CheckIngressEgressConnectivityofVM(virtual_machine_1, ipaddress_1.ipaddress.ipaddress)
+ self.CheckIngressEgressConnectivityofVM(virtual_machine_2, ipaddress_2.ipaddress.ipaddress)
+ self.CheckIngressEgressConnectivityofVM(virtual_machine_3, ipaddress_3.ipaddress.ipaddress)
+ self.CheckIngressEgressConnectivityofVM(virtual_machine_4, ipaddress_3.ipaddress.ipaddress)
+ except Exception as e:
+ self.cleanup.append(account)
+ self.fail(e)
# Delete account
account.delete(self.apiclient)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59a98839/test/integration/component/test_projects.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py
index c593fb6..15c4d5e 100644
--- a/test/integration/component/test_projects.py
+++ b/test/integration/component/test_projects.py
@@ -1474,6 +1474,7 @@ class TestProjectSuspendActivate(cloudstackTestCase):
cls._cleanup = [
cls.project,
cls.account,
+ cls.user,
cls.disk_offering,
cls.service_offering
]
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59a98839/test/integration/component/test_snapshot_gc.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_snapshot_gc.py b/test/integration/component/test_snapshot_gc.py
index 42c361c..5c475af 100644
--- a/test/integration/component/test_snapshot_gc.py
+++ b/test/integration/component/test_snapshot_gc.py
@@ -16,13 +16,22 @@
# under the License.
from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
-from marvin.lib.utils import is_snapshot_on_nfs
-
+from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+#from marvin.cloudstackAPI import *
+from marvin.lib.utils import (
+ is_snapshot_on_nfs,
+ cleanup_resources)
+from marvin.lib.base import (Account,
+ Snapshot,
+ ServiceOffering,
+ VirtualMachine)
+from marvin.lib.common import (get_domain,
+ get_zone,
+ get_template,
+ list_volumes,
+ list_accounts,
+ list_snapshots,
+ wait_for_cleanup)
class Services:
"""Test Snapshots Services
@@ -177,7 +186,7 @@ class TestAccountSnapshotClean(cloudstackTestCase):
volume = volumes[0]
# Create a snapshot from the ROOTDISK
- cls.snapshot = Snapshot.create(cls.api_client, volumes[0].id)
+ cls.snapshot = Snapshot.create(cls.api_client, volume.id)
except Exception, e:
cls.tearDownClass()
unittest.SkipTest("setupClass fails for %s" % cls.__name__)
@@ -223,70 +232,50 @@ class TestAccountSnapshotClean(cloudstackTestCase):
# b) snapshot image($snapshot_id) should be deleted from the
# /secondary/snapshots/$accountid/$volumeid/
- accounts = list_accounts(
+ try:
+ accounts = list_accounts(
self.apiclient,
id=self.account.id
)
- self.assertEqual(
+ self.assertEqual(
isinstance(accounts, list),
True,
"Check list response returns a valid list"
)
- self.assertNotEqual(
+ self.assertNotEqual(
len(accounts),
0,
"Check list Accounts response"
)
- # VM should be in 'Running' state
- virtual_machines = list_virtual_machines(
- self.apiclient,
- id=self.virtual_machine.id
- )
- self.assertEqual(
- isinstance(virtual_machines, list),
- True,
- "Check list response returns a valid list"
- )
- self.assertNotEqual(
- len(virtual_machines),
- 0,
- "Check list virtual machines response"
- )
- for virtual_machine in virtual_machines:
- self.debug("VM ID: %s, VM state: %s" % (
- virtual_machine.id,
- virtual_machine.state
- ))
- self.assertEqual(
- virtual_machine.state,
- 'Running',
- "Check list VM response for Running state"
- )
-
- # Verify the snapshot was created or not
- snapshots = list_snapshots(
+ # Verify the snapshot was created or not
+ snapshots = list_snapshots(
self.apiclient,
id=self.snapshot.id
)
- self.assertEqual(
+ self.assertEqual(
isinstance(snapshots, list),
True,
"Check list response returns a valid list"
)
- self.assertNotEqual(
+ self.assertNotEqual(
snapshots,
None,
"No such snapshot %s found" % self.snapshot.id
)
- self.assertEqual(
+ self.assertEqual(
snapshots[0].id,
self.snapshot.id,
"Check snapshot id in list resources call"
)
- self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, self.snapshot.id),
- "Snapshot was not found on NFS")
+ self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, self.snapshot.id),
+ "Snapshot was not found on NFS")
+
+ raise Exception("self raised exception")
+ except Exception as e:
+ self._cleanup.append(self.account)
+ self.fail("Exception occured: %s" % e)
self.debug("Deleting account: %s" % self.account.name)
# Delete account
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59a98839/test/integration/component/test_snapshot_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_snapshot_limits.py b/test/integration/component/test_snapshot_limits.py
index 95c6432..a7da0db 100644
--- a/test/integration/component/test_snapshot_limits.py
+++ b/test/integration/component/test_snapshot_limits.py
@@ -173,8 +173,6 @@ class TestSnapshotLimit(cloudstackTestCase):
cls.tearDownClass()
unittest.SkipTest("setupClass fails for %s" % cls.__name__)
raise e
- else:
- cls._cleanup.remove(cls.account)
return
@classmethod
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59a98839/test/integration/component/test_usage.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py
index 03823be..4413f43 100644
--- a/test/integration/component/test_usage.py
+++ b/test/integration/component/test_usage.py
@@ -1462,6 +1462,7 @@ class TestVpnUsage(cloudstackTestCase):
cls.services["server"]["zoneid"] = cls.zone.id
cls.services["template"] = template.id
+ cls._cleanup = []
# Create Service offerings, VMs etc
cls.account = Account.create(
@@ -1470,6 +1471,7 @@ class TestVpnUsage(cloudstackTestCase):
admin=True,
domainid=cls.domain.id
)
+ cls._cleanup.append(cls.account)
cls.services["account"] = cls.account.name
@@ -1477,6 +1479,7 @@ class TestVpnUsage(cloudstackTestCase):
cls.api_client,
cls.services["service_offering"]
)
+ cls._cleanup.append(cls.sevice_offering)
cls.virtual_machine = VirtualMachine.create(
cls.api_client,
cls.services["server"],
@@ -1492,10 +1495,6 @@ class TestVpnUsage(cloudstackTestCase):
domainid=cls.virtual_machine.domainid,
services=cls.services["server"]
)
- cls._cleanup = [
- cls.service_offering,
- cls.account,
- ]
return
@classmethod
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59a98839/test/integration/component/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py
index b5b08e2..22029b1 100644
--- a/test/integration/component/test_volumes.py
+++ b/test/integration/component/test_volumes.py
@@ -1041,6 +1041,7 @@ class TestVolumes(cloudstackTestCase):
name="NROOT",
parentdomainid=self.domain.id
)
+ self.cleanup.append(dom)
self.assertTrue(dom is not None, msg="Domain creation failed")
domuser = Account.create(
@@ -1049,6 +1050,7 @@ class TestVolumes(cloudstackTestCase):
admin=False,
domainid=dom.id
)
+ self.cleanup.insert(-2, domuser)
self.assertTrue(domuser is not None)
domapiclient = self.testClient.getUserApiClient(UserName=domuser.name, DomainName=dom.name)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59a98839/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 4f3f9ec..bb0a524 100644
--- a/test/integration/smoke/test_affinity_groups.py
+++ b/test/integration/smoke/test_affinity_groups.py
@@ -152,10 +152,10 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
msg="Both VMs of affinity group %s are on the same host" % self.ag.name)
- @classmethod
- def tearDownClass(cls):
- try:
- #Clean up, terminate the created templates
- cleanup_resources(cls.apiclient, cls._cleanup)
- except Exception as e:
- raise Exception("Warning: Exception during cleanup : %s" % e)
+ @classmethod
+ def tearDownClass(cls):
+ try:
+ #Clean up, terminate the created templates
+ cleanup_resources(cls.apiclient, cls._cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)