test(nginx): Add simple tests to assert nginx features work
This commit is contained in:
parent
4e59582de2
commit
12790d5444
6 changed files with 178 additions and 2 deletions
|
|
@ -1 +1,6 @@
|
|||
{ imports = [ ./crowdsec ]; }
|
||||
{
|
||||
imports = [
|
||||
./crowdsec
|
||||
./serviceTests/stub.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
27
modules/serviceTests/mocks.nix
Normal file
27
modules/serviceTests/mocks.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
Module containing mock definitions for service test runners.
|
||||
*/
|
||||
{ flake-inputs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
flake-inputs.sops-nix.nixosModules.sops
|
||||
../.
|
||||
../../configuration/services/backups.nix
|
||||
];
|
||||
|
||||
sops.defaultSopsFile = ../../keys/staging.yaml;
|
||||
environment.etc."staging.key" = {
|
||||
mode = "0400";
|
||||
source = ../../keys/hosts/staging.key;
|
||||
};
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
hostKeys = lib.mkForce [
|
||||
{
|
||||
type = "rsa";
|
||||
bits = 4096;
|
||||
path = "/etc/staging.key";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
20
modules/serviceTests/stub.nix
Normal file
20
modules/serviceTests/stub.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
Module to make writing service-specific tests easy.
|
||||
*/
|
||||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
serviceTests = mkOption {
|
||||
type = types.attrsOf types.package;
|
||||
|
||||
description = ''
|
||||
NixOS tests to run.
|
||||
'';
|
||||
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue