forked from mirrors/nixpkgs
nixos/tests/mysql-backup: test multiple mariadb versions
This commit is contained in:
parent
37ba30c494
commit
ef5d714f8c
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue