audio: add checks for changing/removing audiovm

This commit is contained in:
Frédéric Pierret (fepitre) 2020-03-08 10:31:44 +01:00
parent 9051aff15a
commit c36ad38eb3
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2

View File

@ -637,18 +637,30 @@ class TC_90_Qubes(qubes.tests.QubesTestCase):
holder = MyTestHolder(None)
audiovm = self.app.add_new_vm('AppVM', name='sys-audio', audiovm='dom0',
template=self.template, label='red')
guivm = self.app.add_new_vm('AppVM', name='sys-gui', audiovm='dom0',
template=self.template, label='red')
appvm = self.app.add_new_vm('AppVM', name='test-vm', audiovm='dom0',
template=self.template, label='red')
holder.audiovm = 'sys-audio'
self.assertEqual(holder.audiovm, 'sys-audio')
self.assertFalse(appvm.property_is_default('audiovm'))
appvm.audiovm = audiovm
self.assertEventFired(holder, 'property-set:audiovm',
kwargs={'name': 'audiovm',
'newvalue': 'sys-audio'})
# Set AudioVM
self.assertFalse(appvm.property_is_default('audiovm'))
appvm.audiovm = audiovm
self.assertIn('audiovm-sys-audio', appvm.tags)
# Change AudioVM
appvm.audiovm = guivm
self.assertIn('audiovm-sys-gui', appvm.tags)
# Empty AudioVM
del appvm.audiovm
self.assertNotIn('audiovm-', appvm.tags)
def test_200_remove_template(self):
appvm = self.app.add_new_vm('AppVM', name='test-vm',
template=self.template,