# 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"