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

caddy-frontend/test: Switch to slapos.testing.testcase

parent 2bd95ea0
...@@ -54,9 +54,6 @@ try: ...@@ -54,9 +54,6 @@ try:
except ImportError: except ImportError:
from backports import lzma from backports import lzma
from utils import SlapOSInstanceTestCase
from utils import findFreeTCPPort
import datetime import datetime
from cryptography import x509 from cryptography import x509
...@@ -66,6 +63,13 @@ from cryptography.hazmat.primitives import serialization ...@@ -66,6 +63,13 @@ from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID from cryptography.x509.oid import NameOID
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
from slapos.testing.utils import findFreeTCPPort
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
SLAPOS_TEST_IPV4 = os.environ['SLAPOS_TEST_IPV4'] SLAPOS_TEST_IPV4 = os.environ['SLAPOS_TEST_IPV4']
SLAPOS_TEST_IPV6 = os.environ['SLAPOS_TEST_IPV6'] SLAPOS_TEST_IPV6 = os.environ['SLAPOS_TEST_IPV6']
...@@ -467,12 +471,6 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase): ...@@ -467,12 +471,6 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase):
# show full diffs, as it is required for proper analysis of problems # show full diffs, as it is required for proper analysis of problems
maxDiff = None maxDiff = None
@classmethod
def getSoftwareURLList(cls):
return (
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
super(HttpFrontendTestCase, cls).setUpClass() super(HttpFrontendTestCase, cls).setUpClass()
...@@ -797,8 +795,8 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -797,8 +795,8 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
return False return False
for slave_reference, partition_parameter_kw in cls\ for slave_reference, partition_parameter_kw in cls\
.getSlaveParameterDictDict().items(): .getSlaveParameterDictDict().items():
parameter_dict = cls.slapos_controler.slap.registerOpenOrder().request( parameter_dict = cls.request(
software_release=cls.software_url_list[0], 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 shared=True
...@@ -815,11 +813,11 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -815,11 +813,11 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
@classmethod @classmethod
def setUpSlaves(cls): def setUpSlaves(cls):
cls.slave_connection_parameter_dict_dict = {} cls.slave_connection_parameter_dict_dict = {}
request = cls.slapos_controler.slap.registerOpenOrder().request 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 = request(
software_release=cls.software_url_list[0], 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 shared=True
...@@ -830,7 +828,7 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -830,7 +828,7 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
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 = request(
software_release=cls.software_url_list[0], 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 shared=True
...@@ -5917,8 +5915,8 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5917,8 +5915,8 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
ssl_ca_crt=ca.certificate_pem, ssl_ca_crt=ca.certificate_pem,
) )
self.slapos_controler.slap.registerOpenOrder().request( self.request(
software_release=self.software_url_list[0], software_release=self.cls.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 shared=True
......
This diff is collapsed.
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