Genode Packages collection https://git.sr.ht/~ehmry/genodepkgs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
1.8 KiB

# SPDX-License-Identifier: CC0-1.0
{ system, apps, testPkgs, hostPkgs, lib, depot }:
let
mkTest = { name ? "unamed", testConfig, env ? { }, ... }:
let
env' = {
DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall";
DHALL_GENODE = "${testPkgs.dhallGenode}/package.dhall";
BASE_NOVA_MANIFEST = testPkgs.genode.base-nova.manifest;
OS_MANIFEST = testPkgs.genode.os.manifest;
SOTEST_PRODUCER_MANIFEST = testPkgs.sotest-producer.manifest;
} // env;
drv = hostPkgs.runCommand "nova-${name}-sotest" env' ''
${apps.nova-image.program} image.elf \
${./driver-nova-config.dhall} ${testConfig}
cp "${testPkgs.bender}" bender
cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
mkdir -p $out/nix-support
${hostPkgs.zip}/bin/zip "$out/binaries.zip" \
bender hypervisor image.elf
${apps.dhall-to-yaml.program} < ${
./sotest_config.dhall
} > "$out/sotest_config.yaml"
echo file zip $out/binaries.zip >> "$out/nix-support/hydra-build-products"
echo file config $out/sotest_config.yaml >> "$out/nix-support/hydra-build-products"
'';
in drv // {
config = hostPkgs.runCommand (name + ".dhall") env' ''
${apps.dhall.program} <<< "(${
./driver-nova-config.dhall
} ${testConfig})" > $out
'';
xml = hostPkgs.runCommand (name + ".config") env' ''
${apps.render-init.program} "(${
./driver-nova-config.dhall
} ${testConfig}).config" > $out'';
};
in {
callTest = path: args:
(import path ({
testEnv = {
inherit mkTest lib;
isLinux = false;
isNova = true;
};
pkgs = testPkgs;
inherit depot;
} // args));
}