Repository navigation
Conversation
The preferences tests delete ~/.config/opensnitch/settings.conf and write it through QSettings, and pressing Apply calls Autostart.enable(), which can create, remove or hide ~/.config/autostart/opensnitch_ui.desktop. Running the suite on a machine with OpenSnitch installed therefore replaced the user's real UI settings. Redirect HOME and the XDG dirs to a temporary directory before opensnitch is imported (utils/xdg.py caches the paths at import time), and add a session fixture that fails if the paths resolve outside of it or if the real settings.conf or autostart file changed during the run.
This was referenced Oct 5, 2026
Author
|
@gustavo-iniguez-goya in case it helps with 1.9.0: these four open PRs fix things that break the UI or the package builds on a clean install. Each is small and based on master.
Thanks in advance. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running the UI tests on a machine where OpenSnitch is installed changes the settings of that installation:
test_preferences.pydeletes~/.config/opensnitch/settings.conf, and the dialogs then rewrite it throughQSettings("opensnitch", "settings").Autostart.enable(). That can create or remove~/.config/autostart/opensnitch_ui.desktop, or addHidden=trueto it, which turns off autostart of the installed UI.I noticed this after a local test run reset the settings of the UI I was running.
This PR only changes
ui/tests/conftest.py:HOMEandXDG_*point to a temporary directory. It is set up beforeopensnitchis imported, becauseutils/xdg.pyreads these variables at import time.DBUS_SESSION_BUS_ADDRESSis unset, so no notification reaches the desktop.settings.confor autostart file changed during the run.Tested:
ui/testsgives the same result as master: 94 passed, 4 failed. The 4 failures are intest_preferences.py, are unrelated, and already happen on master. The real files were byte-identical before and after the run.test run modified the real installation.ClientConfig.node_idas canonical UI node identity #1578, which also touchconftest.py. PyQt6 is only imported inside the fixture, so the CLI tests of cli: add opensnitch-cli, a headless client for machines with no graphical environment #1650, which run without Qt, keep working.Several open PRs add or change UI tests (#1650, #1614, #1578, ...). Merging this first would keep anyone who runs them locally from losing their settings.