tests: copy pool configuration into qubes-test.xml

If template choosen for the tests is installed in non-default storage
pool, this pool also needs to be imported into qubes-test.xml.
This commit is contained in:
Marek Marczykowski-Górecki 2017-01-14 05:04:04 +01:00
parent 0c43329188
commit bd9300b38e
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -507,10 +507,20 @@ class SystemTestsMixin(object):
elif isinstance(template, str): elif isinstance(template, str):
template = self.host_app.domains[template] template = self.host_app.domains[template]
used_pools = [vol.pool for vol in template.volumes.values()]
for pool in used_pools:
if pool in self.app.pools:
continue
self.app.add_pool(**self.host_app.pools[pool].config)
template_vm = self.app.add_new_vm(qubes.vm.templatevm.TemplateVM, template_vm = self.app.add_new_vm(qubes.vm.templatevm.TemplateVM,
name=template.name, name=template.name,
uuid=template.uuid, uuid=template.uuid,
label='black') label='black')
for name, volume in template_vm.volumes.items():
if volume.pool != template.volumes[name].pool:
template_vm.storage.init_volume(name, volume.config)
self.app.default_template = template_vm self.app.default_template = template_vm
def init_networking(self): def init_networking(self):