aboutsummaryrefslogtreecommitdiff
path: root/scripts/testing/tests/test_keyring.py
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-25 01:12:35 -0400
committerCraig Jennings <c@cjennings.net>2026-06-25 01:12:35 -0400
commit3cac3b3dfcd432395201a309920c2491ee9caf01 (patch)
tree45c3ea7f8b73f7375c484912ecadc8a65c4d88a5 /scripts/testing/tests/test_keyring.py
parent99a26d7de23bbfc757957c08e47606c3690df4cb (diff)
downloadarchsetup-3cac3b3dfcd432395201a309920c2491ee9caf01.tar.gz
archsetup-3cac3b3dfcd432395201a309920c2491ee9caf01.zip
test(archsetup): port full shell validation sweep to Testinfra (P2)
Port all ~26 post-install checks from validation.sh to pytest/Testinfra, reaching parity before the cutover. Adds test_users, test_packages, test_services, test_desktop, test_boot, test_keyring, and test_archsetup (88 tests after parametrizing groups, services, timers, tools, and configs), plus shared conftest fixtures for ZFS/NVMe/compositor/networking gating. The shell sweep's three outcomes map cleanly: hard failures become assertions, advisory warnings and unmet preconditions (headless compositor, slirp networking, optional services, non-ZFS/non-NVMe hosts) become skips. One correctness fix vs the shell sweep: check awww, not swww — archsetup installs awww (swww's successor) and `pacman -Q swww` no longer matches. Verified on the host: py_compile clean, pytest --collect-only green (88 tests). The sweep against a real VM is verified by the make test run that follows.
Diffstat (limited to 'scripts/testing/tests/test_keyring.py')
-rw-r--r--scripts/testing/tests/test_keyring.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/testing/tests/test_keyring.py b/scripts/testing/tests/test_keyring.py
new file mode 100644
index 0000000..99d322d
--- /dev/null
+++ b/scripts/testing/tests/test_keyring.py
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+"""Post-install checks: gnome-keyring pre-configuration.
+
+Parity port of validate_gnome_keyring_setup: the keyrings dir must exist, be
+mode 700, owned by the user, with the default keyring set to "login".
+"""
+
+import pytest
+
+
+@pytest.fixture(scope="session")
+def keyring_dir(home):
+ return "%s/.local/share/keyrings" % home
+
+
+@pytest.mark.attribution("archsetup")
+def test_keyring_dir_exists(host, keyring_dir):
+ assert host.file(keyring_dir).is_directory
+
+
+@pytest.mark.attribution("archsetup")
+def test_keyring_dir_mode_700(host, keyring_dir):
+ assert host.file(keyring_dir).mode == 0o700
+
+
+@pytest.mark.attribution("archsetup")
+def test_keyring_dir_owned_by_user(host, keyring_dir, target_user):
+ assert host.file(keyring_dir).user == target_user
+
+
+@pytest.mark.attribution("archsetup")
+def test_default_keyring_is_login(host, keyring_dir):
+ default = host.file("%s/default" % keyring_dir)
+ assert default.exists, "default keyring file missing"
+ assert default.content_string.strip() == "login"