mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-26 08:48:38 +03:00
nixos/chrony: add simple test
This commit is contained in:
parent
c13c1412bf
commit
50e7a02e67
@ -167,6 +167,7 @@ in {
|
||||
cgit = handleTest ./cgit.nix {};
|
||||
charliecloud = handleTest ./charliecloud.nix {};
|
||||
chromium = (handleTestOn ["aarch64-linux" "x86_64-linux"] ./chromium.nix {}).stable or {};
|
||||
chrony = handleTestOn ["aarch64-linux" "x86_64-linux"] ./chrony.nix {};
|
||||
chrony-ptp = handleTestOn ["aarch64-linux" "x86_64-linux"] ./chrony-ptp.nix {};
|
||||
cinnamon = handleTest ./cinnamon.nix {};
|
||||
cjdns = handleTest ./cjdns.nix {};
|
||||
|
31
nixos/tests/chrony.nix
Normal file
31
nixos/tests/chrony.nix
Normal file
@ -0,0 +1,31 @@
|
||||
import ./make-test-python.nix ({ lib, ... }:
|
||||
{
|
||||
name = "chrony";
|
||||
|
||||
meta = {
|
||||
maintainers = with lib.maintainers; [ fpletz ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
default = {
|
||||
services.chrony.enable = true;
|
||||
};
|
||||
graphene-hardened = {
|
||||
services.chrony.enable = true;
|
||||
services.chrony.enableMemoryLocking = true;
|
||||
environment.memoryAllocator.provider = "graphene-hardened";
|
||||
# dhcpcd privsep is incompatible with graphene-hardened
|
||||
networking.useNetworkd = true;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = {nodes, ...} : let
|
||||
graphene-hardened = nodes.graphene-hardened.system.build.toplevel;
|
||||
in ''
|
||||
default.start()
|
||||
default.wait_for_unit('multi-user.target')
|
||||
default.succeed('systemctl is-active chronyd.service')
|
||||
default.succeed('${graphene-hardened}/bin/switch-to-configuration test')
|
||||
default.succeed('systemctl is-active chronyd.service')
|
||||
'';
|
||||
})
|
@ -1,6 +1,7 @@
|
||||
{ lib, stdenv, fetchurl, pkg-config
|
||||
, gnutls, libedit, nspr, nss, readline, texinfo
|
||||
, libcap, libseccomp, pps-tools
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@ -36,6 +37,8 @@ stdenv.mkDerivation rec {
|
||||
|
||||
hardeningEnable = [ "pie" ];
|
||||
|
||||
passthru.tests = { inherit (nixosTests) chrony chrony-ptp; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Sets your computer's clock from time servers on the Net";
|
||||
homepage = "https://chrony.tuxfamily.org/";
|
||||
|
Loading…
Reference in New Issue
Block a user