nixos/tests/mysql: fix nogroup

This fixes the evaluation after for #133166.
This commit is contained in:
rnhmjoj 2021-09-22 11:19:26 +02:00
parent 08cd8667ee
commit 87d76b1783
No known key found for this signature in database
GPG Key ID: BFBAF4C975F76450

View File

@ -1,4 +1,26 @@
import ./../make-test-python.nix ({ pkgs, ...} : { import ./../make-test-python.nix ({ pkgs, ...}:
let
# Setup common users
users = { ... }:
{
users.groups.testusers = { };
users.users.testuser = {
isSystemUser = true;
group = "testusers";
};
users.users.testuser2 = {
isSystemUser = true;
group = "testusers";
};
};
in
{
name = "mysql"; name = "mysql";
meta = with pkgs.lib.maintainers; { meta = with pkgs.lib.maintainers; {
maintainers = [ eelco shlevy ]; maintainers = [ eelco shlevy ];
@ -9,8 +31,8 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
{ pkgs, ... }: { pkgs, ... }:
{ {
users.users.testuser = { isSystemUser = true; }; imports = [ users ];
users.users.testuser2 = { isSystemUser = true; };
services.mysql.enable = true; services.mysql.enable = true;
services.mysql.initialDatabases = [ services.mysql.initialDatabases = [
{ name = "testdb3"; schema = ./testdb.sql; } { name = "testdb3"; schema = ./testdb.sql; }
@ -40,12 +62,12 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ users ];
# prevent oom: # prevent oom:
# Kernel panic - not syncing: Out of memory: compulsory panic_on_oom is enabled # Kernel panic - not syncing: Out of memory: compulsory panic_on_oom is enabled
virtualisation.memorySize = 1024; virtualisation.memorySize = 1024;
users.users.testuser = { isSystemUser = true; };
users.users.testuser2 = { isSystemUser = true; };
services.mysql.enable = true; services.mysql.enable = true;
services.mysql.initialDatabases = [ services.mysql.initialDatabases = [
{ name = "testdb3"; schema = ./testdb.sql; } { name = "testdb3"; schema = ./testdb.sql; }
@ -75,8 +97,8 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
{ pkgs, ... }: { pkgs, ... }:
{ {
users.users.testuser = { isSystemUser = true; }; imports = [ users ];
users.users.testuser2 = { isSystemUser = true; };
services.mysql.enable = true; services.mysql.enable = true;
services.mysql.initialScript = pkgs.writeText "mariadb-init.sql" '' services.mysql.initialScript = pkgs.writeText "mariadb-init.sql" ''
ALTER USER root@localhost IDENTIFIED WITH unix_socket; ALTER USER root@localhost IDENTIFIED WITH unix_socket;