Skip to content

Commit f866bb2

Browse files
author
SrikanteswaraRao Talluri
committed
CLOUDSTACK-6316: Fixed component and smoke test failures-third pass
1 parent 8df1c71 commit f866bb2

16 files changed

Lines changed: 229 additions & 147 deletions

test/integration/component/test_allocation_states.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
Zone,
2424
Cluster,
2525
StoragePool)
26-
from marvin.lib.common import get_zone
27-
26+
from marvin.lib.common import get_zone, get_template
27+
from marvin.codes import FAILED
2828
class Services:
2929
"""Test Resource Limits Services
3030
"""
@@ -85,13 +85,23 @@ class TestAllocationState(cloudstackTestCase):
8585

8686
@classmethod
8787
def setUpClass(cls):
88-
cls.api_client = super(
89-
TestAllocationState,
90-
cls
91-
).getClsTestClient().getApiClient()
88+
cls.testClient = super(TestAllocationState, cls).getClsTestClient()
89+
cls.api_client = cls.testClient.getApiClient()
90+
9291
cls.services = Services().services
92+
9393
# Get Zone, Domain and templates
94-
cls.zone = get_zone(cls.api_client, cls.services)
94+
95+
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
96+
cls.template = get_template(
97+
cls.api_client,
98+
cls.zone.id,
99+
cls.services["ostype"]
100+
)
101+
if cls.template == FAILED:
102+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
103+
104+
95105
cls.services['mode'] = cls.zone.networktype
96106
cls._cleanup = []
97107
return

test/integration/component/test_dynamic_compute_offering.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,22 @@ class TestDynamicServiceOffering(cloudstackTestCase):
3838

3939
@classmethod
4040
def setUpClass(cls):
41-
cloudstackTestClient = super(TestDynamicServiceOffering,cls).getClsTestClient()
42-
cls.api_client = cloudstackTestClient.getApiClient()
43-
44-
# Fill services from the external config file
45-
cls.services = cloudstackTestClient.getConfigParser().parsedDict
41+
testClient = super(TestDynamicServiceOffering, cls).getClsTestClient()
42+
cls.apiclient = testClient.getApiClient()
43+
cls.services = testClient.getParsedTestDataConfig()
4644

4745
# Get Zone, Domain and templates
48-
cls.domain = get_domain(cls.api_client, cls.services)
49-
cls.zone = get_zone(cls.api_client, cls.services)
50-
cls.mode = str(cls.zone.networktype).lower()
51-
cls.template = get_template(
52-
cls.api_client,
53-
cls.zone.id,
54-
cls.services["ostype"]
55-
)
46+
domain = get_domain(cls.apiclient)
47+
cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
48+
cls.services['mode'] = cls.zone.networktype
49+
50+
template = get_template(
51+
cls.apiclient,
52+
cls.zone.id,
53+
cls.services["ostype"]
54+
)
55+
if template == FAILED:
56+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
5657
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
5758
cls.services["virtual_machine"]["template"] = cls.template.id
5859
cls._cleanup = []

