Skip to content

Commit

Permalink
tests: copy pool configuration into qubes-test.xml
Browse files Browse the repository at this point in the history
If template choosen for the tests is installed in non-default storage
pool, this pool also needs to be imported into qubes-test.xml.
  • Loading branch information
marmarek committed Feb 14, 2017
1 parent 0c43329 commit bd9300b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions qubes/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,20 @@ def init_default_template(self, template=None):
elif isinstance(template, str):
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,
name=template.name,
uuid=template.uuid,
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

def init_networking(self):
Expand Down

0 comments on commit bd9300b

Please sign in to comment.