test(gnupg): add tests for gnupg agent configuration
Signed-off-by: Angel J <78835633+Iamanaws@users.noreply.github.com>
This commit is contained in:
parent
0b53d57d3a
commit
d70b24c2a8
2 changed files with 32 additions and 0 deletions
|
|
@ -90,6 +90,7 @@ in {
|
||||||
tests.networking-networkservices = makeTest ./tests/networking-networkservices.nix;
|
tests.networking-networkservices = makeTest ./tests/networking-networkservices.nix;
|
||||||
tests.nix-enable = makeTest ./tests/nix-enable.nix;
|
tests.nix-enable = makeTest ./tests/nix-enable.nix;
|
||||||
tests.nixpkgs-overlays = makeTest ./tests/nixpkgs-overlays.nix;
|
tests.nixpkgs-overlays = makeTest ./tests/nixpkgs-overlays.nix;
|
||||||
|
tests.programs-gnupg = makeTest ./tests/programs-gnupg.nix;
|
||||||
tests.programs-ssh = makeTest ./tests/programs-ssh.nix;
|
tests.programs-ssh = makeTest ./tests/programs-ssh.nix;
|
||||||
tests.programs-tmux = makeTest ./tests/programs-tmux.nix;
|
tests.programs-tmux = makeTest ./tests/programs-tmux.nix;
|
||||||
tests.programs-zsh = makeTest ./tests/programs-zsh.nix;
|
tests.programs-zsh = makeTest ./tests/programs-zsh.nix;
|
||||||
|
|
|
||||||
31
tests/programs-gnupg.nix
Normal file
31
tests/programs-gnupg.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
gnupg = pkgs.runCommand "gnupg-0.0.0" { } "mkdir -p $out/bin";
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
system.primaryUser = "test-gnupg-user";
|
||||||
|
|
||||||
|
programs.gnupg.package = gnupg;
|
||||||
|
programs.gnupg.agent.enable = true;
|
||||||
|
programs.gnupg.agent.enableSSHSupport = true;
|
||||||
|
|
||||||
|
test = ''
|
||||||
|
echo >&2 "checking gnupg-agent service in ~/Library/LaunchAgents"
|
||||||
|
grep "org.nixos.gnupg-agent" ${config.out}/user/Library/LaunchAgents/org.nixos.gnupg-agent.plist
|
||||||
|
grep "${gnupg}/bin/gpg-connect-agent" ${config.out}/user/Library/LaunchAgents/org.nixos.gnupg-agent.plist
|
||||||
|
|
||||||
|
echo >&2 "checking GPG_TTY in set-environment"
|
||||||
|
grep 'export GPG_TTY=\$(tty)' ${config.system.build.setEnvironment}
|
||||||
|
|
||||||
|
echo >&2 "checking SSH support in set-environment"
|
||||||
|
grep "${gnupg}/bin/gpg-connect-agent --quiet updatestartuptty /bye" ${config.system.build.setEnvironment}
|
||||||
|
grep "${gnupg}/bin/gpgconf --list-dirs agent-ssh-socket" ${config.system.build.setEnvironment}
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue