2
0
Fork 0

tests: rename hostPkgs to buildPkgs

This is consistent with Nixpkgs terminology.
tftp
Emery Hemingway 3 years ago
parent cee2caa2c7
commit 049b0d3053
  1. 4
      tests/block_router.nix
  2. 10
      tests/default.nix
  3. 20
      tests/driver-hw.nix
  4. 16
      tests/driver-linux.nix
  5. 20
      tests/driver-nova.nix
  6. 4
      tests/driver_manager.nix

@ -1,6 +1,6 @@
# SPDX-License-Identifier: CC0-1.0
{ testEnv, pkgs, hostPkgs, ... }:
{ testEnv, pkgs, buildPkgs, ... }:
with pkgs;
testEnv.mkTest {
@ -15,7 +15,7 @@ testEnv.mkTest {
] ++ [ pkgs.block_router ];
testScript = ''
catch { exec dd if=/dev/zero of=gpt.raw bs=512 count=7168 }
exec ${hostPkgs.gptfdisk}/bin/sgdisk -o -n 3:2048:4095 -c 3:first-test-partition -n 31:4096:6143 -c 31:second-test-partition gpt.raw
exec ${buildPkgs.gptfdisk}/bin/sgdisk -o -n 3:2048:4095 -c 3:first-test-partition -n 31:4096:6143 -c 31:second-test-partition gpt.raw
run_genode_until {Tests finished successfully.*\n.*Tests finished successfully.*\n} 120
'';

@ -11,13 +11,13 @@ in { self, apps, system, localSystem, crossSystem, genodepkgs, nixpkgs
, genode-depot, lib }:
let
hostPkgs = import nixpkgs { system = localSystem; };
buildPkgs = import nixpkgs { system = localSystem; };
depot = genode-depot.packages.${system};
testPkgs = genodepkgs;
addManifest = drv:
drv // {
manifest = hostPkgs.runCommand "${drv.name}.dhall" { inherit drv; } ''
manifest = buildPkgs.runCommand "${drv.name}.dhall" { inherit drv; } ''
set -eu
echo -n '[' >> $out
find $drv/ -type f -printf ',{mapKey= "%f",mapValue="%p"}' >> $out
@ -28,7 +28,7 @@ let
linux =
(call: ((tests call) // { block_router = call ./block_router.nix { }; }))
(import ./driver-linux.nix {
inherit apps testPkgs hostPkgs lib depot addManifest;
inherit apps testPkgs buildPkgs lib depot addManifest;
}).callTest;
nova = (call:
@ -38,7 +38,7 @@ let
pci = call ./pci.nix { };
rtc = call ./rtc.nix { };
})) (import ./driver-nova.nix {
inherit apps system testPkgs hostPkgs lib depot addManifest;
inherit apps system testPkgs buildPkgs lib depot addManifest;
}).callTest;
hw = (call:
@ -47,7 +47,7 @@ let
pci = call ./pci.nix { };
rtc = call ./rtc.nix { };
})) (import ./driver-hw.nix {
inherit apps system testPkgs hostPkgs lib depot addManifest;
inherit apps system testPkgs buildPkgs lib depot addManifest;
}).callTest;
testsToList = tests:

