diff --git a/tests/default.nix b/tests/default.nix index e8c48d6..8961842 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -12,6 +12,7 @@ let ./hello.nix ./log.nix ./networking.nix + ./posix.nix ./solo5/multi.nix ./vmm_x86.nix ./x86.nix diff --git a/tests/posix.dhall b/tests/posix.dhall index 0b6a6dd..824b3d4 100644 --- a/tests/posix.dhall +++ b/tests/posix.dhall @@ -1,6 +1,4 @@ -let Test = ./test.dhall ? env:DHALL_GENODE_TEST - -let Genode = Test.Genode +let Genode = env:DHALL_GENODE let Prelude = Genode.Prelude @@ -31,19 +29,22 @@ in λ(params : { bash : Text, coreutils : Text, script : Text }) → - + '' ] , policies = [ Init.Config.Policy::{ , service = "File_system" - , label = - Init.LabelSelector.Type.Partial - { prefix = Some "shell", suffix = None Text } + , label = Init.LabelSelector.prefix "shell" , attributes = toMap { root = "/", writeable = "yes" } } + , Init.Config.Policy::{ + , service = "File_system" + , label = Init.LabelSelector.prefix "vfs_rom" + , attributes = toMap { root = "/" } + } ] } , provides = [ "File_system" ] @@ -58,7 +59,7 @@ in λ(params : { bash : Text, coreutils : Text, script : Text }) → Init.ServiceRoute.parent [ "File_system", "Rtc" ] } - , store_rom = + , vfs_rom = Child.flat Child.Attributes::{ , binary = "cached_fs_rom" @@ -67,12 +68,6 @@ in λ(params : { bash : Text, coreutils : Text, script : Text }) → , caps = 256 , ram = Genode.units.MiB 4 } - , routes = - [ Init.ServiceRoute.parentLabel - "File_system" - (None Text) - (Some "nix") - ] } , shell = Child.flat @@ -113,7 +108,7 @@ in λ(params : { bash : Text, coreutils : Text, script : Text }) → } , route = Init.Route.Type.Child - { name = "store_rom" + { name = "vfs_rom" , label = None Text , diag = None Bool } @@ -123,4 +118,4 @@ in λ(params : { bash : Text, coreutils : Text, script : Text }) → } } - in Test::{ children = Test.initToChildren init } + in Init.toChild init Init.Attributes::{=} diff --git a/tests/posix.nix b/tests/posix.nix index 5bc991e..f5b43a7 100644 --- a/tests/posix.nix +++ b/tests/posix.nix @@ -1,33 +1,30 @@ -{ pkgs, legacyPackages, ... }: -with pkgs; - -let - inherit (legacyPackages) bash coreutils; - script = with legacyPackages; - writeTextFile { - name = "posix.sh"; - text = '' - export PATH=${ - lib.makeSearchPathOutput "bin" "bin" - (with legacyPackages; [ bash hello coreutils ]) - } - set -v - time ls -lR /nix - sleep 1 - hello -v - sleep 1 - uname -a - ''; - }; -in rec { +{ name = "posix"; - machine = { - config = '' - ${ - ./posix.dhall - } { bash = \"${bash}\", coreutils = \"${coreutils}\", script = \"${script}\" }''; - inputs = map pkgs.genodeSources.depot [ "libc" "posix" "vfs_pipe" "vfs" ] - ++ [ bash ]; - extraPaths = [ script ] ++ (with legacyPackages; [ coreutils hello ]); + machine = { pkgs, ... }: { + genode.init.children.posix = with pkgs; + let + script = writeTextFile { + name = "posix.sh"; + text = '' + export PATH=${ + lib.makeSearchPathOutput "bin" "bin" [ bash hello coreutils ] + } + set -v + time ls -lR /nix + sleep 1 + hello -v + sleep 1 + uname -a + ''; + }; + in { + configFile = writeText "posix.child.dhall" '' + ${ + ./posix.dhall + } { bash = "${bash}", coreutils = "${coreutils}", script = "${script}" } + ''; + inputs = [ bash hello coreutils ] + ++ (with genodePackages; [ cached_fs_rom libc posix vfs vfs_pipe ]); + }; }; }