2
0
Fork 0

tests: make sotest opt-in

Sotest must be explicitly enabled for tests. Use new build-product
subtypes for hydra. Use bender binary provided by Cyberus.
This commit is contained in:
Ehmry - 2020-04-15 13:55:32 +05:30
parent 78c5a2bb19
commit 722edd4d8e
6 changed files with 39 additions and 31 deletions

View File

@ -56,12 +56,13 @@ let
hw-sotest = map ({ name, value }: {
name = name + "-sotest";
value = value.sotest;
}) (testsToList hw);
}) (builtins.filter ({ name, value }: !isNull value.sotest) (testsToList hw));
nova-sotest = map ({ name, value }: {
name = name + "-sotest";
value = value.sotest;
}) (testsToList nova);
}) (builtins.filter ({ name, value }: !isNull value.sotest)
(testsToList nova));
in with builtins;
listToAttrs ((concatLists (map (testsToList) [ linux hw nova ])) ++ hw-sotest

View File

@ -38,7 +38,7 @@ let
''run_genode_until {[init] child "harness" exited with exit value 0} 60'';
mkTest = { name ? "unamed", testScript ? defaultScript, testConfig
, testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], ... }@t:
, testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], sotest ? false, ... }@t:
let
manifest = lib.mergeManifests (map addManifest
(with testPkgs; [ base-hw-pc init sotest-producer ] ++ testInputs));
@ -141,18 +141,21 @@ let
xml = buildPackages.runCommand (name + ".config") testEnv'
''${apps.render-init.program} <<< "(${testConfig'}).config" > $out'';
sotest = buildPackages.runCommand "hw-${name}-sotest" testEnv' ''
cp "${testPkgs.bender}" bender
cp ${image} image.elf
mkdir -p $out/nix-support
${buildPackages.zip}/bin/zip "$out/binaries.zip" \
bender image.elf
${apps.dhall-to-yaml.program} < ${
./sotest_hw_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"
'';
sotest = if sotest then
buildPackages.runCommand "hw-${name}-sotest" testEnv' ''
cp "${testPkgs.bender}" bender
cp ${image} image.elf
mkdir -p $out/nix-support
${buildPackages.zip}/bin/zip "$out/binaries.zip" \
image.elf
${apps.dhall-to-yaml.program} < ${
./sotest_hw_config.dhall
} > "$out/sotest_config.yaml"
echo file sotest-binaries $out/binaries.zip >> "$out/nix-support/hydra-build-products"
echo file sotest-config $out/sotest_config.yaml >> "$out/nix-support/hydra-build-products"
''
else
null;
};

View File

@ -38,7 +38,7 @@ let
''run_genode_until {[init] child "harness" exited with exit value 0} 60'';
mkTest = { name ? "unamed", testScript ? defaultScript, testConfig
, testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], ... }@t:
, testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], sotest ? false, ... }@t:
let
manifest = lib.mergeManifests (map addManifest (with testPkgs;
[ base-nova (genodeSources.make "init") sotest-producer ]
@ -143,19 +143,22 @@ let
iso = apps.nova-iso.function testEnv' "${testConfig'}";
sotest = buildPackages.runCommand "nova-${name}-sotest" testEnv' ''
cp "${testPkgs.bender}" bender
cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
cp ${image} image.elf
mkdir -p $out/nix-support
${buildPackages.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"
'';
sotest = if sotest then
buildPackages.runCommand "nova-${name}-sotest" testEnv' ''
cp "${testPkgs.bender}" bender
cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
cp ${image} image.elf
mkdir -p $out/nix-support
${buildPackages.zip}/bin/zip "$out/binaries.zip" \
hypervisor image.elf
${apps.dhall-to-yaml.program} < ${
./sotest_nova_config.dhall
} > "$out/sotest_config.yaml"
echo file sotest-binaries $out/binaries.zip >> "$out/nix-support/hydra-build-products"
echo file sotest-config $out/sotest_config.yaml >> "$out/nix-support/hydra-build-products"
''
else
null;
};

View File

@ -29,6 +29,7 @@ let
tests = [
{
name = "multi";
sotest = true;
testConfig = "${./.}/solo5.dhall";
testInputs = map genodeMake [ "app/ping" ] ++ (map genodeDepot [
"ram_block"

View File

@ -1,4 +1,4 @@
{ boot_items =
[ { exec = "bender", load = [ "image.elf" ], name = "Genode base-hw" } ]
, boot_panic_patterns = [ "Error: init", "PAGE-FAULT IN CORE" ]
, extra_dependencies = [ { name = "bender", url = "https://sotest.io/bender" } ]
}

View File

@ -4,5 +4,5 @@
, name = "NOVA with Genode"
}
]
, boot_panic_patterns = [ "Error: init", "PAGE-FAULT IN CORE" ]
, extra_dependencies = [ { name = "bender", url = "https://sotest.io/bender" } ]
}