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

setup-ip: Invoke 'ip' via $PATH #516

Merged
merged 1 commit into from
Aug 8, 2024
Merged

Conversation

HW42
Copy link
Contributor

@HW42 HW42 commented Jul 24, 2024

Debian recently 1 removed the symlink in /sbin which breaks our setup-ip script.

Instead of hardcoding the new path, rely on normal $PATH resolution. Saving a few file existence checks isn't worth such breakage, I think (or if that really matters here, shell is the wrong tool in the first place).


Assuming you agree with my reasoning above, one could argue to apply this change to all invocations of programs normally in the $PATH. Given that usage was already inconsistent I for now kept the change minimal instead.

The fix (this version or an update to /bin/ip) should be backported to 4.2.

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.14%. Comparing base (0f346ad) to head (08fe31f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
- 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.

@marmarek
Copy link
Member

For tools normally in /bin (or similar), I would agree that calling by just name is okay. But for tools in /sbin (or similar), better not, ironically exactly because of Debian - as (/usr)/sbin is not in default $PATH. And this happens to be an issue also in various service contexts (like user systemd units), but also for scripts/tools used as normal users (for example modinfo really doesn't need to be called as root).

@HW42
Copy link
Contributor Author

HW42 commented Jul 25, 2024

Ah, good point. While I'm not sure it's the tradeoff [1] I prefer that's a valid reason. Would you like a more neutral commit message? (Didn't just push one, since you already added the openqa-pending label)

[1]: For example it makes local overrides with /usr/local or similar harder.

@marmarek
Copy link
Member

Yes, you can update commit message. I've recently added better reporting which commit was used by openqa, so there is no reason to avoid (especially non-functional) changes when label is already added (at worst, the test will need to be repeated, but if some changes needing re-tested are necessary, that would be the case anyway).

@marmarek
Copy link
Member

And BTW, on Fedora there is only /usr/sbin/ip, but no /usr/bin/ip, so with the symlink in Debian gone, there is no full path that would work on both anymore...

Debian recently [1] removed the symlink in /sbin which breaks our
setup-ip script. Fedora on the other hand has 'ip' only in {/usr,}/sbin.
So invoke ip without specifying a path and rely on the shell's $PATH.

[1]: https://salsa.debian.org/kernel-team/iproute2/-/commit/c4bb148dd4ed0601ca32ee8a458007d0c348d6c3
@HW42
Copy link
Contributor Author

HW42 commented Jul 25, 2024

And BTW, on Fedora there is only /usr/sbin/ip, but no /usr/bin/ip, so with the symlink in Debian gone, there is no full path that would work on both anymore...

Ah well, then relying on $PATH is clearly the easiest solution.

Yes, you can update commit message. I've recently added better reporting which commit was used by openqa, so there is no reason to avoid (especially non-functional) changes when label is already added (at worst, the test will need to be repeated, but if some changes needing re-tested are necessary, that would be the case anyway).

Good to know. Wasn't sure if I would abort and/or trigger a retest, which would be undesirable for an edited commit message.

Pushed updated commit message.

@qubesos-bot
Copy link

qubesos-bot commented Jul 25, 2024

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:

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 ...

@marmarek marmarek merged commit 7984de2 into QubesOS:main Aug 8, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants