Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept only files for qvm-open-in-(d)vm #513

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alimirjamali
Copy link
Contributor

@alimirjamali
Copy link
Contributor Author

alimirjamali commented Jul 18, 2024

Accepting URLs should be added to the conditions. Fix will come in few minutes...

p.s.: Accepting malformed or invalid URLs is in the actual script:

expr "@$filename" : '@[A-Za-z][A-Za-z0-9+]*://'>/dev/null

This behaviour could be replicated if desired.

@alimirjamali alimirjamali force-pushed the Issue-9360 branch 2 times, most recently from a1a4158 to a53de1b Compare July 19, 2024 16:04
@alimirjamali
Copy link
Contributor Author

alimirjamali commented Jul 19, 2024

According to tests:

In qubes-rpc/qvm-open-in-vm line 73:
elif [[ ! "$filename" =~ (https?|ftp|mailto|irc|rsync)://.*$ ]] && \
     ^-- SC3010 (warning): In POSIX sh, [[ ]] is undefined.
For more information:
  https://www.shellcheck.net/wiki/SC3010 -- In POSIX sh, [[ ]] is undefined.

Instead of upgrading the script to bash to allow regex, I believe it would be better to revert to the conventional expr URL evaluation which is already used in the script. Handling malformed or invalid URLs was not the main subject of this PR from the beginning.

p.s. Another bot complain. The if condition will get too long if I do this shellckeck! Silencing it.

$ shellcheck -e SC1117 $(grep -l '^#!/bin/\(ba\)\?sh' $(git ls-files))
In qubes-rpc/qvm-open-in-vm line 76:
    if [ $? -ne 0 ]; then
         ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly w

Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.14%. Comparing base (ac60e1e) to head (e17c186).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #513      +/-   ##
==========================================
- Coverage   70.57%   70.14%   -0.43%     
==========================================
  Files           3        3              
  Lines         469      469              
==========================================
- Hits          331      329       -2     
- Misses        138      140       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@qubesos-bot
Copy link

qubesos-bot commented Jul 21, 2024

OpenQA test summary

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

Test run included the following:

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

48 failures

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_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_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_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 ...
  • 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+-/...

qubes-rpc/qvm-open-in-vm Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants