flake: VM: add additional disk with empty ext4 FS
continuous-integration/drone/push Build is failing Details

vm-disk
Alexander 2024-03-08 14:40:27 +04:00
parent 69774ba186
commit 5d01c25f3b
1 changed files with 35 additions and 31 deletions

View File

@ -113,38 +113,42 @@
"black --check ${self.outPath} > $out"; "black --check ${self.outPath} > $out";
default = default =
pkgs.testers.runNixOSTest { pkgs.testers.runNixOSTest {
imports = [{ name = "default";
name = "default"; nodes.machine = { lib, pkgs, ... }: {
nodes.machine = { lib, pkgs, ... }: { # additional disk of size 1024 MiB with empty ext4 FS
imports = [{ virtualisation.emptyDiskImages = [ 1024 ];
boot.consoleLogLevel = lib.mkForce 3; virtualisation.fileSystems."/volumes/vdb" = {
documentation.enable = false; autoFormat = true;
services.journald.extraConfig = lib.mkForce ""; device = "/dev/vdb"; # this name is chosen by QEMU, not here
services.redis.servers.sp-api = { fsType = "ext4";
enable = true; noCheck = true;
save = [ ];
port = 6379; # FIXME
settings.notify-keyspace-events = "KEA";
};
environment.systemPackages = with pkgs; [
python-env
# TODO: these can be passed via wrapper script around app
rclone
restic
];
environment.variables.TEST_MODE = "true";
systemd.tmpfiles.settings.src.${vmtest-src-dir}.L.argument =
self.outPath;
}];
}; };
testScript = '' boot.consoleLogLevel = lib.mkForce 3;
start_all() documentation.enable = false;
machine.succeed("cd ${vmtest-src-dir} && coverage run --data-file=/tmp/.coverage -m pytest -p no:cacheprovider -v >&2") services.journald.extraConfig = lib.mkForce "";
machine.succeed("coverage xml --rcfile=${vmtest-src-dir}/.coveragerc --data-file=/tmp/.coverage >&2") services.redis.servers.sp-api = {
machine.copy_from_vm("coverage.xml", ".") enable = true;
machine.succeed("coverage report >&2") save = [ ];
''; port = 6379; # FIXME
}]; settings.notify-keyspace-events = "KEA";
};
environment.systemPackages = with pkgs; [
python-env
# TODO: these can be passed via wrapper script around app
rclone
restic
];
environment.variables.TEST_MODE = "true";
systemd.tmpfiles.settings.src.${vmtest-src-dir}.L.argument =
self.outPath;
};
testScript = ''
start_all()
machine.succeed("cd ${vmtest-src-dir} && coverage run --data-file=/tmp/.coverage -m pytest -p no:cacheprovider -v >&2")
machine.succeed("coverage xml --rcfile=${vmtest-src-dir}/.coveragerc --data-file=/tmp/.coverage >&2")
machine.copy_from_vm("coverage.xml", ".")
machine.succeed("coverage report >&2")
'';
}; };
}; };
}; };