Skip to content

Commit

Permalink
tests: check if qubes-vm@ service is disabled on domain removal
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Oct 26, 2018
1 parent cf8b621 commit 4e76278
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions qubes/tests/integ/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ def test_120_start_standalone_with_cdrom_dom0(self):
self.loop.run_until_complete(asyncio.sleep(1))
self.assertFalse(self.vm.is_running())

def test_130_autostart_disable_on_remove(self):
vm = self.app.add_new_vm(qubes.vm.appvm.AppVM,
name=self.make_vm_name('vm'),
template=self.app.default_template,
label='red')

self.assertIsNotNone(vm)
self.loop.run_until_complete(vm.create_on_disk())
vm.autostart = True
self.assertTrue(os.path.exists(
'/etc/systemd/system/multi-user.target.wants/'
'qubes-vm@{}.service'.format(vm.name)),
"systemd service not enabled by autostart=True")
del self.app.domains[vm]
self.loop.run_until_complete(vm.remove_from_disk())
self.assertFalse(os.path.exists(
'/etc/systemd/system/multi-user.target.wants/'
'qubes-vm@{}.service'.format(vm.name)),
"systemd service not disabled on domain remove")

def _test_200_on_domain_start(self, vm, event, **_kwargs):
'''Simulate domain crash just after startup'''
vm.libvirt_domain.destroy()
Expand Down

0 comments on commit 4e76278

Please sign in to comment.