Skip to content

Commit

Permalink
nixos/tests/mysql: fix nogroup
Browse files Browse the repository at this point in the history
This fixes the evaluation after for NixOS#133166.
  • Loading branch information
rnhmjoj committed Sep 22, 2021
1 parent 08cd866 commit 87d76b1
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions nixos/tests/mysql/mysql.nix
Original file line number Diff line number Diff line change
@@ -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";
meta = with pkgs.lib.maintainers; {
maintainers = [ eelco shlevy ];
Expand All @@ -9,8 +31,8 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
{ pkgs, ... }:

{
users.users.testuser = { isSystemUser = true; };
users.users.testuser2 = { isSystemUser = true; };
imports = [ users ];

services.mysql.enable = true;
services.mysql.initialDatabases = [
{ name = "testdb3"; schema = ./testdb.sql; }
Expand Down Expand Up @@ -40,12 +62,12 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
{ pkgs, ... }:

{
imports = [ users ];

# prevent oom:
# Kernel panic - not syncing: Out of memory: compulsory panic_on_oom is enabled
virtualisation.memorySize = 1024;

users.users.testuser = { isSystemUser = true; };
users.users.testuser2 = { isSystemUser = true; };
services.mysql.enable = true;
services.mysql.initialDatabases = [
{ name = "testdb3"; schema = ./testdb.sql; }
Expand Down Expand Up @@ -75,8 +97,8 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
{ pkgs, ... }:

{
users.users.testuser = { isSystemUser = true; };
users.users.testuser2 = { isSystemUser = true; };
imports = [ users ];

services.mysql.enable = true;
services.mysql.initialScript = pkgs.writeText "mariadb-init.sql" ''
ALTER USER root@localhost IDENTIFIED WITH unix_socket;
Expand Down

0 comments on commit 87d76b1

Please sign in to comment.