diff --git a/clanServices/monitoring/flake-module.nix b/clanServices/monitoring/flake-module.nix index de23010cc..cf159aaf2 100644 --- a/clanServices/monitoring/flake-module.nix +++ b/clanServices/monitoring/flake-module.nix @@ -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; }; }; diff --git a/clanServices/monitoring/tests/vm/default.nix b/clanServices/monitoring/tests/vm/default.nix index 5d2836e71..50e98547d 100644 --- a/clanServices/monitoring/tests/vm/default.nix +++ b/clanServices/monitoring/tests/vm/default.nix @@ -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) ''; }