Commit cc4d556b authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Fix software type usage

By default there is no sense to play with software type, since it's fixed in
slapos.testing.testcase.
parent 3d747c95
...@@ -487,12 +487,6 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase): ...@@ -487,12 +487,6 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase):
# minimise partition path # minimise partition path
__partition_reference__ = 'T-' __partition_reference__ = 'T-'
@classmethod
def getInstanceSoftwareType(cls):
# Because of unknown problem yet, the root instance software type changes
# from RootSoftwareInstance to '', so always request it with given type
return "RootSoftwareInstance"
@classmethod @classmethod
def prepareCertificate(cls): def prepareCertificate(cls):
cls.another_server_ca = CertificateAuthority("Another Server Root CA") cls.another_server_ca = CertificateAuthority("Another Server Root CA")
...@@ -920,18 +914,32 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -920,18 +914,32 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
return default_instance return default_instance
@classmethod @classmethod
def requestSlaves(cls): def requestSlaveInstance(cls, partition_reference, partition_parameter_kw):
software_url = cls.getSoftwareURL() software_url = cls.getSoftwareURL()
software_type = cls.getInstanceSoftwareType()
cls.logger.debug(
'requesting slave "%s" type: %r software:%s parameters:%s',
partition_reference, software_type, software_url, partition_parameter_kw)
return cls.slap.request(
software_release=software_url,
software_type=software_type,
partition_reference=partition_reference,
partition_parameter_kw=partition_parameter_kw,
shared=True
)
@classmethod
def requestSlaves(cls):
for slave_reference, partition_parameter_kw in cls\ for slave_reference, partition_parameter_kw in cls\
.getSlaveParameterDictDict().items(): .getSlaveParameterDictDict().items():
software_url = cls.getSoftwareURL()
software_type = cls.getInstanceSoftwareType()
cls.logger.debug( cls.logger.debug(
'requesting slave "%s" software:%s parameters:%s', 'requesting slave "%s" type: %r software:%s parameters:%s',
slave_reference, software_url, partition_parameter_kw) slave_reference, software_type, software_url, partition_parameter_kw)
cls.slap.request( cls.requestSlaveInstance(
software_release=software_url,
partition_reference=slave_reference, partition_reference=slave_reference,
partition_parameter_kw=partition_parameter_kw, partition_parameter_kw=partition_parameter_kw,
shared=True
) )
@classmethod @classmethod
...@@ -971,11 +979,9 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -971,11 +979,9 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
for slave_reference, partition_parameter_kw in cls\ for slave_reference, partition_parameter_kw in cls\
.getSlaveParameterDictDict().items(): .getSlaveParameterDictDict().items():
parameter_dict_list.append(cls.slap.request( parameter_dict_list.append(cls.requestSlaveInstance(
software_release=cls.getSoftwareURL(),
partition_reference=slave_reference, partition_reference=slave_reference,
partition_parameter_kw=partition_parameter_kw, partition_parameter_kw=partition_parameter_kw,
shared=True
).getConnectionParameterDict()) ).getConnectionParameterDict())
return parameter_dict_list return parameter_dict_list
...@@ -1009,14 +1015,11 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -1009,14 +1015,11 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
def updateSlaveConnectionParameterDictDict(cls): def updateSlaveConnectionParameterDictDict(cls):
cls.slave_connection_parameter_dict_dict = {} cls.slave_connection_parameter_dict_dict = {}
# run partition for slaves to be setup # run partition for slaves to be setup
request = cls.slap.request
for slave_reference, partition_parameter_kw in cls\ for slave_reference, partition_parameter_kw in cls\
.getSlaveParameterDictDict().items(): .getSlaveParameterDictDict().items():
slave_instance = request( slave_instance = cls.requestSlaveInstance(
software_release=cls.getSoftwareURL(),
partition_reference=slave_reference, partition_reference=slave_reference,
partition_parameter_kw=partition_parameter_kw, partition_parameter_kw=partition_parameter_kw,
shared=True
) )
cls.slave_connection_parameter_dict_dict[slave_reference] = \ cls.slave_connection_parameter_dict_dict[slave_reference] = \
slave_instance.getConnectionParameterDict() slave_instance.getConnectionParameterDict()
...@@ -5837,11 +5840,9 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5837,11 +5840,9 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
ssl_ca_crt=ca.certificate_pem, ssl_ca_crt=ca.certificate_pem,
) )
self.slap.request( self.requestSlaveInstance(
software_release=self.getSoftwareURL(),
partition_reference='custom_domain_ssl_crt_ssl_key_ssl_ca_crt', partition_reference='custom_domain_ssl_crt_ssl_key_ssl_ca_crt',
partition_parameter_kw=slave_parameter_dict, partition_parameter_kw=slave_parameter_dict,
shared=True
) )
self.slap.waitForInstance() self.slap.waitForInstance()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment