nixosTests.pcsclite: init

Add a small test to verify that the pcscd socket unit works, and that a
client can connect (which requires auto-starting pcscd.service).
This commit is contained in:
Bjørn Forsman
2026-01-08 18:56:21 +01:00
parent b90a941bd4
commit feab16815e
2 changed files with 30 additions and 0 deletions

View File

@@ -1227,6 +1227,7 @@ in
pass-secret-service = runTest ./pass-secret-service.nix;
password-option-override-ordering = runTest ./password-option-override-ordering.nix;
patroni = handleTestOn [ "x86_64-linux" ] ./patroni.nix { };
pcsclite = runTest ./pcsclite.nix;
pdns-recursor = runTest ./pdns-recursor.nix;
peerflix = runTest ./peerflix.nix;
peering-manager = runTest ./web-apps/peering-manager.nix;

29
nixos/tests/pcsclite.nix Normal file
View File

@@ -0,0 +1,29 @@
{
lib,
...
}:
{
name = "pcsclite";
meta.maintainers = [ lib.maintainers.bjornfor ];
nodes = {
machine =
{ pkgs, ... }:
{
environment.systemPackages = [
pkgs.pcsc-tools
];
services.pcscd = {
enable = true;
};
};
};
testScript = ''
machine.wait_for_unit("pcscd.socket")
with subtest("client can connect"):
machine.succeed("pcsc_scan -r")
'';
}