clanServices: init test clan_lib.metrics.version::get_nixos_systems

This commit is contained in:
Qubasa
2025-08-20 21:51:10 +02:00
parent b7798f5466
commit 6546f8a952
2 changed files with 26 additions and 3 deletions

View File

@@ -8,11 +8,15 @@ in
clan.modules.monitoring = module;
perSystem =
{ ... }:
{ pkgs, ... }:
{
clan.nixosTests.monitoring = {
imports = [ ./tests/vm/default.nix ];
imports = [
(lib.modules.importApply ./tests/vm/default.nix {
inherit (self) packages;
inherit pkgs;
})
];
clan.modules.monitoring = module;
};
};

View File

@@ -1,3 +1,4 @@
{ packages, pkgs, ... }:
{
name = "monitoring";
@@ -16,9 +17,27 @@
};
};
extraPythonPackages = _p: [
(pkgs.python3.pkgs.toPythonModule packages.${pkgs.system}.clan-cli)
];
testScript =
{ ... }:
''
import time
start_all()
time.sleep(99999)
peer1.wait_for_unit("network-online.target")
peer1.wait_for_unit("telegraf.service")
from clan_lib.metrics.version import get_nixos_systems
from clan_lib.machines.machines import Machine as ClanMachine
from clan_lib.flake import Flake
# mymachine = ClanMachine("peer1", Flake("."))
# data = get_nixos_systems(mymachine, )
# assert data["current_system"] is not None
time.sleep(99999)
'';
}