nixos/tests: fix discrepancy between nix-build and nix build

This commit is contained in:
Jacob Moody 2023-12-23 22:40:56 -06:00
parent 04e1a2d69c
commit 4db920ed4f
6 changed files with 35 additions and 36 deletions

View File

@ -464,7 +464,7 @@ in {
keymap = handleTest ./keymap.nix {};
knot = handleTest ./knot.nix {};
komga = handleTest ./komga.nix {};
krb5 = discoverTests (import ./krb5 {});
krb5 = discoverTests (import ./krb5);
ksm = handleTest ./ksm.nix {};
kthxbye = handleTest ./kthxbye.nix {};
kubernetes = handleTestOn ["x86_64-linux"] ./kubernetes {};

View File

@ -40,4 +40,4 @@ let
'';
});
in
builtins.mapAttrs (k: v: mkTest k v { }) tests
builtins.mapAttrs (k: v: mkTest k v) tests

View File

@ -6,8 +6,8 @@ let
certs = import ./common/acme/server/snakeoil-certs.nix;
frontendUrl = "https://${certs.domain}";
keycloakTest = import ./make-test-python.nix (
{ pkgs, databaseType, ... }:
keycloakTest = databaseType: import ./make-test-python.nix (
{ pkgs, ... }:
let
initialAdminPassword = "h4Iho\"JFn't2>iQIR9";
adminPasswordFile = pkgs.writeText "admin-password" "${initialAdminPassword}";
@ -76,16 +76,18 @@ let
enabled = true;
realm = "test-realm";
clients = [ client ];
users = [(
user // {
enabled = true;
credentials = [{
type = "password";
temporary = false;
value = password;
}];
}
)];
users = [
(
user // {
enabled = true;
credentials = [{
type = "password";
temporary = false;
value = password;
}];
}
)
];
};
realmDataJson = pkgs.writeText "realm-data.json" (builtins.toJSON realm);
@ -177,7 +179,7 @@ let
);
in
{
postgres = keycloakTest { databaseType = "postgresql"; };
mariadb = keycloakTest { databaseType = "mariadb"; };
mysql = keycloakTest { databaseType = "mysql"; };
postgres = keycloakTest "postgresql";
mariadb = keycloakTest "mariadb";
mysql = keycloakTest "mysql";
}

View File

@ -1,4 +1,3 @@
{ system ? builtins.currentSystem }:
{
example-config = import ./example-config.nix { inherit system; };
example-config = import ./example-config.nix;
}

View File

@ -1,7 +1,7 @@
let
opensearchTest =
opensearchTest = extraSettings:
import ./make-test-python.nix (
{ pkgs, lib, extraSettings ? {} }: {
{ pkgs, lib, ... }: {
name = "opensearch";
meta.maintainers = with pkgs.lib.maintainers; [ shyim ];
@ -27,20 +27,18 @@ in
{
opensearch = opensearchTest {};
opensearchCustomPathAndUser = opensearchTest {
extraSettings = {
services.opensearch.dataDir = "/var/opensearch_test";
services.opensearch.user = "open_search";
services.opensearch.group = "open_search";
systemd.tmpfiles.rules = [
"d /var/opensearch_test 0700 open_search open_search -"
];
users = {
groups.open_search = {};
users.open_search = {
description = "OpenSearch daemon user";
group = "open_search";
isSystemUser = true;
};
services.opensearch.dataDir = "/var/opensearch_test";
services.opensearch.user = "open_search";
services.opensearch.group = "open_search";
systemd.tmpfiles.rules = [
"d /var/opensearch_test 0700 open_search open_search -"
];
users = {
groups.open_search = { };
users.open_search = {
description = "OpenSearch daemon user";
group = "open_search";
isSystemUser = true;
};
};
};

View File

@ -76,4 +76,4 @@ let
});
in
builtins.mapAttrs (k: v: mkTest k v { }) tests
builtins.mapAttrs (k: v: mkTest k v) tests