tests/gnome-keyring: add test coverage

- Add basic-service.nix test for default gnome-keyring configuration
- Add custom-components.nix test for pkcs11, secrets, and ssh components

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman
2025-07-14 22:00:41 -05:00
parent 2f588d275e
commit 85a5287116
5 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
[Install]
WantedBy=graphical-session-pre.target
[Service]
ExecStart=@gnome-keyring@/bin/gnome-keyring-daemon --start --foreground
Restart=on-abort
[Unit]
Description=GNOME Keyring
PartOf=graphical-session-pre.target

View File

@@ -0,0 +1,15 @@
{ config, ... }:
{
config = {
services.gnome-keyring = {
enable = true;
};
nmt.script = ''
assertFileContent \
home-files/.config/systemd/user/gnome-keyring.service \
${./basic-service-expected.service}
'';
};
}

View File

@@ -0,0 +1,10 @@
[Install]
WantedBy=graphical-session-pre.target
[Service]
ExecStart=@gnome-keyring@/bin/gnome-keyring-daemon --start --foreground --components=pkcs11,secrets,ssh
Restart=on-abort
[Unit]
Description=GNOME Keyring
PartOf=graphical-session-pre.target

View File

@@ -0,0 +1,20 @@
{ config, ... }:
{
config = {
services.gnome-keyring = {
enable = true;
components = [
"pkcs11"
"secrets"
"ssh"
];
};
nmt.script = ''
assertFileContent \
home-files/.config/systemd/user/gnome-keyring.service \
${./custom-components-expected.service}
'';
};
}

View File

@@ -0,0 +1,6 @@
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
gnome-keyring-basic-service = ./basic-service.nix;
gnome-keyring-custom-components = ./custom-components.nix;
}