sshd: migrate to clan.nixosTests module

This commit is contained in:
Jörg Thalheim
2025-06-17 19:32:04 +02:00
parent 2c0c4cf342
commit b5bdf4b0c7
2 changed files with 44 additions and 55 deletions

View File

@@ -1,18 +1,19 @@
{ lib, self, ... }: { lib, ... }:
let
module = lib.modules.importApply ./default.nix { };
in
{ {
clan.modules = { clan.modules = {
sshd = lib.modules.importApply ./default.nix { }; sshd = module;
}; };
perSystem = perSystem =
{ pkgs, ... }: { ... }:
{ {
checks = lib.optionalAttrs (pkgs.stdenv.isLinux) { clan.nixosTests.sshd = {
sshd = import ./tests/vm/default.nix { imports = [ ./tests/vm/default.nix ];
inherit pkgs;
clan-core = self; clan.modules."@clan/sshd" = module;
nixosLib = import (self.inputs.nixpkgs + "/nixos/lib") { };
};
}; };
}; };

View File

@@ -1,24 +1,13 @@
{ {
module,
pkgs, pkgs,
nixosLib,
clan-core,
... ...
}: }:
nixosLib.runTest (
{ ... }:
{ {
imports = [
clan-core.modules.nixosVmTest.clanTest
];
hostPkgs = pkgs;
name = "sshd"; name = "sshd";
clan = { clan = {
directory = ./.; directory = ./.;
modules."@clan/sshd" = ../../default.nix;
inventory = { inventory = {
machines.server = { }; machines.server = { };
machines.client = { }; machines.client = { };
@@ -59,4 +48,3 @@ nixosLib.runTest (
client.succeed("grep '^.cert-authority ssh-ca.*example.com ssh-ed25519 ' /etc/ssh/ssh_known_hosts") client.succeed("grep '^.cert-authority ssh-ca.*example.com ssh-ed25519 ' /etc/ssh/ssh_known_hosts")
''; '';
} }
)