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

kvm: flak8ize test

parent 80ab4811
...@@ -888,7 +888,8 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin): ...@@ -888,7 +888,8 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin):
self.slap.waitForInstance(max_retry=10) self.slap.waitForInstance(max_retry=10)
super(InstanceTestCase, self).tearDown() super(InstanceTestCase, self).tearDown()
def getRunningImageList(self, kvm_instance_partition, def getRunningImageList(
self, kvm_instance_partition,
_match_cdrom=re.compile('file=(.+),media=cdrom$').match, _match_cdrom=re.compile('file=(.+),media=cdrom$').match,
_sub_iso=re.compile(r'(/debian)(-[^-/]+)(-[^/]+-netinst\.iso)$').sub, _sub_iso=re.compile(r'(/debian)(-[^-/]+)(-[^/]+-netinst\.iso)$').sub,
): ):
...@@ -903,8 +904,10 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin): ...@@ -903,8 +904,10 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin):
if m: if m:
path = m.group(1) path = m.group(1)
image_list.append( image_list.append(
_sub_iso(r'\1-${ver}\3', _sub_iso(
sub_shared(r'${shared}/', r'\1-${ver}\3',
sub_shared(
r'${shared}/',
path.replace(kvm_instance_partition, '${inst}') path.replace(kvm_instance_partition, '${inst}')
))) )))
return image_list return image_list
...@@ -1040,6 +1043,7 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin): ...@@ -1040,6 +1043,7 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin):
@skipUnlessKvm @skipUnlessKvm
class TestBootImageUrlListResilient(TestBootImageUrlList): class TestBootImageUrlListResilient(TestBootImageUrlList):
kvm_instance_partition_reference = 'biul2' kvm_instance_partition_reference = 'biul2'
@classmethod @classmethod
def getInstanceSoftwareType(cls): def getInstanceSoftwareType(cls):
return 'kvm-resilient' return 'kvm-resilient'
...@@ -1150,6 +1154,7 @@ class TestBootImageUrlSelect(TestBootImageUrlList): ...@@ -1150,6 +1154,7 @@ class TestBootImageUrlSelect(TestBootImageUrlList):
@skipUnlessKvm @skipUnlessKvm
class TestBootImageUrlSelectResilient(TestBootImageUrlSelect): class TestBootImageUrlSelectResilient(TestBootImageUrlSelect):
kvm_instance_partition_reference = 'bius2' kvm_instance_partition_reference = 'bius2'
@classmethod @classmethod
def getInstanceSoftwareType(cls): def getInstanceSoftwareType(cls):
return 'kvm-resilient' return 'kvm-resilient'
...@@ -1265,6 +1270,7 @@ class TestNatRulesKvmCluster(InstanceTestCase): ...@@ -1265,6 +1270,7 @@ class TestNatRulesKvmCluster(InstanceTestCase):
__partition_reference__ = 'nrkc' __partition_reference__ = 'nrkc'
nat_rules = ["100", "200", "300"] nat_rules = ["100", "200", "300"]
@classmethod @classmethod
def getInstanceSoftwareType(cls): def getInstanceSoftwareType(cls):
return 'kvm-cluster' return 'kvm-cluster'
...@@ -1341,6 +1347,7 @@ class TestWhitelistFirewall(InstanceTestCase): ...@@ -1341,6 +1347,7 @@ class TestWhitelistFirewall(InstanceTestCase):
@skipUnlessKvm @skipUnlessKvm
class TestWhitelistFirewallRequest(TestWhitelistFirewall): class TestWhitelistFirewallRequest(TestWhitelistFirewall):
whitelist_domains = '2.2.2.2 3.3.3.3\n4.4.4.4' whitelist_domains = '2.2.2.2 3.3.3.3\n4.4.4.4'
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
...@@ -1705,6 +1712,7 @@ class TestParameterDefault(InstanceTestCase, KvmMixin): ...@@ -1705,6 +1712,7 @@ class TestParameterDefault(InstanceTestCase, KvmMixin):
@skipUnlessKvm @skipUnlessKvm
class TestParameterResilient(TestParameterDefault): class TestParameterResilient(TestParameterDefault):
__partition_reference__ = 'pr' __partition_reference__ = 'pr'
@classmethod @classmethod
def getInstanceSoftwareType(cls): def getInstanceSoftwareType(cls):
return 'kvm-resilient' 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