2
0
Fork 0
genodepkgs/tests/default.nix

89 lines
2.5 KiB
Nix

{ flake, system, localSystem, crossSystem, pkgs }:
let
apps = flake.apps.${system};
localPackages = flake.legacyPackages.${localSystem};
lib = flake.lib.${system};
nixpkgs = flake.legacyPackages.${system};
legacyPackages = flake.legacyPackages.${system};
testingPython = import ./lib/testing-python.nix;
testSpecs = map (p: import p) [
./log.nix
./lighttpd.nix
# ./posix.nix
# ./tox-bootstrapd.nix
# ./vmm_arm.nix
# ./vmm_x86.nix
./x86.nix
]; # TODO ++ (callTest ./solo5);
qemu' = localPackages.qemu;
qemuBinary = qemuPkg:
{
aarch64-genode = "${qemuPkg}/bin/qemu-system-aarch64";
x86_64-genode = "${qemuPkg}/bin/qemu-system-x86_64";
}.${pkgs.stdenv.hostPlatform.system};
# TODO: move the cores into nixos modules
cores = [
{
prefix = "hw-pc-";
testingPython = testingPython {
inherit flake system localSystem crossSystem pkgs;
extraConfigurations = [ ../nixos-modules/base-hw-pc.nix ];
};
specs = [ "x86" "hw" ];
platforms = [ "x86_64-genode" ];
}
/* {
prefix = "hw-virt_qemu-";
testingPython = testingPython {
inherit flake system localSystem crossSystem pkgs;
extraConfigurations = [ ../nixos-modules/base-hw-virt_qemu.nix ];
};
specs = [ "aarch64" "hw" ];
platforms = [ "aarch64-genode" ];
startVM = vmName: image: ''
#! ${localPackages.runtimeShell}
exec ${qemuBinary qemu'} \
-name ${vmName} \
-M virt,virtualization=true,gic_version=3 \
-cpu cortex-a53 \
-smp 4 \
-m 384 \
-kernel "${image}/image.elf" \
$QEMU_OPTS \
"$@"
'';
}
*/
{
prefix = "nova-";
testingPython = testingPython {
inherit flake system localSystem crossSystem pkgs;
extraConfigurations = [ ../nixos-modules/nova.nix ];
};
specs = [ "x86" "nova" ];
platforms = [ "x86_64-genode" ];
}
];
cores' = builtins.filter (core:
builtins.any (x: x == pkgs.stdenv.hostPlatform.system) core.platforms)
cores;
testList = let
f = core: test:
if (test.constraints or (_: true)) core.specs then {
name = core.prefix + test.name;
value = core.testingPython.makeTest test;
} else
null;
in lib.lists.crossLists f [ cores' testSpecs ];
in builtins.listToAttrs (builtins.filter (_: _ != null) testList)