From feab16815eb81f28d72518562a811ccb9bd9b292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Thu, 8 Jan 2026 18:56:21 +0100 Subject: [PATCH] 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). --- nixos/tests/all-tests.nix | 1 + nixos/tests/pcsclite.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 nixos/tests/pcsclite.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 282835431246..3f21e9b9e63c 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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; diff --git a/nixos/tests/pcsclite.nix b/nixos/tests/pcsclite.nix new file mode 100644 index 000000000000..de70e7fb9313 --- /dev/null +++ b/nixos/tests/pcsclite.nix @@ -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") + ''; +}