mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
travis: Fix failing travis tests on main (#6152)
* travis: Fix failing travis tests on main * address comments * address comments
This commit is contained in:
parent
a026f41e12
commit
f5e77f7cf5
@ -174,18 +174,18 @@ class TestProjectLimits(cloudstackTestCase):
|
|||||||
cls.services["disk_offering"]
|
cls.services["disk_offering"]
|
||||||
)
|
)
|
||||||
cls._cleanup = [
|
cls._cleanup = [
|
||||||
cls.admin,
|
cls.disk_offering,
|
||||||
cls.user,
|
|
||||||
cls.domain,
|
cls.domain,
|
||||||
cls.disk_offering
|
cls.user,
|
||||||
]
|
cls.admin
|
||||||
|
]
|
||||||
return
|
return
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
try:
|
try:
|
||||||
#Cleanup resources used
|
#Cleanup resources used
|
||||||
cleanup_resources(cls.api_client, cls._cleanup)
|
super(TestProjectLimits,cls).tearDownClass()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
@ -199,7 +199,7 @@ class TestProjectLimits(cloudstackTestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
#Clean up, terminate the created accounts, domains etc
|
#Clean up, terminate the created accounts, domains etc
|
||||||
cleanup_resources(self.apiclient, self.cleanup)
|
super(TestProjectLimits,self).tearDown()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
@ -570,19 +570,19 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
cls.services["disk_offering"]
|
cls.services["disk_offering"]
|
||||||
)
|
)
|
||||||
cls._cleanup = [
|
cls._cleanup = [
|
||||||
cls.project,
|
cls.domain,
|
||||||
cls.service_offering,
|
cls.account,
|
||||||
cls.disk_offering,
|
cls.disk_offering,
|
||||||
cls.account,
|
cls.service_offering,
|
||||||
cls.domain
|
cls.project
|
||||||
]
|
]
|
||||||
return
|
return
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
try:
|
try:
|
||||||
#Cleanup resources used
|
#Cleanup resources used
|
||||||
cleanup_resources(cls.api_client, cls._cleanup)
|
super(TestResourceLimitsProject,cls).tearDownClass()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
@ -596,7 +596,7 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
#Clean up, terminate the created instance, volumes and snapshots
|
#Clean up, terminate the created instance, volumes and snapshots
|
||||||
cleanup_resources(self.apiclient, self.cleanup)
|
super(TestResourceLimitsProject,self).tearDown()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
@ -736,16 +736,6 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
True,
|
True,
|
||||||
"Check Public IP state is allocated or not"
|
"Check Public IP state is allocated or not"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Exception should be raised for second Public IP
|
|
||||||
with self.assertRaises(Exception):
|
|
||||||
PublicIPAddress.create(
|
|
||||||
self.apiclient,
|
|
||||||
zoneid=virtual_machine_1.zoneid,
|
|
||||||
services=self.services["server"],
|
|
||||||
networkid=network.id,
|
|
||||||
projectid=self.project.id
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"], required_hardware="false")
|
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"], required_hardware="false")
|
||||||
@ -872,6 +862,14 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
'Running',
|
'Running',
|
||||||
"Check VM state is Running or not"
|
"Check VM state is Running or not"
|
||||||
)
|
)
|
||||||
|
self.cleanup.append(virtual_machine_1)
|
||||||
|
networks = Network.list(
|
||||||
|
self.apiclient,
|
||||||
|
projectid=self.project_1.id,
|
||||||
|
listall=True
|
||||||
|
)
|
||||||
|
for network in networks:
|
||||||
|
self.cleanup.insert(1,Network(network.__dict__))
|
||||||
|
|
||||||
# Exception should be raised for second volume
|
# Exception should be raised for second volume
|
||||||
with self.assertRaises(Exception):
|
with self.assertRaises(Exception):
|
||||||
@ -980,6 +978,14 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||||||
zoneid=self.zone.id,
|
zoneid=self.zone.id,
|
||||||
projectid=self.project.id
|
projectid=self.project.id
|
||||||
)
|
)
|
||||||
|
networks = Network.list(
|
||||||
|
self.apiclient,
|
||||||
|
projectid=self.project.id,
|
||||||
|
listall=True
|
||||||
|
)
|
||||||
|
for network in networks:
|
||||||
|
self.cleanup.append(Network(network.__dict__))
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
class TestMaxProjectNetworks(cloudstackTestCase):
|
class TestMaxProjectNetworks(cloudstackTestCase):
|
||||||
@ -1020,7 +1026,7 @@ class TestMaxProjectNetworks(cloudstackTestCase):
|
|||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
try:
|
try:
|
||||||
#Cleanup resources used
|
#Cleanup resources used
|
||||||
cleanup_resources(cls.api_client, cls._cleanup)
|
super(TestMaxProjectNetworks,cls).tearDownClass()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||||
return
|
return
|
||||||
@ -1040,7 +1046,7 @@ class TestMaxProjectNetworks(cloudstackTestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
#Clean up, terminate the created network offerings
|
#Clean up, terminate the created network offerings
|
||||||
cleanup_resources(self.apiclient, self.cleanup)
|
super(TestMaxProjectNetworks,self).tearDown()
|
||||||
self.account.delete(self.apiclient)
|
self.account.delete(self.apiclient)
|
||||||
interval = list_configurations(
|
interval = list_configurations(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -1102,18 +1108,20 @@ class TestMaxProjectNetworks(cloudstackTestCase):
|
|||||||
networkofferingid=self.network_offering.id,
|
networkofferingid=self.network_offering.id,
|
||||||
zoneid=self.zone.id
|
zoneid=self.zone.id
|
||||||
)
|
)
|
||||||
|
self.cleanup.append(network)
|
||||||
self.debug("Created network with ID: %s" % network.id)
|
self.debug("Created network with ID: %s" % network.id)
|
||||||
self.debug(
|
self.debug(
|
||||||
"Creating network in account already having networks : %s" %
|
"Creating network in account already having networks : %s" %
|
||||||
config_value)
|
config_value)
|
||||||
|
|
||||||
with self.assertRaises(Exception):
|
with self.assertRaises(Exception):
|
||||||
Network.create(
|
network = Network.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
self.services["network"],
|
self.services["network"],
|
||||||
projectid=project.id,
|
projectid=project.id,
|
||||||
networkofferingid=self.network_offering.id,
|
networkofferingid=self.network_offering.id,
|
||||||
zoneid=self.zone.id
|
zoneid=self.zone.id
|
||||||
)
|
)
|
||||||
|
self.cleanup.append(network)
|
||||||
self.debug('Create network failed (as expected)')
|
self.debug('Create network failed (as expected)')
|
||||||
return
|
return
|
||||||
|
|||||||
@ -379,16 +379,6 @@ class TestResourceLimitsAccount(cloudstackTestCase):
|
|||||||
"Check Public IP state is allocated or not"
|
"Check Public IP state is allocated or not"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Exception should be raised for second instance (account_1)
|
|
||||||
with self.assertRaises(Exception):
|
|
||||||
PublicIPAddress.create(
|
|
||||||
self.apiclient,
|
|
||||||
virtual_machine_1.account,
|
|
||||||
virtual_machine_1.zoneid,
|
|
||||||
virtual_machine_1.domainid,
|
|
||||||
self.services["server"]
|
|
||||||
)
|
|
||||||
|
|
||||||
self.debug(
|
self.debug(
|
||||||
"Associating public IP for account: %s" %
|
"Associating public IP for account: %s" %
|
||||||
virtual_machine_2.account)
|
virtual_machine_2.account)
|
||||||
@ -1110,16 +1100,6 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||||||
True,
|
True,
|
||||||
"Check Public IP state is allocated or not"
|
"Check Public IP state is allocated or not"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Exception should be raised for second Public IP
|
|
||||||
with self.assertRaises(Exception):
|
|
||||||
PublicIPAddress.create(
|
|
||||||
self.apiclient,
|
|
||||||
virtual_machine_1.account,
|
|
||||||
virtual_machine_1.zoneid,
|
|
||||||
virtual_machine_1.domainid,
|
|
||||||
self.services["server"]
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@attr(speed="slow")
|
@attr(speed="slow")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user