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

kvm: flak8ize test

parent 8a172d3c
......@@ -455,8 +455,8 @@ class TestAccessDefaultBootstrap(MonitorAccessMixin, InstanceTestCase):
self.slap.waitForInstance(max_retry=10)
# END: mock .slapos-resource with tap.ipv4_addr
connection_parameter_dict = self.computer_partition\
.getConnectionParameterDict()
cp = self.computer_partition
connection_parameter_dict = cp.getConnectionParameterDict()
result = requests.get(connection_parameter_dict['url'], verify=False)
self.assertEqual(
......@@ -887,7 +887,8 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin):
self.slap.waitForInstance(max_retry=10)
super(InstanceTestCase, self).tearDown()
def getRunningImageList(self, kvm_instance_partition,
def getRunningImageList(
self, kvm_instance_partition,
_match_cdrom=re.compile('file=(.+),media=cdrom$').match,
_sub_iso=re.compile(r'(/debian)(-[^-/]+)(-[^/]+-netinst\.iso)$').sub,
):
......@@ -902,8 +903,10 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin):
if m:
path = m.group(1)
image_list.append(
_sub_iso(r'\1-${ver}\3',
sub_shared(r'${shared}/',
_sub_iso(
r'\1-${ver}\3',
sub_shared(
r'${shared}/',
path.replace(kvm_instance_partition, '${inst}')
)))
return image_list
......@@ -1039,6 +1042,7 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin):
@skipUnlessKvm
class TestBootImageUrlListResilient(TestBootImageUrlList):
kvm_instance_partition_reference = 'biul2'
@classmethod
def getInstanceSoftwareType(cls):
return 'kvm-resilient'
......@@ -1149,6 +1153,7 @@ class TestBootImageUrlSelect(TestBootImageUrlList):
@skipUnlessKvm
class TestBootImageUrlSelectResilient(TestBootImageUrlSelect):
kvm_instance_partition_reference = 'bius2'
@classmethod
def getInstanceSoftwareType(cls):
return 'kvm-resilient'
......@@ -1264,6 +1269,7 @@ class TestNatRulesKvmCluster(InstanceTestCase):
__partition_reference__ = 'nrkc'
nat_rules = ["100", "200", "300"]
@classmethod
def getInstanceSoftwareType(cls):
return 'kvm-cluster'
......@@ -1340,6 +1346,7 @@ class TestWhitelistFirewall(InstanceTestCase):
@skipUnlessKvm
class TestWhitelistFirewallRequest(TestWhitelistFirewall):
whitelist_domains = '2.2.2.2 3.3.3.3\n4.4.4.4'
@classmethod
def getInstanceParameterDict(cls):
return {
......@@ -1704,6 +1711,7 @@ class TestParameterDefault(InstanceTestCase, KvmMixin):
@skipUnlessKvm
class TestParameterResilient(TestParameterDefault):
__partition_reference__ = 'pr'
@classmethod
def getInstanceSoftwareType(cls):
return 'kvm-resilient'
......
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