audio: fix prepare_audio_vm
This commit is contained in:
parent
79a05dcceb
commit
314e3c5d45
@ -430,7 +430,7 @@ class TC_00_AppVMMixin(object):
|
|||||||
# and some more...
|
# and some more...
|
||||||
self.loop.run_until_complete(asyncio.sleep(1))
|
self.loop.run_until_complete(asyncio.sleep(1))
|
||||||
|
|
||||||
def is_vm_suitable(self):
|
def prepare_audio_vm(self):
|
||||||
if 'whonix-gw' in self.template:
|
if 'whonix-gw' in self.template:
|
||||||
self.skipTest('whonix-gw have no audio')
|
self.skipTest('whonix-gw have no audio')
|
||||||
self.loop.run_until_complete(self.testvm1.start())
|
self.loop.run_until_complete(self.testvm1.start())
|
||||||
@ -439,10 +439,10 @@ class TC_00_AppVMMixin(object):
|
|||||||
self.testvm1.run_for_stdio('which parecord'))
|
self.testvm1.run_for_stdio('which parecord'))
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
self.skipTest('pulseaudio-utils not installed in VM')
|
self.skipTest('pulseaudio-utils not installed in VM')
|
||||||
|
self.wait_for_pulseaudio_startup(self.testvm1)
|
||||||
|
|
||||||
|
|
||||||
def common_audio_playback(self):
|
def common_audio_playback(self):
|
||||||
self.is_vm_suitable()
|
|
||||||
self.wait_for_pulseaudio_startup(self.testvm1)
|
|
||||||
# sine frequency
|
# sine frequency
|
||||||
sfreq = 4400
|
sfreq = 4400
|
||||||
# generate signal
|
# generate signal
|
||||||
@ -506,8 +506,6 @@ class TC_00_AppVMMixin(object):
|
|||||||
['pacmd', 'move-source-output', last_index, '0'])
|
['pacmd', 'move-source-output', last_index, '0'])
|
||||||
|
|
||||||
def common_audio_record_muted(self):
|
def common_audio_record_muted(self):
|
||||||
self.is_vm_suitable()
|
|
||||||
self.wait_for_pulseaudio_startup(self.testvm1)
|
|
||||||
# connect VM's recording source output monitor (instead of mic)
|
# connect VM's recording source output monitor (instead of mic)
|
||||||
self._configure_audio_recording(self.testvm1)
|
self._configure_audio_recording(self.testvm1)
|
||||||
|
|
||||||
@ -534,8 +532,6 @@ class TC_00_AppVMMixin(object):
|
|||||||
self.fail('VM recorded something, even though mic disabled')
|
self.fail('VM recorded something, even though mic disabled')
|
||||||
|
|
||||||
def common_audio_record_unmuted(self):
|
def common_audio_record_unmuted(self):
|
||||||
self.is_vm_suitable()
|
|
||||||
self.wait_for_pulseaudio_startup(self.testvm1)
|
|
||||||
deva = qubes.devices.DeviceAssignment(self.app.domains[0], 'mic')
|
deva = qubes.devices.DeviceAssignment(self.app.domains[0], 'mic')
|
||||||
self.loop.run_until_complete(
|
self.loop.run_until_complete(
|
||||||
self.testvm1.devices['mic'].attach(deva))
|
self.testvm1.devices['mic'].attach(deva))
|
||||||
@ -574,16 +570,19 @@ class TC_00_AppVMMixin(object):
|
|||||||
@unittest.skipUnless(spawn.find_executable('parecord'),
|
@unittest.skipUnless(spawn.find_executable('parecord'),
|
||||||
"pulseaudio-utils not installed in dom0")
|
"pulseaudio-utils not installed in dom0")
|
||||||
def test_220_audio_play(self):
|
def test_220_audio_play(self):
|
||||||
|
self.prepare_audio_vm()
|
||||||
self.common_audio_playback()
|
self.common_audio_playback()
|
||||||
|
|
||||||
@unittest.skipUnless(spawn.find_executable('parecord'),
|
@unittest.skipUnless(spawn.find_executable('parecord'),
|
||||||
"pulseaudio-utils not installed in dom0")
|
"pulseaudio-utils not installed in dom0")
|
||||||
def test_221_audio_rec_muted(self):
|
def test_221_audio_rec_muted(self):
|
||||||
|
self.prepare_audio_vm()
|
||||||
self.common_audio_record_muted()
|
self.common_audio_record_muted()
|
||||||
|
|
||||||
@unittest.skipUnless(spawn.find_executable('parecord'),
|
@unittest.skipUnless(spawn.find_executable('parecord'),
|
||||||
"pulseaudio-utils not installed in dom0")
|
"pulseaudio-utils not installed in dom0")
|
||||||
def test_222_audio_rec_unmuted(self):
|
def test_222_audio_rec_unmuted(self):
|
||||||
|
self.prepare_audio_vm()
|
||||||
self.common_audio_record_unmuted()
|
self.common_audio_record_unmuted()
|
||||||
|
|
||||||
@unittest.skipUnless(spawn.find_executable('parecord'),
|
@unittest.skipUnless(spawn.find_executable('parecord'),
|
||||||
@ -591,6 +590,7 @@ class TC_00_AppVMMixin(object):
|
|||||||
def test_223_audio_play_hvm(self):
|
def test_223_audio_play_hvm(self):
|
||||||
self.testvm1.virt_mode = 'hvm'
|
self.testvm1.virt_mode = 'hvm'
|
||||||
self.testvm1.features['audio-model'] = 'ich6'
|
self.testvm1.features['audio-model'] = 'ich6'
|
||||||
|
self.prepare_audio_vm()
|
||||||
self.common_audio_playback()
|
self.common_audio_playback()
|
||||||
|
|
||||||
@unittest.skipUnless(spawn.find_executable('parecord'),
|
@unittest.skipUnless(spawn.find_executable('parecord'),
|
||||||
@ -598,6 +598,7 @@ class TC_00_AppVMMixin(object):
|
|||||||
def test_224_audio_rec_muted_hvm(self):
|
def test_224_audio_rec_muted_hvm(self):
|
||||||
self.testvm1.virt_mode = 'hvm'
|
self.testvm1.virt_mode = 'hvm'
|
||||||
self.testvm1.features['audio-model'] = 'ich6'
|
self.testvm1.features['audio-model'] = 'ich6'
|
||||||
|
self.prepare_audio_vm()
|
||||||
self.common_audio_record_muted()
|
self.common_audio_record_muted()
|
||||||
|
|
||||||
@unittest.skipUnless(spawn.find_executable('parecord'),
|
@unittest.skipUnless(spawn.find_executable('parecord'),
|
||||||
@ -605,6 +606,7 @@ class TC_00_AppVMMixin(object):
|
|||||||
def test_225_audio_rec_unmuted_hvm(self):
|
def test_225_audio_rec_unmuted_hvm(self):
|
||||||
self.testvm1.virt_mode = 'hvm'
|
self.testvm1.virt_mode = 'hvm'
|
||||||
self.testvm1.features['audio-model'] = 'ich6'
|
self.testvm1.features['audio-model'] = 'ich6'
|
||||||
|
self.prepare_audio_vm()
|
||||||
self.common_audio_record_unmuted()
|
self.common_audio_record_unmuted()
|
||||||
|
|
||||||
def test_250_resize_private_img(self):
|
def test_250_resize_private_img(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user