From ac55c8cf4d3bc8dd11882f80af3701851ddf972b Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 22:07:16 -0500 Subject: [PATCH] fix(smoke): match Dakota for Files, printing, sudoedit, Orca and boot-timeout checks - Launch Files through the nautilus command; gio launch D-Bus-activates Nautilus on Dakota without mapping a window. - Start the print socket listener with detached_launch_command so logind KillUserProcesses=yes does not kill it when the SSH session closes. - stat -L sudoedit: it is a symlink to the setuid sudo binary on Dakota. - Check Orca and speech-dispatcher with command -v instead of rpm, which Dakota does not ship. - Ignore ublue-boot-timeout.service in the VM: bootctl refuses to run when not booted with UEFI. Refs #1059 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- tests/smoke/features/orca.feature | 6 ++--- .../smoke/features/steps/gnome_apps_steps.py | 13 +++++++++- tests/smoke/features/steps/printing_steps.py | 7 +++--- tests/smoke/features/steps/sudo_rs_steps.py | 3 ++- .../features/steps/system_health_steps.py | 3 +++ tests/unit/test_gnome_apps_steps.py | 25 +++++++++++++++++++ tests/unit/test_printing_steps.py | 19 ++++++++++++++ tests/unit/test_sudo_rs_steps.py | 12 +++++++++ 8 files changed, 79 insertions(+), 9 deletions(-) diff --git a/tests/smoke/features/orca.feature b/tests/smoke/features/orca.feature index 678887b46..1fcfe2b3b 100644 --- a/tests/smoke/features/orca.feature +++ b/tests/smoke/features/orca.feature @@ -5,10 +5,10 @@ Feature: Orca screen reader @orca @binary @a11y Scenario: Orca and speech-dispatcher binaries are installed - * Run command on VM: "command -v orca && rpm -q orca speech-dispatcher" + * Run command on VM: "command -v orca && command -v speech-dispatcher" * VM command return code is "0" - * VM command output contains "orca-" - * VM command output contains "speech-dispatcher-" + * VM command output contains "/orca" + * VM command output contains "/speech-dispatcher" @orca @a11y @bus Scenario: AT-SPI accessibility bus name is registered diff --git a/tests/smoke/features/steps/gnome_apps_steps.py b/tests/smoke/features/steps/gnome_apps_steps.py index f6ff0b8e5..a36faefa2 100644 --- a/tests/smoke/features/steps/gnome_apps_steps.py +++ b/tests/smoke/features/steps/gnome_apps_steps.py @@ -37,6 +37,12 @@ def _skip_if_no_atspi(context) -> bool: # like "user@host:~" are also accepted when window_names is empty or contains shell tokens. PTYXIS_WINDOW_NAMES: set[str] = set() FILES_APP_NAMES = ("org.gnome.Nautilus", "Files", "nautilus") +# Dakota's Nautilus D-Bus-activates from `gio launch` of its .desktop file but +# never maps a window; the `nautilus` command opens one on every image. +FILES_LAUNCH_TARGETS = ( + ("command", "nautilus"), + ("desktop", "org.gnome.Nautilus.desktop"), +) MISSION_CENTER_APP_NAMES = ( "Mission Center", "MissionCenter", @@ -343,8 +349,12 @@ def _launch_assert_and_close( app_names: tuple[str, ...], window_names: set[str], label: str, + launch_targets: tuple[tuple[str, str], ...] | None = None, ) -> None: - _launch_app(app_id) + if launch_targets: + launch_background(launch_targets) + else: + _launch_app(app_id) window = _wait_for_window(app_names, window_names, label) context.last_launched_app_window = window try: @@ -415,6 +425,7 @@ def files_file_manager_launches_successfully(context) -> None: FILES_APP_NAMES, {"Files", "Home"}, "Files", + launch_targets=FILES_LAUNCH_TARGETS, ) diff --git a/tests/smoke/features/steps/printing_steps.py b/tests/smoke/features/steps/printing_steps.py index 3d8a8ab51..a09be65bd 100644 --- a/tests/smoke/features/steps/printing_steps.py +++ b/tests/smoke/features/steps/printing_steps.py @@ -5,6 +5,8 @@ from behave import step +from tests.shared.app_support import detached_launch_command + try: from qecore.common_steps import * # noqa: F401,F403 except Exception: # noqa: BLE001 @@ -146,10 +148,7 @@ def _start_socket_listener(port: int) -> None: " pass\n" ) _run_host(f"cat > {_LISTENER_SCRIPT} <<'PYEOF'\n{script}PYEOF") - _run_host( - f"nohup python3 {_LISTENER_SCRIPT} /dev/null & disown", - timeout=5, - ) + _run_host(detached_launch_command(f"python3 {_LISTENER_SCRIPT}"), timeout=10) # Wait for the ready marker. deadline = time.monotonic() + 10 while time.monotonic() < deadline: diff --git a/tests/smoke/features/steps/sudo_rs_steps.py b/tests/smoke/features/steps/sudo_rs_steps.py index f8415d8a3..c6860071d 100644 --- a/tests/smoke/features/steps/sudo_rs_steps.py +++ b/tests/smoke/features/steps/sudo_rs_steps.py @@ -61,7 +61,8 @@ def sudoedit_binary_check(context) -> None: assert returncode == 0, f"sudoedit binary not found on PATH: {stderr or path}" stat_out, returncode, stderr = _run_host( - "stat -c '%a %U:%G' \"$(command -v sudoedit)\"" + # sudoedit is a symlink to sudo on Dakota; check the binary it resolves to. + "stat -L -c '%a %U:%G' \"$(command -v sudoedit)\"" ) assert returncode == 0, f"stat sudoedit failed: {stderr or stat_out}" mode, owner = stat_out.split(maxsplit=1) diff --git a/tests/smoke/features/steps/system_health_steps.py b/tests/smoke/features/steps/system_health_steps.py index 7e00536a1..99eb57e5f 100644 --- a/tests/smoke/features/steps/system_health_steps.py +++ b/tests/smoke/features/steps/system_health_steps.py @@ -31,6 +31,9 @@ "gnome-remote-desktop.service", # bootupd cannot update the bootloader inside a QEMU VM (no EFI vars/bootctl) "bootloader-update.service", + # bootctl refuses to set the systemd-boot timeout when not booted with UEFI; + # the CI VM boots without UEFI firmware + "ublue-boot-timeout.service", # TuneD invokes bootc/rpm-ostree while first-boot storage initialization owns # the daemon in the disposable QEMU guest. It times out only on that boot; # non-virtualized failures remain release-blocking. diff --git a/tests/unit/test_gnome_apps_steps.py b/tests/unit/test_gnome_apps_steps.py index 660d9bc7d..cfa486536 100644 --- a/tests/unit/test_gnome_apps_steps.py +++ b/tests/unit/test_gnome_apps_steps.py @@ -229,6 +229,31 @@ def test_ptyxis_accepts_shell_prompt_window_title(self): assert context.last_launched_app_window is frame +class TestFilesLaunch: + def test_files_launches_via_nautilus_command(self): + m = _import_gnome_apps() + frame = MagicMock() + frame.roleName = "frame" + frame.showing = True + frame.name = "Home" + app = MagicMock() + app.findChildren = MagicMock(return_value=[frame]) + + with patch.object(m, "_launch_app") as launch_app, \ + patch.object(m, "launch_background") as launch_background, \ + patch.object(m, "_app", return_value=app), \ + patch.object(m, "_shell_eval_force_close"), \ + patch.object(m, "_wait_for_app_to_close"), \ + patch("subprocess.run"): + context = MagicMock() + m.files_file_manager_launches_successfully(context) + + launch_app.assert_not_called() + launch_background.assert_called_once_with(m.FILES_LAUNCH_TARGETS) + assert m.FILES_LAUNCH_TARGETS[0] == ("command", "nautilus") + assert context.last_launched_app_window is frame + + class TestWindowDeadline: @pytest.fixture def clock(self, monkeypatch): diff --git a/tests/unit/test_printing_steps.py b/tests/unit/test_printing_steps.py index f5cb056aa..5c85f745f 100644 --- a/tests/unit/test_printing_steps.py +++ b/tests/unit/test_printing_steps.py @@ -70,3 +70,22 @@ def fake_run_host(cmd, timeout=30): assert any("cp /usr/lib/systemd/system/cups.socket /etc/systemd/system.control/cups.socket" in c for c in calls) assert "sudo -n mkdir -p /etc/systemd/system.control" in calls assert "sudo -n systemctl daemon-reload" in calls + + +class TestSocketListener: + def test_listener_outlives_the_ssh_session(self): + m = _import_steps() + calls = [] + + def fake_run_host(cmd, timeout=30): + calls.append(cmd) + if cmd.startswith("test -f"): + return ("ready", 0, "") + return ("", 0, "") + + with patch.object(m, "_run_host", side_effect=fake_run_host): + m._start_socket_listener(19191) + + launch = [c for c in calls if f"python3 {m._LISTENER_SCRIPT}" in c] + assert len(launch) == 1 + assert "systemd-run --user" in launch[0] diff --git a/tests/unit/test_sudo_rs_steps.py b/tests/unit/test_sudo_rs_steps.py index 965be4106..00ab914c7 100644 --- a/tests/unit/test_sudo_rs_steps.py +++ b/tests/unit/test_sudo_rs_steps.py @@ -161,6 +161,18 @@ def test_passes_on_healthy_sudoedit(self, mod): assert len(mod._run_host.call_args_list) == 3 + def test_stat_follows_sudoedit_symlink(self, mod): + _responses( + mod, + ("/usr/bin/sudoedit", 0, ""), + ("4755 root:root", 0, ""), + ("sudo-rs 0.2.6", 0, ""), + ) + + mod.sudoedit_binary_check(MagicMock()) + + assert mod._run_host.call_args_list[1][0][0].startswith("stat -L ") + def test_fails_when_binary_missing(self, mod): _responses(mod, ("", 1, "not found"))