qubes-gui-daemon icon indicating copy to clipboard operation
qubes-gui-daemon copied to clipboard

Use QubesDB for knowing if mic is allowed or not

Open fepitre opened this issue 1 year ago • 6 comments

Integration tests: https://github.com/QubesOS/qubes-core-admin/pull/608

fepitre avatar Jul 05 '24 14:07 fepitre

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024080713-4.3&flavor=pull-requests

Test run included the following:

  • https://github.com/QubesOS/qubes-core-agent-linux/pull/513 (https://github.com/QubesOS/qubes-core-agent-linux/pull/513/commits/e17c186fb2fbf400b91ac0b481e9c539b059fcf6)
  • https://github.com/QubesOS/qubes-core-admin/pull/574 (https://github.com/QubesOS/qubes-core-admin/pull/574/commits/8039442a401b6c5cc587f3cb81fcf62211991e60)
  • https://github.com/QubesOS/qubes-artwork/pull/41 (https://github.com/QubesOS/qubes-artwork/pull/41/commits/2148dce353f89b87cdd6d757b94bd76e7279860f)
  • https://github.com/QubesOS/qubes-gui-daemon/pull/145 (https://github.com/QubesOS/qubes-gui-daemon/pull/145/commits/c6acd17926f11f11d9d8672a55c86f514b0be5f7)
  • https://github.com/QubesOS/qubes-core-agent-linux/pull/516 (https://github.com/QubesOS/qubes-core-agent-linux/pull/516/commits/08fe31f58d88e858a8c0a3f220f2934b7cc7d949)
  • https://github.com/QubesOS/qubes-core-admin/pull/608 (https://github.com/QubesOS/qubes-core-admin/pull/608/commits/226805d32532f4a46aaf74075d0028ad8c852146)
  • https://github.com/QubesOS/qubes-gui-agent-linux/pull/197 (https://github.com/QubesOS/qubes-gui-agent-linux/pull/197/commits/fc04d11888ed704de4888fc95357c1161c36cea7)
  • https://github.com/QubesOS/qubes-core-qrexec/pull/135 (https://github.com/QubesOS/qubes-core-qrexec/pull/135/commits/62ce536eebf5e7671c90d5cb0f165b6cff853d8f)
  • https://github.com/QubesOS/qubes-video-companion/pull/28 (https://github.com/QubesOS/qubes-video-companion/pull/28/commits/97a6dde9bf6720119f7ddb7d1125f0f4e789ec50)
  • https://github.com/QubesOS/qubes-core-qrexec/pull/172 (https://github.com/QubesOS/qubes-core-qrexec/pull/172/commits/45527be327695c56e96a2e36d8ecb6d82ffd9205)
  • https://github.com/QubesOS/qubes-core-agent-linux/pull/517 (https://github.com/QubesOS/qubes-core-agent-linux/pull/517/commits/d993b424c4b1758b999194ff6a02470f14803692)

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024070519-4.3&flavor=update

Failed tests

