mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-09-11 12:49:18 +03:00
security.pki: add test for ca-certificates.crt
This commit is contained in:
parent
2e525a93da
commit
c50ba6a354
@ -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 New Issue
Block a user