test/integration/component/test_ip_reservation.py

Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,22 @@ class TestIpReservation(cloudstackTestCase):
8080
"""
8181
@classmethod
8282
def setUpClass(cls):
83-
cloudstackTestClient = super(TestIpReservation, cls).getClsTestClient()
84-
cls.api_client = cloudstackTestClient.getApiClient()
85-
# Fill test data from the external config file
86-
cls.testData = cloudstackTestClient.getConfigParser().parsedDict
83+
cls.testClient = super(TestIpReservation, cls).getClsTestClient()
84+
cls.api_client = cls.testClient.getApiClient()
85+
86+
# Fill services from the external config file
87+
cls.services = cls.testClient.getConfigParser().parsedDict
88+
8789
# Get Zone, Domain and templates
8890
cls.domain = get_domain(cls.api_client)
8991
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
9092
cls.template = get_template(
9193
cls.api_client,
9294
cls.zone.id,
93-
cls.testData["ostype"]
95+
cls.services["ostype"]
9496
)
97+
if cls.template == FAILED:
98+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
9599
cls.testData["domainid"] = cls.domain.id
96100
cls.testData["zoneid"] = cls.zone.id
97101
cls.testData["virtual_machine"]["zoneid"] = cls.zone.id
@@ -524,18 +528,22 @@ class TestRestartNetwork(cloudstackTestCase):
524528
"""
525529
@classmethod
526530
def setUpClass(cls):
527-
cloudstackTestClient = super(TestRestartNetwork, cls).getClsTestClient()
528-
cls.api_client = cloudstackTestClient.getApiClient()
529-
# Fill test data from the external config file
530-
cls.testData = cloudstackTestClient.getConfigParser().parsedDict
531+
cls.testClient = super(TestRestartNetwork, cls).getClsTestClient()
532+
cls.api_client = cls.testClient.getApiClient()
533+
534+
# Fill services from the external config file
535+
cls.services = cls.testClient.getConfigParser().parsedDict
536+
531537
# Get Zone, Domain and templates
532-
cls.domain = get_domain(cls.api_client, cls.testData)
533-
cls.zone = get_zone(cls.api_client, cls.testData)
538+
cls.domain = get_domain(cls.api_client)
539+
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
534540
cls.template = get_template(
535541
cls.api_client,
536542
cls.zone.id,
537-
cls.testData["ostype"]
543+
cls.services["ostype"]
538544
)
545+
if cls.template == FAILED:
546+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
539547
cls.testData["domainid"] = cls.domain.id
540548
cls.testData["zoneid"] = cls.zone.id
541549
cls.testData["virtual_machine"]["zoneid"] = cls.zone.id
@@ -645,18 +653,22 @@ class TestUpdateIPReservation(cloudstackTestCase):
645653
"""
646654
@classmethod
647655
def setUpClass(cls):
648-
cloudstackTestClient = super(TestUpdateIPReservation, cls).getClsTestClient()
649-
cls.api_client = cloudstackTestClient.getApiClient()
650-
# Fill test data from the external config file
651-
cls.testData = cloudstackTestClient.getConfigParser().parsedDict
656+
cls.testClient = super(TestUpdateIPReservation, cls).getClsTestClient()
657+
cls.api_client = cls.testClient.getApiClient()
658+
659+
# Fill services from the external config file
660+
cls.services = cls.testClient.getConfigParser().parsedDict
661+
652662
# Get Zone, Domain and templates
653-
cls.domain = get_domain(cls.api_client, cls.testData)
654-
cls.zone = get_zone(cls.api_client, cls.testData)
663+
cls.domain = get_domain(cls.api_client)
664+
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
655665
cls.template = get_template(
656666
cls.api_client,
657667
cls.zone.id,
658-
cls.testData["ostype"]
668+
cls.services["ostype"]
659669
)
670+
if cls.template == FAILED:
671+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
660672
cls.testData["domainid"] = cls.domain.id
661673
cls.testData["zoneid"] = cls.zone.id
662674
cls.testData["virtual_machine"]["zoneid"] = cls.zone.id
@@ -791,18 +803,22 @@ class TestRouterOperations(cloudstackTestCase):
791803
"""
792804
@classmethod
793805
def setUpClass(cls):
794-
cloudstackTestClient = super(TestRouterOperations, cls).getClsTestClient()
795-
cls.api_client = cloudstackTestClient.getApiClient()
796-
# Fill test data from the external config file
797-
cls.testData = cloudstackTestClient.getConfigParser().parsedDict
806+
cls.testClient = super(TestRouterOperations, cls).getClsTestClient()
807+
cls.api_client = cls.testClient.getApiClient()
808+
809+
# Fill services from the external config file
810+
cls.services = cls.testClient.getConfigParser().parsedDict
811+
798812
# Get Zone, Domain and templates
799-
cls.domain = get_domain(cls.api_client, cls.testData)
800-
cls.zone = get_zone(cls.api_client, cls.testData)
813+
cls.domain = get_domain(cls.api_client)
814+
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
801815
cls.template = get_template(
802816
cls.api_client,
803817
cls.zone.id,
804-
cls.testData["ostype"]
818+
cls.services["ostype"]
805819
)
820+
if cls.template == FAILED:
821+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
806822
cls.testData["domainid"] = cls.domain.id
807823
cls.testData["zoneid"] = cls.zone.id
808824
cls.testData["virtual_machine"]["zoneid"] = cls.zone.id
@@ -957,18 +973,22 @@ class TestFailureScnarios(cloudstackTestCase):
957973
"""
958974
@classmethod
959975
def setUpClass(cls):
960-
cloudstackTestClient = super(TestFailureScnarios, cls).getClsTestClient()
961-
cls.api_client = cloudstackTestClient.getApiClient()
962-
# Fill test data from the external config file
963-
cls.testData = cloudstackTestClient.getConfigParser().parsedDict
976+
cls.testClient = super(TestFailureScnarios, cls).getClsTestClient()
977+
cls.api_client = cls.testClient.getApiClient()
978+
979+
# Fill services from the external config file
980+
cls.services = cls.testClient.getConfigParser().parsedDict
981+
964982
# Get Zone, Domain and templates
965-
cls.domain = get_domain(cls.api_client, cls.testData)
966-
cls.zone = get_zone(cls.api_client, cls.testData)
983+
cls.domain = get_domain(cls.api_client)
984+
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
967985
cls.template = get_template(
968986
cls.api_client,
969987
cls.zone.id,
970-
cls.testData["ostype"]
988+
cls.services["ostype"]
971989
)
990+
if cls.template == FAILED:
991+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
972992
cls.testData["domainid"] = cls.domain.id
973993
cls.testData["zoneid"] = cls.zone.id
974994
cls.testData["virtual_machine"]["zoneid"] = cls.zone.id

test/integration/component/test_multiple_ips_per_nic.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,23 @@ class TestBasicOperations(cloudstackTestCase):
119119

120120
@classmethod
121121
def setUpClass(cls):
122-
cloudstackTestClient = super(TestBasicOperations,cls).getClsTestClient()
123-
cls.api_client = cloudstackTestClient.getApiClient()
122+
cls.testClient = super(TestBasicOperations, cls).getClsTestClient()
123+
cls.api_client = cls.testClient.getApiClient()
124124

125125
# Fill services from the external config file
126-
cls.services = cloudstackTestClient.getConfigParser().parsedDict
126+
cls.services = cls.testClient.getConfigParser().parsedDict
127127

128128
# Get Zone, Domain and templates
129-
cls.domain = get_domain(cls.api_client, cls.services)
130-
cls.zone = get_zone(cls.api_client, cls.services)
131-
cls.mode = str(cls.zone.networktype).lower()
129+
cls.domain = get_domain(cls.api_client)
130+
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
132131
cls.template = get_template(
133132
cls.api_client,
134133
cls.zone.id,
135134
cls.services["ostype"]
136135
)
136+
if cls.template == FAILED:
137+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
138+
137139
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
138140
cls.services["virtual_machine"]["template"] = cls.template.id
139141
cls.service_offering = ServiceOffering.create(
@@ -468,21 +470,23 @@ class TestNetworkRules(cloudstackTestCase):
468470

469471
@classmethod
470472
def setUpClass(cls):
471-
cloudstackTestClient = super(TestNetworkRules,cls).getClsTestClient()
472-
cls.api_client = cloudstackTestClient.getApiClient()
473+
cls.testClient = super(TestNetworkRules, cls).getClsTestClient()
474+
cls.api_client = cls.testClient.getApiClient()
473475

474476
# Fill services from the external config file
475-
cls.services = cloudstackTestClient.getConfigParser().parsedDict
477+
cls.services = cls.testClient.getConfigParser().parsedDict
476478

477479
# Get Zone, Domain and templates
478-
cls.domain = get_domain(cls.api_client, cls.services)
479-
cls.zone = get_zone(cls.api_client, cls.services)
480-
cls.mode = str(cls.zone.networktype).lower()
480+
cls.domain = get_domain(cls.api_client)
481+
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
481482
cls.template = get_template(
482483
cls.api_client,
483484
cls.zone.id,
484485
cls.services["ostype"]
485486
)
487+
if cls.template == FAILED:
488+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
489+
486490
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
487491
cls.services["virtual_machine"]["template"] = cls.template.id
488492
cls.service_offering = ServiceOffering.create(
@@ -841,21 +845,22 @@ class TestVmNetworkOperations(cloudstackTestCase):
841845

842846
@classmethod
843847
def setUpClass(cls):
844-
cloudstackTestClient = super(TestVmNetworkOperations,cls).getClsTestClient()
845-
cls.api_client = cloudstackTestClient.getApiClient()
848+
cls.testClient = super(TestVmNetworkOperations, cls).getClsTestClient()
849+
cls.api_client = cls.testClient.getApiClient()
846850

847851
# Fill services from the external config file
848-
cls.services = cloudstackTestClient.getConfigParser().parsedDict
852+
cls.services = cls.testClient.getConfigParser().parsedDict
849853

850854
# Get Zone, Domain and templates
851-
cls.domain = get_domain(cls.api_client, cls.services)
852-
cls.zone = get_zone(cls.api_client, cls.services)
853-
cls.mode = str(cls.zone.networktype).lower()
855+
cls.domain = get_domain(cls.api_client)
856+
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
854857
cls.template = get_template(
855858
cls.api_client,
856859
cls.zone.id,
857860
cls.services["ostype"]
858861
)
862+
if cls.template == FAILED:
863+
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
859864
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
860865
cls.services["virtual_machine"]["template"] = cls.template.id
861866
cls.service_offering = ServiceOffering.create(

test/integration/component/test_non_contiguous_vlan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def tearDownClass(cls):
125125

126126
def setUp(self):
127127
self.apiclient = self.testClient.getApiClient()
128-
self.vlan = self.services["vlan_new"]
128+
self.vlan = self.services["vlan_nc"]
129129
self.apiClient = self.testClient.getApiClient()
130130

131131
self.physicalnetwork, self.vlan = setNonContiguousVlanIds(self.apiclient, self.zone.id)

0 commit comments

Comments
 (0)