@ -1,9 +1,9 @@
# SPDX-License-Identifier: CC0-1.0
{ system, apps, testPkgs, hostPkgs, lib, depot, addManifest }:
{ system, apps, testPkgs, buildPkgs, lib, depot, addManifest }:
let
testDriver = with hostPkgs;
testDriver = with buildPkgs;
stdenv.mkDerivation {
name = "hw-genode-test-driver";
preferLocalBuild = true;
@ -20,7 +20,7 @@ let
};
runTests = driver:
hostPkgs.stdenv.mkDerivation {
buildPkgs.stdenv.mkDerivation {
name = "hw-" + driver.testName;
preferLocalBuild = true;
@ -91,7 +91,7 @@ let
global env
global spawn_id
set TEST_MIB [expr (([file size ${image}] + $env(TEST_RAM)) >> 20) + 24]
spawn ${hostPkgs.qemu_test}/bin/qemu-system-x86_64 \
spawn ${buildPkgs.qemu_test}/bin/qemu-system-x86_64 \
-machine q35 -serial mon:stdio -nographic \
-m size=$TEST_MIB \
-kernel "${testPkgs.bender}" \
@ -105,7 +105,7 @@ let
set out $env(out)
'';
driver = with hostPkgs;
driver = with buildPkgs;
buildPackages.runCommand "genode-test-driver-${name}" ({
buildInputs = [ makeWrapper expect ];
inherit baseSetup testScript;
@ -133,20 +133,20 @@ let
in test // {
inherit driver image test manifest;
config = hostPkgs.runCommand (name + ".dhall") testEnv' ''
config = buildPkgs.runCommand (name + ".dhall") testEnv' ''
${apps.dhall.program} <<< "${testConfig'}" > $out
'';
iso = apps.hw-iso.function testEnv' testConfig';
xml = hostPkgs.runCommand (name + ".config") testEnv'
xml = buildPkgs.runCommand (name + ".config") testEnv'
''${apps.render-init.program} <<< "(${testConfig'}).config" > $out'';
sotest = hostPkgs.runCommand "hw-${name}-sotest" testEnv' ''
sotest = buildPkgs.runCommand "hw-${name}-sotest" testEnv' ''
cp "${testPkgs.bender}" bender
cp ${image} image.elf
mkdir -p $out/nix-support
${hostPkgs.zip}/bin/zip "$out/binaries.zip" \
${buildPkgs.zip}/bin/zip "$out/binaries.zip" \
bender image.elf
${apps.dhall-to-yaml.program} < ${
./sotest_hw_config.dhall
@ -166,6 +166,6 @@ in {
isNova = true;
};
pkgs = testPkgs;
inherit depot hostPkgs;
inherit depot buildPkgs;
} // args));
}

@ -1,9 +1,9 @@
# SPDX-License-Identifier: CC0-1.0
{ apps, testPkgs, hostPkgs, lib, depot, addManifest }:
{ apps, testPkgs, buildPkgs, lib, depot, addManifest }:
let
testDriver = with hostPkgs;
testDriver = with buildPkgs;
stdenv.mkDerivation {
name = "genode-test-driver";
preferLocalBuild = true;
@ -20,7 +20,7 @@ let
};
runTests = driver:
hostPkgs.stdenv.mkDerivation {
buildPkgs.stdenv.mkDerivation {
name = "linux-" + driver.testName;
preferLocalBuild = true;
@ -78,7 +78,7 @@ let
}
'';
driver = with hostPkgs;
driver = with buildPkgs;
runCommand "genode-test-driver-${name}" {
buildInputs = [ makeWrapper expect ];
inherit baseSetup testScript;
@ -98,13 +98,13 @@ let
in test // {
inherit driver test;
config = hostPkgs.runCommand (name + ".dhall") env' ''
config = buildPkgs.runCommand (name + ".dhall") env' ''
${apps.dhall.program} <<< "(${testConfig'}).config" > $out
'';
xml = hostPkgs.runCommand (name + ".config") env' ''
xml = buildPkgs.runCommand (name + ".config") env' ''
${apps.render-init.program} <<< "(${testConfig'}).config" > $out
'';
image = hostPkgs.runCommand (name + ".image.elf") env' ''
image = buildPkgs.runCommand (name + ".image.elf") env' ''
mkdir -p $out
pushd $out
${apps.linux-image.program} "${testConfig'}"
@ -120,6 +120,6 @@ in {
isNova = false;
};
pkgs = testPkgs;
inherit depot hostPkgs;
inherit depot buildPkgs;
} // args));
}

@ -1,9 +1,9 @@
# SPDX-License-Identifier: CC0-1.0
{ system, apps, testPkgs, hostPkgs, lib, depot, addManifest }:
{ system, apps, testPkgs, buildPkgs, lib, depot, addManifest }:
let
testDriver = with hostPkgs;
testDriver = with buildPkgs;
stdenv.mkDerivation {
name = "nova-genode-test-driver";
preferLocalBuild = true;
@ -20,7 +20,7 @@ let
};
runTests = driver:
hostPkgs.stdenv.mkDerivation {
buildPkgs.stdenv.mkDerivation {
name = "nova-" + driver.testName;
preferLocalBuild = true;
@ -91,7 +91,7 @@ let
global env
global spawn_id
set TEST_MIB [expr (([file size ${image}] + $env(TEST_RAM)) >> 20) + 24]
spawn ${hostPkgs.qemu_test}/bin/qemu-system-x86_64 \
spawn ${buildPkgs.qemu_test}/bin/qemu-system-x86_64 \
-machine q35 -serial mon:stdio -nographic \
-m size=$TEST_MIB \
-kernel "${testPkgs.bender}" \
@ -105,7 +105,7 @@ let
set out $env(out)
'';
driver = with hostPkgs;
driver = with buildPkgs;
buildPackages.runCommand "genode-test-driver-${name}" ({
buildInputs = [ makeWrapper expect ];
inherit baseSetup testScript;
@ -133,22 +133,22 @@ let
in test // {
inherit driver image test manifest;
config = hostPkgs.runCommand (name + ".dhall") testEnv' ''
config = buildPkgs.runCommand (name + ".dhall") testEnv' ''
export XDG_CACHE_HOME=''${TMPDIR:-/tmp}
${apps.dhall.program} <<< "${testConfig'}" > $out
'';
iso = apps.nova-iso.function testEnv' "${testConfig'}";
xml = hostPkgs.runCommand (name + ".config") testEnv'
xml = buildPkgs.runCommand (name + ".config") testEnv'
''${apps.render-init.program} <<< "(${testConfig'}).config" > $out'';
sotest = hostPkgs.runCommand "nova-${name}-sotest" testEnv' ''
sotest = buildPkgs.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
${hostPkgs.zip}/bin/zip "$out/binaries.zip" \
${buildPkgs.zip}/bin/zip "$out/binaries.zip" \
bender hypervisor image.elf
${apps.dhall-to-yaml.program} < ${
./sotest_config.dhall
@ -168,6 +168,6 @@ in {
isNova = true;
};
pkgs = testPkgs;
inherit depot hostPkgs;
inherit depot buildPkgs;
} // args));
}

@ -1,6 +1,6 @@
# SPDX-License-Identifier: CC0-1.0
{ testEnv, pkgs, depot, hostPkgs, ... }:
{ testEnv, pkgs, depot, buildPkgs, ... }:
with pkgs;
testEnv.mkTest {
@ -27,7 +27,7 @@ testEnv.mkTest {
testScript = ''
catch { exec dd if=/dev/zero of=hdd_disk.raw bs=1M count=32 }
catch { exec ${hostPkgs.e2fsprogs}/bin/mke2fs -F bin/hdd_disk.raw }
catch { exec ${buildPkgs.e2fsprogs}/bin/mke2fs -F bin/hdd_disk.raw }
run_genode_until {.*all expected devices present and accessible.*} 120
'';
testConfig = ./driver_manager.dhall;

Loading…
Cancel
Save