clanServices: Move localsend test to appropriate location
Move the localsend clanService test to the localsend clan service.
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
{ lib, ... }:
|
||||
{ lib, self, ... }:
|
||||
{
|
||||
clan.modules = {
|
||||
localsend = lib.modules.importApply ./default.nix { };
|
||||
};
|
||||
|
||||
perSystem =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
checks = lib.optionalAttrs (pkgs.stdenv.isLinux) {
|
||||
localsend = import ./tests/vm/default.nix {
|
||||
inherit pkgs;
|
||||
clan-core = self;
|
||||
nixosLib = import (self.inputs.nixpkgs + "/nixos/lib") { };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
51
clanServices/localsend/tests/vm/default.nix
Normal file
51
clanServices/localsend/tests/vm/default.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
pkgs,
|
||||
nixosLib,
|
||||
clan-core,
|
||||
...
|
||||
}:
|
||||
|
||||
nixosLib.runTest (
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
clan-core.modules.nixosVmTest.clanTest
|
||||
];
|
||||
|
||||
hostPkgs = pkgs;
|
||||
|
||||
name = "localsend";
|
||||
|
||||
clan = {
|
||||
directory = ./.;
|
||||
modules."@clan/localsend" = ../../default.nix;
|
||||
inventory = {
|
||||
machines.server = { };
|
||||
|
||||
instances = {
|
||||
localsend-test = {
|
||||
module.name = "@clan/localsend";
|
||||
roles.default.machines."server".settings = {
|
||||
displayName = "Test Instance";
|
||||
ipv4Addr = "192.168.56.2/24";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes = {
|
||||
server = { };
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
# Check that the localsend wrapper script is available
|
||||
server.succeed("command -v localsend")
|
||||
|
||||
# Verify the 09-zerotier network is configured with the specified IP address
|
||||
server.succeed("grep -q 'Address=192.168.56.2/24' /etc/systemd/network/09-zerotier.network")
|
||||
'';
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"publickey": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
|
||||
"type": "age"
|
||||
}
|
||||
Reference in New Issue
Block a user