Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/smoke/features/orca.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion tests/smoke/features/steps/gnome_apps_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -415,6 +425,7 @@ def files_file_manager_launches_successfully(context) -> None:
FILES_APP_NAMES,
{"Files", "Home"},
"Files",
launch_targets=FILES_LAUNCH_TARGETS,
)


Expand Down
7 changes: 3 additions & 4 deletions tests/smoke/features/steps/printing_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 &>/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:
Expand Down
3 changes: 2 additions & 1 deletion tests/smoke/features/steps/sudo_rs_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions tests/smoke/features/steps/system_health_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
25 changes: 25 additions & 0 deletions tests/unit/test_gnome_apps_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
19 changes: 19 additions & 0 deletions tests/unit/test_printing_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
12 changes: 12 additions & 0 deletions tests/unit/test_sudo_rs_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down
Loading