3
0
Fork 0
forked from mirrors/nixpkgs

nixos/tests/mysql-backup: test multiple mariadb versions

This commit is contained in:
ajs124 2021-12-08 16:54:59 +00:00
parent 37ba30c494
commit ef5d714f8c

View file

@ -1,6 +1,20 @@
# Test whether mysqlBackup option works
import ./../make-test-python.nix ({ pkgs, ... } : {
name = "mysql-backup";
{
system ? builtins.currentSystem,
config ? {},
pkgs ? import ../../.. { inherit system config; },
lib ? pkgs.lib
}:
let
inherit (import ./common.nix { inherit pkgs lib; }) mkTestName mariadbPackages;
makeTest = import ./../make-test-python.nix;
makeBackupTest = {
package,
name ? mkTestName package
}: makeTest {
name = "${name}-backup";
meta = with pkgs.lib.maintainers; {
maintainers = [ rvl ];
};
@ -8,9 +22,9 @@ import ./../make-test-python.nix ({ pkgs, ... } : {
nodes = {
master = { pkgs, ... }: {
services.mysql = {
inherit package;
enable = true;
initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];
package = pkgs.mariadb;
};
services.mysqlBackup = {
@ -53,4 +67,6 @@ import ./../make-test-python.nix ({ pkgs, ... } : {
"journalctl -u mysql-backup.service | grep 'fail.*doesnotexist' > /dev/null"
)
'';
})
};
in
lib.mapAttrs (_: package: makeBackupTest { inherit package; }) mariadbPackages