tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/chrony: add simple test
Franz Pletz
2 years ago
50e7a02e
c13c1412
+35
3 changed files
expand all
collapse all
unified
split
nixos
tests
all-tests.nix
chrony.nix
pkgs
tools
networking
chrony
default.nix
+1
nixos/tests/all-tests.nix
···
167
cgit = handleTest ./cgit.nix {};
168
charliecloud = handleTest ./charliecloud.nix {};
169
chromium = (handleTestOn ["aarch64-linux" "x86_64-linux"] ./chromium.nix {}).stable or {};
0
170
chrony-ptp = handleTestOn ["aarch64-linux" "x86_64-linux"] ./chrony-ptp.nix {};
171
cinnamon = handleTest ./cinnamon.nix {};
172
cjdns = handleTest ./cjdns.nix {};
···
167
cgit = handleTest ./cgit.nix {};
168
charliecloud = handleTest ./charliecloud.nix {};
169
chromium = (handleTestOn ["aarch64-linux" "x86_64-linux"] ./chromium.nix {}).stable or {};
170
+
chrony = handleTestOn ["aarch64-linux" "x86_64-linux"] ./chrony.nix {};
171
chrony-ptp = handleTestOn ["aarch64-linux" "x86_64-linux"] ./chrony-ptp.nix {};
172
cinnamon = handleTest ./cinnamon.nix {};
173
cjdns = handleTest ./cjdns.nix {};
+31
nixos/tests/chrony.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
import ./make-test-python.nix ({ lib, ... }:
2
+
{
3
+
name = "chrony";
4
+
5
+
meta = {
6
+
maintainers = with lib.maintainers; [ fpletz ];
7
+
};
8
+
9
+
nodes = {
10
+
default = {
11
+
services.chrony.enable = true;
12
+
};
13
+
graphene-hardened = {
14
+
services.chrony.enable = true;
15
+
services.chrony.enableMemoryLocking = true;
16
+
environment.memoryAllocator.provider = "graphene-hardened";
17
+
# dhcpcd privsep is incompatible with graphene-hardened
18
+
networking.useNetworkd = true;
19
+
};
20
+
};
21
+
22
+
testScript = {nodes, ...} : let
23
+
graphene-hardened = nodes.graphene-hardened.system.build.toplevel;
24
+
in ''
25
+
default.start()
26
+
default.wait_for_unit('multi-user.target')
27
+
default.succeed('systemctl is-active chronyd.service')
28
+
default.succeed('${graphene-hardened}/bin/switch-to-configuration test')
29
+
default.succeed('systemctl is-active chronyd.service')
30
+
'';
31
+
})
+3
pkgs/tools/networking/chrony/default.nix
···
1
{ lib, stdenv, fetchurl, pkg-config
2
, gnutls, libedit, nspr, nss, readline, texinfo
3
, libcap, libseccomp, pps-tools
0
4
}:
5
6
stdenv.mkDerivation rec {
···
35
'';
36
37
hardeningEnable = [ "pie" ];
0
0
38
39
meta = with lib; {
40
description = "Sets your computer's clock from time servers on the Net";
···
1
{ lib, stdenv, fetchurl, pkg-config
2
, gnutls, libedit, nspr, nss, readline, texinfo
3
, libcap, libseccomp, pps-tools
4
+
, nixosTests
5
}:
6
7
stdenv.mkDerivation rec {
···
36
'';
37
38
hardeningEnable = [ "pie" ];
39
+
40
+
passthru.tests = { inherit (nixosTests) chrony chrony-ptp; };
41
42
meta = with lib; {
43
description = "Sets your computer's clock from time servers on the Net";