mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
security.pki: add test for ca-certificates.crt
This commit is contained in:
parent
2e525a93da
commit
c50ba6a354
2 changed files with 25 additions and 0 deletions
|
@ -98,6 +98,7 @@ let
|
||||||
tests.nixpkgs-overlays = makeTest ./tests/nixpkgs-overlays.nix;
|
tests.nixpkgs-overlays = makeTest ./tests/nixpkgs-overlays.nix;
|
||||||
tests.programs-ssh = makeTest ./tests/programs-ssh.nix;
|
tests.programs-ssh = makeTest ./tests/programs-ssh.nix;
|
||||||
tests.programs-zsh = makeTest ./tests/programs-zsh.nix;
|
tests.programs-zsh = makeTest ./tests/programs-zsh.nix;
|
||||||
|
tests.security-pki = makeTest ./tests/security-pki.nix;
|
||||||
tests.services-activate-system = makeTest ./tests/services-activate-system.nix;
|
tests.services-activate-system = makeTest ./tests/services-activate-system.nix;
|
||||||
tests.services-buildkite-agent = makeTest ./tests/services-buildkite-agent.nix;
|
tests.services-buildkite-agent = makeTest ./tests/services-buildkite-agent.nix;
|
||||||
tests.services-nix-daemon = makeTest ./tests/services-nix-daemon.nix;
|
tests.services-nix-daemon = makeTest ./tests/services-nix-daemon.nix;
|
||||||
|
|
24
tests/security-pki.nix
Normal file
24
tests/security-pki.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
security.pki.certificates = [
|
||||||
|
''
|
||||||
|
Fake Root CA
|
||||||
|
------------
|
||||||
|
''
|
||||||
|
];
|
||||||
|
|
||||||
|
test = ''
|
||||||
|
echo "checking for ca-certificates.crt in /etc" >&2
|
||||||
|
test -e ${config.out}/etc/ssl/certs/ca-certificates.crt
|
||||||
|
|
||||||
|
echo "checking NIX_SSL_CERT_FILE in set-environment" >&2
|
||||||
|
grep 'NIX_SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"' ${config.system.build.setEnvironment}
|
||||||
|
|
||||||
|
echo "checking for certificates in ca-certificates.crt" >&2
|
||||||
|
grep -q 'BEGIN CERTIFICATE' ${config.out}/etc/ssl/certs/ca-certificates.crt
|
||||||
|
|
||||||
|
echo "checking for extra certificate in ca-certificates.crt" >&2
|
||||||
|
grep 'Fake Root CA' ${config.out}/etc/ssl/certs/ca-certificates.crt
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue