tests: consolidate sotest to a single project
Make one SoTest run per hydra evaluation.
This commit is contained in:
parent
1f5dfe4ef5
commit
d8ba46e742
|
@ -120,6 +120,7 @@
|
||||||
checks = let
|
checks = let
|
||||||
checks' = forAllCrossSystems ({ system, localSystem, crossSystem }:
|
checks' = forAllCrossSystems ({ system, localSystem, crossSystem }:
|
||||||
import ./tests {
|
import ./tests {
|
||||||
|
inherit self;
|
||||||
apps = self.apps.${system};
|
apps = self.apps.${system};
|
||||||
buildPackages = nixpkgsFor.${localSystem};
|
buildPackages = nixpkgsFor.${localSystem};
|
||||||
depot = genode-depot.packages.${system};
|
depot = genode-depot.packages.${system};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
let tests = call: { log = call ./log.nix { }; };
|
let tests = call: { log = call ./log.nix { }; };
|
||||||
|
|
||||||
in { apps, buildPackages, depot, genodepkgs, lib, nixpkgs }:
|
in { self, apps, buildPackages, depot, genodepkgs, lib, nixpkgs }:
|
||||||
|
|
||||||
let
|
let
|
||||||
testPkgs = genodepkgs;
|
testPkgs = genodepkgs;
|
||||||
|
@ -47,17 +47,43 @@ let
|
||||||
value = test;
|
value = test;
|
||||||
}) (builtins.attrValues tests);
|
}) (builtins.attrValues tests);
|
||||||
|
|
||||||
hw-sotest = map ({ name, value }: {
|
|
||||||
name = name + "-sotest";
|
|
||||||
value = value.sotest;
|
|
||||||
}) (builtins.filter ({ name, value }: !isNull value.sotest) (testsToList hw));
|
|
||||||
|
|
||||||
nova-sotest = map ({ name, value }: {
|
|
||||||
name = name + "-sotest";
|
|
||||||
value = value.sotest;
|
|
||||||
}) (builtins.filter ({ name, value }: !isNull value.sotest)
|
|
||||||
(testsToList nova));
|
|
||||||
|
|
||||||
in with builtins;
|
in with builtins;
|
||||||
listToAttrs ((concatLists (map (testsToList) [ linux hw nova ])) ++ hw-sotest
|
listToAttrs ((concatLists (map (testsToList) [ linux hw nova ]))) // {
|
||||||
++ nova-sotest)
|
sotest = let
|
||||||
|
hwTests = [ hw.multi hw.x86 ];
|
||||||
|
novaTests = [ nova.multi nova.x86 nova.vmm ];
|
||||||
|
allTests = hwTests ++ novaTests;
|
||||||
|
|
||||||
|
projectCfg.boot_items =
|
||||||
|
|
||||||
|
(map (test: {
|
||||||
|
inherit (test) name;
|
||||||
|
exec = "bender";
|
||||||
|
load = [ test.image.name ];
|
||||||
|
}) hwTests)
|
||||||
|
|
||||||
|
++ (map (test: {
|
||||||
|
inherit (test) name;
|
||||||
|
exec = "bender";
|
||||||
|
load = [ "hypervisor serial novga iommu" test.image.name ];
|
||||||
|
}) novaTests);
|
||||||
|
|
||||||
|
in buildPackages.stdenv.mkDerivation {
|
||||||
|
pname = "sotest";
|
||||||
|
version = toString self.revCount;
|
||||||
|
buildCommand = ''
|
||||||
|
mkdir zip; cd zip
|
||||||
|
cp "${testPkgs.bender}" bender
|
||||||
|
cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
|
||||||
|
${concatStringsSep "\n"
|
||||||
|
(map (test: "cp ${test.image} ${test.image.name}") allTests)}
|
||||||
|
mkdir -p $out/nix-support
|
||||||
|
${buildPackages.zip}/bin/zip "$out/binaries.zip" *
|
||||||
|
cat << EOF > "$out/project.json"
|
||||||
|
${builtins.toJSON projectCfg}
|
||||||
|
EOF
|
||||||
|
echo file sotest-binaries $out/binaries.zip >> "$out/nix-support/hydra-build-products"
|
||||||
|
echo file sotest-config $out/project.json >> "$out/nix-support/hydra-build-products"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ let
|
||||||
''run_genode_until {child "init" exited with exit value 0} 120'';
|
''run_genode_until {child "init" exited with exit value 0} 120'';
|
||||||
|
|
||||||
mkTest = { name ? "unamed", testScript ? defaultScript, testConfig
|
mkTest = { name ? "unamed", testScript ? defaultScript, testConfig
|
||||||
, testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], sotest ? false, ... }@t:
|
, testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], ... }@t:
|
||||||
let
|
let
|
||||||
manifest = lib.mergeManifests (map addManifest (with testPkgs;
|
manifest = lib.mergeManifests (map addManifest (with testPkgs;
|
||||||
[ base-hw-pc sotest-producer ]
|
[ base-hw-pc sotest-producer ]
|
||||||
|
@ -49,7 +49,7 @@ let
|
||||||
DHALL_GENODE_TEST = "${./test.dhall}";
|
DHALL_GENODE_TEST = "${./test.dhall}";
|
||||||
} // testEnv;
|
} // testEnv;
|
||||||
|
|
||||||
image = lib.hwImage name testEnv' testConfig';
|
image = lib.hwImage ("hw-" + name) testEnv' testConfig';
|
||||||
|
|
||||||
baseSetup = ''
|
baseSetup = ''
|
||||||
##
|
##
|
||||||
|
@ -142,22 +142,6 @@ let
|
||||||
xml = buildPackages.runCommand (name + ".config") testEnv'
|
xml = buildPackages.runCommand (name + ".config") testEnv'
|
||||||
''${apps.render-init.program} <<< "(${testConfig'}).config" > $out'';
|
''${apps.render-init.program} <<< "(${testConfig'}).config" > $out'';
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -38,19 +38,18 @@ let
|
||||||
''run_genode_until {child "init" exited with exit value 0} 120'';
|
''run_genode_until {child "init" exited with exit value 0} 120'';
|
||||||
|
|
||||||
mkTest = { name ? "unamed", testScript ? defaultScript, testConfig
|
mkTest = { name ? "unamed", testScript ? defaultScript, testConfig
|
||||||
, testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], sotest ? false, ... }@t:
|
, testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], ... }@t:
|
||||||
let
|
let
|
||||||
manifest = lib.mergeManifests (map addManifest (with testPkgs;
|
manifest = lib.mergeManifests (map addManifest (with testPkgs;
|
||||||
[ base-nova sotest-producer ]
|
[ base-nova sotest-producer ]
|
||||||
++ map genodeSources.depot [ "init" "rtc_drv" ]
|
++ map genodeSources.depot [ "init" "rtc_drv" ] ++ testInputs));
|
||||||
++ testInputs));
|
|
||||||
testConfig' = "${./test-wrapper.dhall} ${testConfig} (toMap ${manifest})";
|
testConfig' = "${./test-wrapper.dhall} ${testConfig} (toMap ${manifest})";
|
||||||
testEnv' = {
|
testEnv' = {
|
||||||
DHALL_GENODE = "${testPkgs.dhallGenode}/source.dhall";
|
DHALL_GENODE = "${testPkgs.dhallGenode}/source.dhall";
|
||||||
DHALL_GENODE_TEST = "${./test.dhall}";
|
DHALL_GENODE_TEST = "${./test.dhall}";
|
||||||
} // testEnv;
|
} // testEnv;
|
||||||
|
|
||||||
image = lib.novaImage name testEnv' testConfig';
|
image = lib.novaImage ("nova-" + name) testEnv' testConfig';
|
||||||
build = lib.compileBoot name testEnv' testConfig';
|
build = lib.compileBoot name testEnv' testConfig';
|
||||||
|
|
||||||
baseSetup = ''
|
baseSetup = ''
|
||||||
|
@ -144,24 +143,6 @@ let
|
||||||
compile = lib.compileBoot name testConfig';
|
compile = lib.compileBoot name testConfig';
|
||||||
|
|
||||||
iso = apps.nova-iso.function testEnv' "${testConfig'}";
|
iso = apps.nova-iso.function testEnv' "${testConfig'}";
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -29,7 +29,6 @@ let
|
||||||
tests = [
|
tests = [
|
||||||
{
|
{
|
||||||
name = "multi";
|
name = "multi";
|
||||||
sotest = true;
|
|
||||||
testConfig = "${./.}/solo5.dhall";
|
testConfig = "${./.}/solo5.dhall";
|
||||||
testInputs = map genodeMake [ "app/ping" ] ++ (map genodeDepot [
|
testInputs = map genodeMake [ "app/ping" ] ++ (map genodeDepot [
|
||||||
"ram_block"
|
"ram_block"
|
||||||
|
|
Loading…
Reference in New Issue