nixosTests.chrony-ptp: handleTest -> runTest

This commit is contained in:
Sizhe Zhao 2025-06-07 19:46:40 +08:00
parent 4f26991b9f
commit 950a25abb6
No known key found for this signature in database
GPG Key ID: ED1807251A7DA08F
2 changed files with 21 additions and 29 deletions

View File

@ -312,7 +312,7 @@ in
chromadb = runTest ./chromadb.nix;
chromium = (handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./chromium.nix { }).stable or { };
chrony = runTestOn [ "aarch64-linux" "x86_64-linux" ] ./chrony.nix;
chrony-ptp = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./chrony-ptp.nix { };
chrony-ptp = runTestOn [ "aarch64-linux" "x86_64-linux" ] ./chrony-ptp.nix;
cinnamon = runTest ./cinnamon.nix;
cinnamon-wayland = runTest ./cinnamon-wayland.nix;
cjdns = runTest ./cjdns.nix;

View File

@ -1,32 +1,24 @@
import ./make-test-python.nix (
{ lib, ... }:
{
name = "chrony-ptp";
{ lib, ... }:
{
name = "chrony-ptp";
meta = {
maintainers = with lib.maintainers; [ gkleen ];
meta.maintainers = with lib.maintainers; [ gkleen ];
nodes.qemuGuest = {
boot.kernelModules = [ "ptp_kvm" ];
services.chrony = {
enable = true;
extraConfig = ''
refclock PHC /dev/ptp_kvm poll 2 dpoll -2 offset 0 stratum 3
'';
};
};
nodes = {
qemuGuest =
{ lib, ... }:
{
boot.kernelModules = [ "ptp_kvm" ];
testScript = ''
start_all()
services.chrony = {
enable = true;
extraConfig = ''
refclock PHC /dev/ptp_kvm poll 2 dpoll -2 offset 0 stratum 3
'';
};
};
};
testScript = ''
start_all()
qemuGuest.wait_for_unit('multi-user.target')
qemuGuest.succeed('systemctl is-active chronyd.service')
'';
}
)
qemuGuest.wait_for_unit('multi-user.target')
qemuGuest.succeed('systemctl is-active chronyd.service')
'';
}