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

kvm: Switch default and kvm-cluster to json-in-xml

default and kvm-cluster software types are now json-in-xml, so they accept
and return json-in-xml.

Update tests to show that xml and json-in-xml serialization works.

Note: There was invective to publish with pure XML serialisation, but it is
wrong idea because:

 1) serialisation in the software.cfg.json is provided for both ways
 2) requesting instances with given serialisation by profiles expect same
    serialisation

Request resilient instances with serialised, as they reply with json-in-xml.
parent d0589a41
...@@ -19,15 +19,15 @@ md5sum = 7e90da1f6dac4233e1aa3248f48e357c ...@@ -19,15 +19,15 @@ md5sum = 7e90da1f6dac4233e1aa3248f48e357c
[template-kvm] [template-kvm]
filename = instance-kvm.cfg.jinja2 filename = instance-kvm.cfg.jinja2
md5sum = fb8f9a962cc1c0d986305c6a6ce59082 md5sum = 42fa6306968516fc9ea9b690ad3b645e
[template-kvm-cluster] [template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in filename = instance-kvm-cluster.cfg.jinja2.in
md5sum = 8562882ac4a888d18db50e2a22e3ca86 md5sum = 406bf455afe1c71cb0e8cc04dd877f1d
[template-kvm-resilient] [template-kvm-resilient]
filename = instance-kvm-resilient.cfg.jinja2 filename = instance-kvm-resilient.cfg.jinja2
md5sum = a0fd4911401cbbda74323e8d1c7b18ad md5sum = 839fc16c112d3b87e2dbd2e382e326de
[template-kvm-import] [template-kvm-import]
filename = instance-kvm-import.cfg.jinja2.in filename = instance-kvm-import.cfg.jinja2.in
......
...@@ -32,7 +32,6 @@ global-ipv6 = {{ ipv6 }} ...@@ -32,7 +32,6 @@ global-ipv6 = {{ ipv6 }}
{% endfor -%} {% endfor -%}
[request-common] [request-common]
recipe = slapos.cookbook:request
software-url = ${slap-connection:software-release-url} software-url = ${slap-connection:software-release-url}
server-url = ${slap-connection:server-url} server-url = ${slap-connection:server-url}
key-file = ${slap-connection:key-file} key-file = ${slap-connection:key-file}
...@@ -47,6 +46,7 @@ config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }} ...@@ -47,6 +46,7 @@ config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}
{% set use_nat = kvm_parameter_dict.get('use-nat', True) -%} {% set use_nat = kvm_parameter_dict.get('use-nat', True) -%}
[{{ section }}] [{{ section }}]
<= request-common <= request-common
recipe = slapos.cookbook:request.serialised
software-type = kvm software-type = kvm
name = {{ instance_name }} name = {{ instance_name }}
{% if kvm_parameter_dict.get('sticky-computer', '') -%} {% if kvm_parameter_dict.get('sticky-computer', '') -%}
...@@ -319,7 +319,7 @@ private-path-list += ...@@ -319,7 +319,7 @@ private-path-list +=
[publish-connection-information] [publish-connection-information]
<= monitor-publish <= monitor-publish
-extends = publish-early -extends = publish-early
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish.serialised
{% for name, value in publish_dict.items() -%} {% for name, value in publish_dict.items() -%}
{{ name }} = {{ value }} {{ name }} = {{ value }}
{% endfor %} {% endfor %}
......
...@@ -61,6 +61,7 @@ etc = ${buildout:directory}/etc ...@@ -61,6 +61,7 @@ etc = ${buildout:directory}/etc
# Bubble down the parameters of the requested instance to the user # Bubble down the parameters of the requested instance to the user
[request-kvm] [request-kvm]
recipe = slapos.cookbook:request.serialised
# Note: += doesn't work. # Note: += doesn't work.
return = return =
# Resilient related parameters # Resilient related parameters
......
...@@ -819,7 +819,7 @@ blank-line = ...@@ -819,7 +819,7 @@ blank-line =
[publish-connection-information] [publish-connection-information]
<= monitor-publish <= monitor-publish
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish.serialised
ipv6 = ${slap-network-information:global-ipv6} ipv6 = ${slap-network-information:global-ipv6}
backend-url = https://[${novnc-instance:ip}]:${novnc-instance:port}/vnc.html?auto=1&encrypt=1&password=${kvm-controller-parameter-dict:vnc-passwd} backend-url = https://[${novnc-instance:ip}]:${novnc-instance:port}/vnc.html?auto=1&encrypt=1&password=${kvm-controller-parameter-dict:vnc-passwd}
url = ${request-slave-frontend:connection-secure_access}/vnc.html?auto=1&encrypt=1&password=${kvm-controller-parameter-dict:vnc-passwd} url = ${request-slave-frontend:connection-secure_access}/vnc.html?auto=1&encrypt=1&password=${kvm-controller-parameter-dict:vnc-passwd}
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"software-type": { "software-type": {
"default": { "default": {
"title": "Default", "title": "Default",
"serialisation": "json-in-xml",
"description": "Standalone KVM", "description": "Standalone KVM",
"request": "instance-kvm-input-schema.json", "request": "instance-kvm-input-schema.json",
"response": "instance-kvm-output-schema.json", "response": "instance-kvm-output-schema.json",
......
...@@ -118,6 +118,10 @@ bootstrap_machine_param_dict = { ...@@ -118,6 +118,10 @@ bootstrap_machine_param_dict = {
class KvmMixin(object): class KvmMixin(object):
def getConnectionParameterDictJson(self):
return json.loads(
self.computer_partition.getConnectionParameterDict()['_'])
def getProcessInfo(self): def getProcessInfo(self):
hash_value = generateHashFromFiles([ hash_value = generateHashFromFiles([
os.path.join(self.computer_partition_root_path, hash_file) os.path.join(self.computer_partition_root_path, hash_file)
...@@ -160,13 +164,25 @@ class KvmMixin(object): ...@@ -160,13 +164,25 @@ class KvmMixin(object):
state=state) state=state)
class KvmMixinJson(object):
@classmethod
def getInstanceParameterDict(cls):
return {
'_': json.dumps(super(KvmMixinJson, cls).getInstanceParameterDict())}
def rerequestInstance(self, parameter_dict, *args, **kwargs):
return super(KvmMixinJson, self).rerequestInstance(
parameter_dict={'_': json.dumps(parameter_dict)},
*args, **kwargs
)
@skipUnlessKvm @skipUnlessKvm
class TestInstance(InstanceTestCase, KvmMixin): class TestInstance(InstanceTestCase, KvmMixin):
__partition_reference__ = 'i' __partition_reference__ = 'i'
def test(self): def test(self):
connection_parameter_dict = self\ connection_parameter_dict = self.getConnectionParameterDictJson()
.computer_partition.getConnectionParameterDict()
present_key_list = [] present_key_list = []
assert_key_list = [ assert_key_list = [
'backend-url', 'url', 'monitor-setup-url', 'ipv6-network-info', 'backend-url', 'url', 'monitor-setup-url', 'ipv6-network-info',
...@@ -307,7 +323,12 @@ class TestMemoryManagement(InstanceTestCase, KvmMixin): ...@@ -307,7 +323,12 @@ class TestMemoryManagement(InstanceTestCase, KvmMixin):
) )
class MonitorAccessMixin(object): @skipUnlessKvm
class TestMemoryManagementJson(KvmMixinJson, TestMemoryManagement):
pass
class MonitorAccessMixin(KvmMixin):
def sqlite3_connect(self): def sqlite3_connect(self):
sqlitedb_file = os.path.join( sqlitedb_file = os.path.join(
os.path.abspath( os.path.abspath(
...@@ -334,8 +355,7 @@ class MonitorAccessMixin(object): ...@@ -334,8 +355,7 @@ class MonitorAccessMixin(object):
db.close() db.close()
def test_access_monitor(self): def test_access_monitor(self):
connection_parameter_dict = self.computer_partition\ connection_parameter_dict = self.getConnectionParameterDictJson()
.getConnectionParameterDict()
monitor_setup_url = connection_parameter_dict['monitor-setup-url'] monitor_setup_url = connection_parameter_dict['monitor-setup-url']
monitor_url_with_auth = 'https' + monitor_setup_url.split('https')[2] monitor_url_with_auth = 'https' + monitor_setup_url.split('https')[2]
...@@ -348,8 +368,8 @@ class MonitorAccessMixin(object): ...@@ -348,8 +368,8 @@ class MonitorAccessMixin(object):
connection_xml = partition_information.get('connection_xml') connection_xml = partition_information.get('connection_xml')
if not connection_xml: if not connection_xml:
continue continue
connection_dict = slapos.util.xml2dict( connection_dict = json.loads(slapos.util.xml2dict(
connection_xml if six.PY3 else connection_xml.encode('utf-8')) connection_xml if six.PY3 else connection_xml.encode('utf-8'))['_'])
monitor_base_url = connection_dict.get('monitor-base-url') monitor_base_url = connection_dict.get('monitor-base-url')
if not monitor_base_url: if not monitor_base_url:
continue continue
...@@ -376,8 +396,7 @@ class TestAccessDefault(MonitorAccessMixin, InstanceTestCase): ...@@ -376,8 +396,7 @@ class TestAccessDefault(MonitorAccessMixin, InstanceTestCase):
expected_partition_with_monitor_base_url_count = 1 expected_partition_with_monitor_base_url_count = 1
def test(self): def test(self):
connection_parameter_dict = self.computer_partition\ connection_parameter_dict = self.getConnectionParameterDictJson()
.getConnectionParameterDict()
result = requests.get(connection_parameter_dict['url'], verify=False) result = requests.get(connection_parameter_dict['url'], verify=False)
self.assertEqual( self.assertEqual(
httplib.OK, httplib.OK,
...@@ -387,6 +406,11 @@ class TestAccessDefault(MonitorAccessMixin, InstanceTestCase): ...@@ -387,6 +406,11 @@ class TestAccessDefault(MonitorAccessMixin, InstanceTestCase):
self.assertNotIn('url-additional', connection_parameter_dict) self.assertNotIn('url-additional', connection_parameter_dict)
@skipUnlessKvm
class TestAccessDefaultJson(KvmMixinJson, TestAccessDefault):
pass
@skipUnlessKvm @skipUnlessKvm
class TestAccessDefaultAdditional(MonitorAccessMixin, InstanceTestCase): class TestAccessDefaultAdditional(MonitorAccessMixin, InstanceTestCase):
__partition_reference__ = 'ada' __partition_reference__ = 'ada'
...@@ -399,8 +423,7 @@ class TestAccessDefaultAdditional(MonitorAccessMixin, InstanceTestCase): ...@@ -399,8 +423,7 @@ class TestAccessDefaultAdditional(MonitorAccessMixin, InstanceTestCase):
} }
def test(self): def test(self):
connection_parameter_dict = self.computer_partition\ connection_parameter_dict = self.getConnectionParameterDictJson()
.getConnectionParameterDict()
result = requests.get(connection_parameter_dict['url'], verify=False) result = requests.get(connection_parameter_dict['url'], verify=False)
self.assertEqual( self.assertEqual(
...@@ -418,6 +441,12 @@ class TestAccessDefaultAdditional(MonitorAccessMixin, InstanceTestCase): ...@@ -418,6 +441,12 @@ class TestAccessDefaultAdditional(MonitorAccessMixin, InstanceTestCase):
self.assertIn('<title>noVNC</title>', result.text) self.assertIn('<title>noVNC</title>', result.text)
@skipUnlessKvm
class TestAccessDefaultAdditionalJson(
KvmMixinJson, TestAccessDefaultAdditional):
pass
@skipUnlessKvm @skipUnlessKvm
class TestAccessDefaultBootstrap(MonitorAccessMixin, InstanceTestCase): class TestAccessDefaultBootstrap(MonitorAccessMixin, InstanceTestCase):
__partition_reference__ = 'adb' __partition_reference__ = 'adb'
...@@ -455,8 +484,7 @@ class TestAccessDefaultBootstrap(MonitorAccessMixin, InstanceTestCase): ...@@ -455,8 +484,7 @@ class TestAccessDefaultBootstrap(MonitorAccessMixin, InstanceTestCase):
self.slap.waitForInstance(max_retry=10) self.slap.waitForInstance(max_retry=10)
# END: mock .slapos-resource with tap.ipv4_addr # END: mock .slapos-resource with tap.ipv4_addr
cp = self.computer_partition connection_parameter_dict = self.getConnectionParameterDictJson()
connection_parameter_dict = cp.getConnectionParameterDict()
result = requests.get(connection_parameter_dict['url'], verify=False) result = requests.get(connection_parameter_dict['url'], verify=False)
self.assertEqual( self.assertEqual(
...@@ -492,8 +520,7 @@ class TestAccessKvmCluster(MonitorAccessMixin, InstanceTestCase): ...@@ -492,8 +520,7 @@ class TestAccessKvmCluster(MonitorAccessMixin, InstanceTestCase):
})} })}
def test(self): def test(self):
connection_parameter_dict = self.computer_partition\ connection_parameter_dict = self.getConnectionParameterDictJson()
.getConnectionParameterDict()
result = requests.get(connection_parameter_dict['KVM0-url'], verify=False) result = requests.get(connection_parameter_dict['KVM0-url'], verify=False)
self.assertEqual( self.assertEqual(
httplib.OK, httplib.OK,
...@@ -526,8 +553,7 @@ class TestAccessKvmClusterAdditional(MonitorAccessMixin, InstanceTestCase): ...@@ -526,8 +553,7 @@ class TestAccessKvmClusterAdditional(MonitorAccessMixin, InstanceTestCase):
})} })}
def test(self): def test(self):
connection_parameter_dict = self.computer_partition\ connection_parameter_dict = self.getConnectionParameterDictJson()
.getConnectionParameterDict()
result = requests.get(connection_parameter_dict['KVM0-url'], verify=False) result = requests.get(connection_parameter_dict['KVM0-url'], verify=False)
self.assertEqual( self.assertEqual(
httplib.OK, httplib.OK,
...@@ -570,8 +596,7 @@ class TestAccessKvmClusterBootstrap(MonitorAccessMixin, InstanceTestCase): ...@@ -570,8 +596,7 @@ class TestAccessKvmClusterBootstrap(MonitorAccessMixin, InstanceTestCase):
}))} }))}
def test(self): def test(self):
connection_parameter_dict = self.computer_partition\ connection_parameter_dict = self.getConnectionParameterDictJson()
.getConnectionParameterDict()
result = requests.get( result = requests.get(
connection_parameter_dict['test-machine1-url'], verify=False) connection_parameter_dict['test-machine1-url'], verify=False)
self.assertEqual( self.assertEqual(
...@@ -696,6 +721,12 @@ ir3:sshd-on-watch RUNNING""", ...@@ -696,6 +721,12 @@ ir3:sshd-on-watch RUNNING""",
) )
@skipUnlessKvm
class TestInstanceResilientJson(
KvmMixinJson, TestInstanceResilient):
pass
@skipUnlessKvm @skipUnlessKvm
class TestInstanceResilientDiskTypeIde(InstanceTestCase, KvmMixin): class TestInstanceResilientDiskTypeIde(InstanceTestCase, KvmMixin):
@classmethod @classmethod
...@@ -705,6 +736,12 @@ class TestInstanceResilientDiskTypeIde(InstanceTestCase, KvmMixin): ...@@ -705,6 +736,12 @@ class TestInstanceResilientDiskTypeIde(InstanceTestCase, KvmMixin):
} }
@skipUnlessKvm
class TestInstanceResilientDiskTypeIdeJson(
KvmMixinJson, TestInstanceResilientDiskTypeIde):
pass
@skipUnlessKvm @skipUnlessKvm
class TestAccessResilientAdditional(InstanceTestCase): class TestAccessResilientAdditional(InstanceTestCase):
__partition_reference__ = 'ara' __partition_reference__ = 'ara'
...@@ -740,6 +777,12 @@ class TestAccessResilientAdditional(InstanceTestCase): ...@@ -740,6 +777,12 @@ class TestAccessResilientAdditional(InstanceTestCase):
self.assertIn('<title>noVNC</title>', result.text) self.assertIn('<title>noVNC</title>', result.text)
@skipUnlessKvm
class TestAccessResilientAdditionalJson(
KvmMixinJson, TestAccessResilientAdditional):
pass
class TestInstanceNbdServer(InstanceTestCase): class TestInstanceNbdServer(InstanceTestCase):
__partition_reference__ = 'ins' __partition_reference__ = 'ins'
instance_max_retry = 5 instance_max_retry = 5
...@@ -768,6 +811,12 @@ class TestInstanceNbdServer(InstanceTestCase): ...@@ -768,6 +811,12 @@ class TestInstanceNbdServer(InstanceTestCase):
self.assertIn("WARNING", connection_parameter_dict['status_message']) self.assertIn("WARNING", connection_parameter_dict['status_message'])
@skipUnlessKvm
class TestInstanceNbdServerJson(
KvmMixinJson, TestInstanceNbdServer):
pass
class FakeImageHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): class FakeImageHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def log_message(self, *args): def log_message(self, *args):
if os.environ.get('SLAPOS_TEST_DEBUG'): if os.environ.get('SLAPOS_TEST_DEBUG'):
...@@ -1046,6 +1095,12 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin): ...@@ -1046,6 +1095,12 @@ class TestBootImageUrlList(InstanceTestCase, FakeImageServerMixin):
self.assertPromiseFails(self.config_state_promise) self.assertPromiseFails(self.config_state_promise)
@skipUnlessKvm
class TestBootImageUrlListJson(
KvmMixinJson, TestBootImageUrlList):
pass
@skipUnlessKvm @skipUnlessKvm
class TestBootImageUrlListResilient(TestBootImageUrlList): class TestBootImageUrlListResilient(TestBootImageUrlList):
kvm_instance_partition_reference = 'biul2' kvm_instance_partition_reference = 'biul2'
...@@ -1055,6 +1110,12 @@ class TestBootImageUrlListResilient(TestBootImageUrlList): ...@@ -1055,6 +1110,12 @@ class TestBootImageUrlListResilient(TestBootImageUrlList):
return 'kvm-resilient' return 'kvm-resilient'
@skipUnlessKvm
class TestBootImageUrlListResilientJson(
KvmMixinJson, TestBootImageUrlListResilient):
pass
@skipUnlessKvm @skipUnlessKvm
class TestBootImageUrlSelect(TestBootImageUrlList): class TestBootImageUrlSelect(TestBootImageUrlList):
__partition_reference__ = 'bius' __partition_reference__ = 'bius'
...@@ -1157,6 +1218,12 @@ class TestBootImageUrlSelect(TestBootImageUrlList): ...@@ -1157,6 +1218,12 @@ class TestBootImageUrlSelect(TestBootImageUrlList):
) )
@skipUnlessKvm
class TestBootImageUrlSelectJson(
KvmMixinJson, TestBootImageUrlSelect):
pass
@skipUnlessKvm @skipUnlessKvm
class TestBootImageUrlSelectResilient(TestBootImageUrlSelect): class TestBootImageUrlSelectResilient(TestBootImageUrlSelect):
kvm_instance_partition_reference = 'bius2' kvm_instance_partition_reference = 'bius2'
...@@ -1166,6 +1233,12 @@ class TestBootImageUrlSelectResilient(TestBootImageUrlSelect): ...@@ -1166,6 +1233,12 @@ class TestBootImageUrlSelectResilient(TestBootImageUrlSelect):
return 'kvm-resilient' return 'kvm-resilient'
@skipUnlessKvm
class TestBootImageUrlSelectResilientJson(
KvmMixinJson, TestBootImageUrlSelectResilient):
pass
@skipUnlessKvm @skipUnlessKvm
class TestBootImageUrlListKvmCluster(InstanceTestCase, FakeImageServerMixin): class TestBootImageUrlListKvmCluster(InstanceTestCase, FakeImageServerMixin):
__partition_reference__ = 'biulkc' __partition_reference__ = 'biulkc'
...@@ -1245,7 +1318,7 @@ class TestBootImageUrlSelectKvmCluster(TestBootImageUrlListKvmCluster): ...@@ -1245,7 +1318,7 @@ class TestBootImageUrlSelectKvmCluster(TestBootImageUrlListKvmCluster):
@skipUnlessKvm @skipUnlessKvm
class TestNatRules(InstanceTestCase): class TestNatRules(KvmMixin, InstanceTestCase):
__partition_reference__ = 'nr' __partition_reference__ = 'nr'
@classmethod @classmethod
...@@ -1255,8 +1328,7 @@ class TestNatRules(InstanceTestCase): ...@@ -1255,8 +1328,7 @@ class TestNatRules(InstanceTestCase):
} }
def test(self): def test(self):
connection_parameter_dict = self.computer_partition\ connection_parameter_dict = self.getConnectionParameterDictJson()
.getConnectionParameterDict()
self.assertIn('nat-rule-port-tcp-100', connection_parameter_dict) self.assertIn('nat-rule-port-tcp-100', connection_parameter_dict)
self.assertIn('nat-rule-port-tcp-200', connection_parameter_dict) self.assertIn('nat-rule-port-tcp-200', connection_parameter_dict)
...@@ -1271,6 +1343,12 @@ class TestNatRules(InstanceTestCase): ...@@ -1271,6 +1343,12 @@ class TestNatRules(InstanceTestCase):
) )
@skipUnlessKvm
class TestNatRulesJson(
KvmMixinJson, TestNatRules):
pass
@skipUnlessKvm @skipUnlessKvm
class TestNatRulesKvmCluster(InstanceTestCase): class TestNatRulesKvmCluster(InstanceTestCase):
__partition_reference__ = 'nrkc' __partition_reference__ = 'nrkc'
...@@ -1350,6 +1428,12 @@ class TestWhitelistFirewall(InstanceTestCase): ...@@ -1350,6 +1428,12 @@ class TestWhitelistFirewall(InstanceTestCase):
self.assertGreater(len(self.content_json), len(resolv_conf_ip_list)) self.assertGreater(len(self.content_json), len(resolv_conf_ip_list))
@skipUnlessKvm
class TestWhitelistFirewallJson(
KvmMixinJson, TestWhitelistFirewall):
pass
@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'
...@@ -1367,6 +1451,12 @@ class TestWhitelistFirewallRequest(TestWhitelistFirewall): ...@@ -1367,6 +1451,12 @@ class TestWhitelistFirewallRequest(TestWhitelistFirewall):
self.assertIn('4.4.4.4', self.content_json) self.assertIn('4.4.4.4', self.content_json)
@skipUnlessKvm
class TestWhitelistFirewallRequestJson(
KvmMixinJson, TestWhitelistFirewallRequest):
pass
@skipUnlessKvm @skipUnlessKvm
class TestWhitelistFirewallResilient(TestWhitelistFirewall): class TestWhitelistFirewallResilient(TestWhitelistFirewall):
kvm_instance_partition_reference = 'wf2' kvm_instance_partition_reference = 'wf2'
...@@ -1376,6 +1466,12 @@ class TestWhitelistFirewallResilient(TestWhitelistFirewall): ...@@ -1376,6 +1466,12 @@ class TestWhitelistFirewallResilient(TestWhitelistFirewall):
return 'kvm-resilient' return 'kvm-resilient'
@skipUnlessKvm
class TestWhitelistFirewallResilientJson(
KvmMixinJson, TestWhitelistFirewallResilient):
pass
@skipUnlessKvm @skipUnlessKvm
class TestWhitelistFirewallRequestResilient(TestWhitelistFirewallRequest): class TestWhitelistFirewallRequestResilient(TestWhitelistFirewallRequest):
kvm_instance_partition_reference = 'wf2' kvm_instance_partition_reference = 'wf2'
...@@ -1385,6 +1481,12 @@ class TestWhitelistFirewallRequestResilient(TestWhitelistFirewallRequest): ...@@ -1385,6 +1481,12 @@ class TestWhitelistFirewallRequestResilient(TestWhitelistFirewallRequest):
return 'kvm-resilient' return 'kvm-resilient'
@skipUnlessKvm
class TestWhitelistFirewallRequestResilientJson(
KvmMixinJson, TestWhitelistFirewallRequestResilient):
pass
@skipUnlessKvm @skipUnlessKvm
class TestWhitelistFirewallCluster(TestWhitelistFirewall): class TestWhitelistFirewallCluster(TestWhitelistFirewall):
kvm_instance_partition_reference = 'wf1' kvm_instance_partition_reference = 'wf1'
...@@ -1453,6 +1555,12 @@ dd if=/dev/zero of=/dev/virt1 bs=4096 count=500k""" ...@@ -1453,6 +1555,12 @@ dd if=/dev/zero of=/dev/virt1 bs=4096 count=500k"""
self.assertTrue(os.access(slapos_wipe_device_disk, os.X_OK)) self.assertTrue(os.access(slapos_wipe_device_disk, os.X_OK))
@skipUnlessKvm
class TestDiskDevicePathWipeDiskOndestroyJson(
KvmMixinJson, TestDiskDevicePathWipeDiskOndestroy):
pass
@skipUnlessKvm @skipUnlessKvm
class TestImageDownloadController(InstanceTestCase, FakeImageServerMixin): class TestImageDownloadController(InstanceTestCase, FakeImageServerMixin):
__partition_reference__ = 'idc' __partition_reference__ = 'idc'
...@@ -1715,6 +1823,12 @@ class TestParameterDefault(InstanceTestCase, KvmMixin): ...@@ -1715,6 +1823,12 @@ class TestParameterDefault(InstanceTestCase, KvmMixin):
self._test({'ram-size': 2048}, "ram_max_size = '2560'") self._test({'ram-size': 2048}, "ram_max_size = '2560'")
@skipUnlessKvm
class TestParameterDefaultJson(
KvmMixinJson, TestParameterDefault):
pass
@skipUnlessKvm @skipUnlessKvm
class TestParameterResilient(TestParameterDefault): class TestParameterResilient(TestParameterDefault):
__partition_reference__ = 'pr' __partition_reference__ = 'pr'
...@@ -1885,3 +1999,9 @@ class TestExternalDisk(InstanceTestCase, KvmMixin): ...@@ -1885,3 +1999,9 @@ class TestExternalDisk(InstanceTestCase, KvmMixin):
self.waitForInstance() self.waitForInstance()
dropped_drive_list = self.getRunningDriveList(kvm_instance_partition) dropped_drive_list = self.getRunningDriveList(kvm_instance_partition)
self.assertEqual(drive_list, dropped_drive_list) self.assertEqual(drive_list, dropped_drive_list)
@skipUnlessKvm
class TestExternalDiskJson(
KvmMixinJson, TestExternalDisk):
pass
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