9 failures
  • system_tests_pvgrub_salt_storage

    • TC_41_HVMGrub_debian-12-xfce: test_000_standalone_vm (error) qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_41_HVMGrub_debian-12-xfce: test_010_template_based_vm (error) qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • [unstable] TC_41_HVMGrub_fedora-40-xfce: test_000_standalone_vm (error) qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_41_HVMGrub_fedora-40-xfce: test_010_template_based_vm (error) qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

  • system_tests_extra

    • [unstable] TC_00_QVCTest_debian-12-xfce: test_020_webcam (failure) self.assertEqual(len(img1), len(... AssertionError: 12441600 != 460800

    • TC_00_QVCTest_whonix-gateway-17: test_010_screenshare (failure) self.assertNotEqual(vm.run('test -e /dev/vid... AssertionError: 0 == 0

  • system_tests_usbproxy

  • system_tests_network_updates

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/105374#dependencies

7 fixed
  • system_tests_splitgpg

  • system_tests_extra

    • TC_00_QVCTest_fedora-40-xfce: test_020_webcam (failure + cleanup) AssertionError: 'qubes-video-companion webcam' exited early (0): b'...

    • TC_00_QVCTest_whonix-gateway-17: test_020_webcam (failure + cleanup) AssertionError: 'qubes-video-companion webcam' exited early (0): b'...

    • TC_00_QVCTest_whonix-workstation-17: test_020_webcam (failure + cleanup) AssertionError: 'qubes-video-companion webcam' exited early (0): b'...

  • system_tests_usbproxy

  • system_tests_network_updates

    • TC_11_QvmTemplateMgmtVM_debian-12-xfce: test_000_template_list (failure) AssertionError: libvirt event impl drain timeout

Unstable tests

  • system_tests_audio@hw1

    TC_20_AudioVM_PipeWire_whonix-workstation-17/test_226_audio_playback_pipewire (1/5 times with errors)
    • job 107016 AssertionError: too short audio, expected 10s, got 9.09077097505668...
  • system_tests_whonix@hw7

    whonix_torbrowser/ (1/5 times with errors)
    whonix_torbrowser/ (1/5 times with errors)
    whonix_torbrowser/Failed (1/5 times with errors)
    • job 108052 # Test died: no candidate needle with tag(s) 'tor-browser-ipcheck-o...
  • system_tests_suspend@hw1

    suspend/ (1/5 times with errors)
    suspend/Failed (1/5 times with errors)
    • job 107593 # Test died: no candidate needle with tag(s) 'xscreensaver-prompt' ...
    suspend/wait_serial (1/5 times with errors)
    • job 107593 # wait_serial expected: qr/2E8vz-\d+-/...
  • system_tests_whonix

    whonix_torbrowser/ (1/5 times with errors)
    whonix_torbrowser/ (1/5 times with errors)
    whonix_torbrowser/Failed (1/5 times with errors)
    • job 108052 # Test died: no candidate needle with tag(s) 'tor-browser-ipcheck-o...
  • system_tests_suspend

    suspend/ (1/5 times with errors)
    suspend/Failed (1/5 times with errors)
    • job 107593 # Test died: no candidate needle with tag(s) 'xscreensaver-prompt' ...
    suspend/wait_serial (1/5 times with errors)
    • job 107593 # wait_serial expected: qr/2E8vz-\d+-/...
  • system_tests_pvgrub_salt_storage

    TC_41_HVMGrub_fedora-40-xfce/test_000_standalone_vm (4/5 times with errors)
    • job 105874 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    • job 106585 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    • job 107590 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    • job 108080 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
  • system_tests_splitgpg

    TC_10_Thunderbird_whonix-workstation-17/test_020_send_receive_inline_with_attachment (2/5 times with errors)
    • job 105876 dogtail.tree.SearchError: descendent of [application | Thunderbird]...
    • job 106587 dogtail.tree.SearchError: descendent of [application | Thunderbird]...
  • system_tests_extra

    TC_00_QVCTest_debian-12-xfce/test_020_webcam (1/5 times with errors)
    • job 107031 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    TC_00_QVCTest_fedora-40-xfce/test_020_webcam (4/5 times with errors)
    • job 105868 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    • job 106579 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    • job 107031 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    • job 108074 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    TC_00_QVCTest_whonix-gateway-17/test_020_webcam (5/5 times with errors)
    • job 105868 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    • job 106579 self.assertNotEqual(vm.run('test -e /dev/vid... AssertionError: 0 == 0
    • job 107031 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    • job 107584 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    • job 108074 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    TC_00_QVCTest_whonix-workstation-17/test_020_webcam (3/5 times with errors)
    • job 105868 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
    • job 106579 self.assertNotEqual(vm.run('test -e /dev/vid... AssertionError: 0 == 0
    • job 107031 AssertionError: 'qubes-video-companion webcam' exited early (0): b'...
  • system_tests_network_updates

    TC_10_QvmTemplate_whonix-gateway-17/test_010_template_install (1/5 times with errors)
    • job 105873 AssertionError: libvirt event impl drain timeout
  • system_tests_audio

    TC_20_AudioVM_PipeWire_whonix-workstation-17/test_226_audio_playback_pipewire (1/5 times with errors)
    • job 107016 AssertionError: too short audio, expected 10s, got 9.09077097505668...
  • system_tests_basic_vm_qrexec_gui_ext4

    TC_20_NonAudio_whonix-workstation-17-pool/test_115_qrexec_filecopy_no_agent (1/5 times with errors)
    • job 108693 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_20_NonAudio_whonix-workstation-17-pool/test_130_qrexec_filemove_disk_full (1/5 times with errors)
    • job 108693 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_20_NonAudio_whonix-workstation-17-pool/test_140_qrexec_filecopy_unsafe_name (1/5 times with errors)
    • job 108693 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_20_NonAudio_whonix-workstation-17-pool/test_141_qrexec_filecopy_unsafe_symlink (1/5 times with errors)
    • job 108693 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_20_NonAudio_whonix-workstation-17-pool/test_200_timezone (1/5 times with errors)
    TC_20_NonAudio_whonix-workstation-17-pool/test_210_time_sync (1/5 times with errors)
    TC_20_NonAudio_whonix-workstation-17-pool/test_250_resize_private_img (1/5 times with errors)
    • job 108693 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_20_NonAudio_whonix-workstation-17-pool/test_300_bug_1028_gui_memory_pinning (1/5 times with errors)
    • job 108693 libvirt.libvirtError: internal error: libxenlight failed to create ...

qubesos-bot avatar Jul 08 '24 23:07 qubesos-bot

Unfortunately error message doesn't tell what value was there actually...

First test passed and only later one failed. I think it's about stale entry from previous VM startup. Remove it in domain-qdb-create event handler (it's part of domain startup).

marmarek avatar Jul 09 '24 23:07 marmarek

And also this issue

marmarek avatar Jul 09 '24 23:07 marmarek

This is the actual test. My guess is _configure_audio_recording doesn't handle recording with audiovm, it looks to call pactl only in dom0. common_audio_record_unmuted looks to also support only recording with dom0 as audiovm... It might be enough to prepend qvm-run -p ... to those commands in case of audiovm.

marmarek avatar Jul 09 '24 23:07 marmarek

Unfortunately error message doesn't tell what value was there actually...

Yes, I thought it would be a bad idea to display it, I will adapt it.

fepitre avatar Jul 10 '24 07:07 fepitre

https://openqa.qubes-os.org/tests/107154#step/update_guivm/22

Jul 21 13:05:34 dom0 qubesd[1412]: unhandled exception while calling src=b'dom0' meth=b'admin.vm.Start' dest=b'sys-gui-vnc' arg=b'' len(untrusted_payload)=0
Jul 21 13:05:34 dom0 qubesd[1412]: Traceback (most recent call last):
Jul 21 13:05:34 dom0 qubesd[1412]:   File "/usr/lib/python3.11/site-packages/qubes/api/__init__.py", line 291, in respond
Jul 21 13:05:34 dom0 qubesd[1412]:     response = await self.mgmt.execute(
Jul 21 13:05:34 dom0 qubesd[1412]:                ^^^^^^^^^^^^^^^^^^^^^^^^
Jul 21 13:05:34 dom0 qubesd[1412]:   File "/usr/lib/python3.11/site-packages/qubes/api/admin.py", line 866, in vm_start
Jul 21 13:05:34 dom0 qubesd[1412]:     await self.dest.start()
Jul 21 13:05:34 dom0 qubesd[1412]:   File "/usr/lib/python3.11/site-packages/qubes/vm/qubesvm.py", line 1277, in start
Jul 21 13:05:34 dom0 qubesd[1412]:     self.create_qdb_entries()
Jul 21 13:05:34 dom0 qubesd[1412]:   File "/usr/lib/python3.11/site-packages/qubes/vm/qubesvm.py", line 2397, in create_qdb_entries
Jul 21 13:05:34 dom0 qubesd[1412]:     self.fire_event('domain-qdb-create')
Jul 21 13:05:34 dom0 qubesd[1412]:   File "/usr/lib/python3.11/site-packages/qubes/events.py", line 195, in fire_event
Jul 21 13:05:34 dom0 qubesd[1412]:     sync_effects, async_effects = self._fire_event(event, kwargs,
Jul 21 13:05:34 dom0 qubesd[1412]:                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 21 13:05:34 dom0 qubesd[1412]:   File "/usr/lib/python3.11/site-packages/qubes/events.py", line 164, in _fire_event
Jul 21 13:05:34 dom0 qubesd[1412]:     effect = func(self, event, **kwargs)
Jul 21 13:05:34 dom0 qubesd[1412]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 21 13:05:34 dom0 qubesd[1412]:   File "/usr/lib/python3.11/site-packages/qubesguidaemon/mic.py", line 226, in on_domain_qdb_create
Jul 21 13:05:34 dom0 qubesd[1412]:     vm.audiovm.untrusted_qdb.rm("/audio-input-config/{}".format(vm.name))
Jul 21 13:05:34 dom0 qubesd[1412]:     ^^^^^^^^^^^^^^^^^^^^^^^^
Jul 21 13:05:34 dom0 qubesd[1412]: AttributeError: 'NoneType' object has no attribute 'untrusted_qdb'

Since it accesses vm.audiovm.untrusted_qdb, it needs to check if it's running, similar to other places.

marmarek avatar Jul 21 '24 17:07 marmarek