introduce flake parts module for clan nixos tests

This commit is contained in:
Jörg Thalheim
2025-06-17 18:38:49 +02:00
parent 3ea159721c
commit 7515d54d9e
4 changed files with 116 additions and 48 deletions

View File

@@ -1,46 +1,29 @@
{
pkgs,
nixosLib,
clan-core,
module,
...
}:
nixosLib.runTest (
{ ... }:
{
imports = [
clan-core.modules.nixosVmTest.clanTest
];
name = "wifi-service";
hostPkgs = pkgs;
clan = {
directory = ./.;
test.useContainers = false;
inventory = {
name = "wifi-service";
machines.test = { };
clan = {
directory = ./.;
test.useContainers = false;
modules."@clan/wifi" = module;
inventory = {
instances = {
wg-test-one = {
module.name = "@clan/wifi";
machines.test = { };
instances = {
wg-test-one = {
module.name = "@clan/wifi";
roles.default.machines = {
test.settings.networks.one = { };
};
roles.default.machines = {
test.settings.networks.one = { };
};
};
};
};
};
testScript = ''
start_all()
test.wait_for_unit("NetworkManager.service")
psk = test.succeed("cat /run/NetworkManager/system-connections/one.nmconnection")
assert "password-eins" in psk, "Password is incorrect"
'';
}
)
testScript = ''
start_all()
test.wait_for_unit("NetworkManager.service")
psk = test.succeed("cat /run/NetworkManager/system-connections/one.nmconnection")
assert "password-eins" in psk, "Password is incorrect"
'';
}