Skip to content

Commit 571a361

Browse files
DaanHooglandDaan Hoogland
andauthored
tests: component test ports/fixes in python3 (#5082)
* cleanup plan * more robust cleanup within member method * ss_domain_limits fixed * egress 'icmp' instead of 'all' and cleanup * configdrive syntax, fixed to be up to par with py2 * cleanup fixed the lb secondary ip tests? * deal with different base64 encoding in py3 for userdata * cleanup of multiple_ips_per_nic * cleanup and reformat of test_volumes * cleanup and fixes for test_ps_domain_limits.py * cleanup and fix of test_ps_limits.py * fix occasional match of float against int * cleanup and fix test_ps_resize_volume.py * cleanup and fix test_snapshots * cleanup ss_max_limits and fix for float vs int problem in API * mere cleanup of test_volume_destroy_recover * add missing command creation * cleanup of test_vpc_on_host_maintenance * cleanup test_vpc_network * cleanup, comments and logging in test_vpc_network_lbrules * cleanup of test_vpc_network_pfrules * cleanup and format code for test_vpc_network_staticnatrule * f string instead of conversion specifiers * check http and ssh fix and cleanup (for vpc pfrules tests) * generalise create network method * make ip optional in creating webserver * remove unused code and add rules to enable ssh * more cleanup * remove unused code and cleanup * small cleanup, mostly precarous run environment required * cleanup and removed unused code * advancedsg only, cleanup, pulled in services * reformat/cleanup * log result of error after verify rule * add nw_off_no_services * tags=["TODO"] for escalations_networks * tags=["TODO"] for organization_states * tags=["TODO"] for browse_templates * tags=["TODO"] for configdrive * tags=["TODO"] for vpc_vms_deployment * add remove network cleanup and fixes * move tests that fail on all platforms out of the way Co-authored-by: Daan Hoogland <[email protected]>
1 parent 37761c6 commit 571a361

File tree

61 files changed

+3547
-4059
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3547
-4059
lines changed

test/integration/component/maint/test_escalation_templates.py renamed to test/integration/broken/maint/test_escalation_templates.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,8 @@ def setUpClass(cls):
8888

8989
@classmethod
9090
def tearDownClass(cls):
91-
try:
92-
# Cleanup resources used
93-
cleanup_resources(cls.apiclient, cls.cleanup)
91+
super(TestlistTemplates, cls).tearDownClass()
9492

95-
except Exception as e:
96-
raise Exception("Warning: Exception during cleanup : %s" % e)
97-
return
9893
def RestartServers(self):
9994
""" Restart management server and usage server """
10095

test/integration/component/maint/test_vpc_on_host_maintenance.py renamed to test/integration/broken/maint/test_vpc_on_host_maintenance.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from nose.plugins.attrib import attr
1919
from marvin.cloudstackTestCase import cloudstackTestCase
2020
import unittest
21-
from marvin.lib.utils import cleanup_resources
2221
from marvin.lib.base import (Account,
2322
Host,
2423
VPC,
@@ -58,6 +57,7 @@ def setUpClass(cls):
5857
cls.api_client,
5958
cls.services["vpc_offering"]
6059
)
60+
cls._cleanup.append(cls.vpc_off)
6161
cls.vpc_off.update(cls.api_client, state='Enabled')
6262
cls.hosts = Host.list(
6363
cls.api_client,
@@ -93,15 +93,11 @@ def setUpClass(cls):
9393
"Failed to enable maintenance mode on %s" %
9494
host.name)
9595
timeout = timeout - 1
96-
97-
cls._cleanup.append(cls.vpc_off)
9896
return
9997

10098
@classmethod
10199
def tearDownClass(cls):
102100
try:
103-
# Cleanup resources used
104-
cleanup_resources(cls.api_client, cls._cleanup)
105101
for host in cls.hosts:
106102
Host.cancelMaintenance(
107103
cls.api_client,
@@ -117,7 +113,9 @@ def tearDownClass(cls):
117113
"Failed to cancel maintenance mode on %s" %
118114
(host.name))
119115
except Exception as e:
120-
raise Exception("Warning: Exception during cleanup : %s" % e)
116+
raise Exception("Warning: Exception during resetting hosts maintenance : %s" % e)
117+
finally:
118+
super(TestVPCHostMaintenance, cls).tearDownClass()
121119
return
122120

123121
def setUp(self):
@@ -138,12 +136,7 @@ def setUp(self):
138136
return
139137

140138
def tearDown(self):
141-
try:
142-
# Clean up, terminate the created network offerings
143-
cleanup_resources(self.apiclient, self.cleanup)
144-
except Exception as e:
145-
raise Exception("Warning: Exception during cleanup : %s" % e)
146-
return
139+
super(TestVPCHostMaintenance, self).tearDown()
147140

148141
def validate_vpc_offering(self, vpc_offering):
149142
"""Validates the VPC offering"""
@@ -217,5 +210,6 @@ def test_01_create_vpc_host_maintenance(self):
217210
domainid=self.account.domainid,
218211
start=False
219212
)
213+
self.cleanup.append(vpc)
220214
self.validate_vpc_network(vpc, state='enabled')
221215
return

0 commit comments

Comments
 (0)