2
0
Fork 0

Use "record override" syntatic-sugar in Dhall test configs

20.02
Emery Hemingway 3 years ago
parent 1df76e3bca
commit 9410b836c2
  1. 4
      dhall/genode.nix
  2. 16
      tests/default.nix
  3. 36
      tests/libc.dhall
  4. 6
      tests/log.dhall
  5. 3
      tests/nova-iso.nix
  6. 95
      tests/pci.dhall
  7. 10
      tests/signal.dhall
  8. 36
      tests/solo5/blk.dhall
  9. 91
      tests/solo5/net.dhall
  10. 104
      tests/solo5/net_2if.dhall
  11. 24
      tests/solo5/simple.dhall
  12. 28
      tests/solo5/time.dhall

@ -6,6 +6,6 @@
fetchgit {
url = "https://git.sr.ht/~ehmry/dhall-genode";
rev = "031fb4ef77dc8a2dbe71fd806129b4eacfe0606a";
sha256 = "1hvy21w406fy01b9fag3pmz22zlnfdkz17fmrv2h8xxj5lci9z5n";
rev = "4e05e7bf88e53c81a8f00460673fd48e858c6dfc";
sha256 = "0y92jinqr26wlrychk8mi58kqwmy4y25c2ffks3r3m78i8andi8y";
}

@ -22,6 +22,18 @@ let
lib = hostPkgs.lib // {
dhallText = name: source:
hostPkgs.runCommand name {
inherit name source;
preferLocalBuild = true;
buildInputs = [ hostPkgs.dhall ];
DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall";
DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall";
} ''
export XDG_CACHE_HOME=$NIX_BUILD_TOP
dhall text < $source > $out
'';
renderDhallInit = path: args:
hostPkgs.runCommand "init.xml" {
preferLocalBuild = true;
@ -32,8 +44,8 @@ let
DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall";
} ''
export XDG_CACHE_HOME=$NIX_BUILD_TOP
echo 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (Prelude.Init.defaults { children = toMap (env:initConfig env:initArgs) })' \
| dhall text \
dhall text \
<<< 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (Prelude.Init::{ children = toMap (env:initConfig env:initArgs) })' \
> $out
'';
};

@ -2,23 +2,23 @@ let Genode = env:DHALL_GENODE
in λ(_ : {})
→ { test-libc =
Genode.Init.Start.defaults
⫽ { binary = "test-libc"
, resources = { caps = 200, ram = Genode.units.MiB 400 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
, config =
Genode.Prelude.XML.text
''
<config>
<vfs>
<dir name="dev">
<log/>
<inline name="rtc">2019-08-20 15:01</inline>
</dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
</config>
''
}
Genode.Init.Start::{
, binary = "test-libc"
, resources = { caps = 200, ram = Genode.units.MiB 400 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
, config =
Genode.Prelude.XML.text
''
<config>
<vfs>
<dir name="dev">
<log/>
<inline name="rtc">2019-08-20 15:01</inline>
</dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
</config>
''
}
: Genode.Init.Start.Type
}

@ -1,7 +1,3 @@
let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall
in λ(_ : {})
→ { test-log =
Genode.Init.Start.defaults ⫽ { binary = "test-log" }
: Genode.Init.Start.Type
}
in λ(_ : {}) → { test-log = Genode.Init.Start::{ binary = "test-log" } }

@ -66,11 +66,12 @@ in hostPkgs.stdenv.mkDerivation {
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
inherit modulesAsm;
installPhase = ''
mkdir -p boot/syslinux
# compile the boot modules into one object file
echo '${modulesAsm}' | $CC -c -x assembler -o boot_modules.o -
$CC -c -x assembler -o boot_modules.o - <<< $modulesAsm
# link final image
$LD -nostdlib \

@ -4,55 +4,54 @@ in λ ( _
: {}
)
→ { test-pci =
Genode.Init.Start.defaults
⫽ { binary = "test-pci"
, resources = { caps = 96, ram = Genode.units.MiB 2 }
, routes = [ Genode.ServiceRoute.child "Platform" "platform_drv" ]
}
Genode.Init.Start::{
, binary = "test-pci"
, resources = { caps = 96, ram = Genode.units.MiB 2 }
, routes = [ Genode.ServiceRoute.child "Platform" "platform_drv" ]
}
, acpi_report_rom =
Genode.Init.Start.defaults
⫽ { binary =
"report_rom"
, resources = { caps = 96, ram = Genode.units.MiB 2 }
, provides = [ "ROM", "Report" ]
, config =
Genode.Prelude.XML.text
''
<config system="yes">
<policy label="smbios_decoder -> smbios_table" report="acpi_drv -> smbios_table"/>
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
</config>
''
}
Genode.Init.Start::{
, binary = "report_rom"
, resources = { caps = 96, ram = Genode.units.MiB 2 }
, provides = [ "ROM", "Report" ]
, config =
Genode.Prelude.XML.text
''
<config system="yes">
<policy label="smbios_decoder -> smbios_table" report="acpi_drv -> smbios_table"/>
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
</config>
''
}
, acpi_drv =
Genode.Init.Start.defaults
⫽ { binary = "acpi_drv"
, resources = { caps = 400, ram = Genode.units.MiB 4 }
, constrainPhys = True
, provides = [ "Platform", "Acpi" ]
, routes =
[ Genode.ServiceRoute.child "Report" "acpi_report_rom"
, Genode.ServiceRoute.parent "IRQ"
, Genode.ServiceRoute.parent "IO_MEM"
, Genode.ServiceRoute.parent "IO_PORT"
]
}
Genode.Init.Start::{
, binary = "acpi_drv"
, resources = { caps = 400, ram = Genode.units.MiB 4 }
, constrainPhys = True
, provides = [ "Platform", "Acpi" ]
, routes =
[ Genode.ServiceRoute.child "Report" "acpi_report_rom"
, Genode.ServiceRoute.parent "IRQ"
, Genode.ServiceRoute.parent "IO_MEM"
, Genode.ServiceRoute.parent "IO_PORT"
]
}
, platform_drv =
Genode.Init.Start.defaults
⫽ { binary = "platform_drv"
, resources = { caps = 800, ram = Genode.units.MiB 4 }
, constrainPhys = True
, provides = [ "Platform", "Acpi" ]
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.parent "IRQ"
, Genode.ServiceRoute.parent "IO_MEM"
, Genode.ServiceRoute.parent "IO_PORT"
, Genode.ServiceRoute.childLabel
"ROM"
"acpi_report_rom"
(Some "acpi")
(None Text)
]
}
Genode.Init.Start::{
, binary = "platform_drv"
, resources = { caps = 800, ram = Genode.units.MiB 4 }
, constrainPhys = True
, provides = [ "Platform", "Acpi" ]
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.parent "IRQ"
, Genode.ServiceRoute.parent "IO_MEM"
, Genode.ServiceRoute.parent "IO_PORT"
, Genode.ServiceRoute.childLabel
"ROM"
"acpi_report_rom"
(Some "acpi")
(None Text)
]
}
}

@ -2,10 +2,10 @@ let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall
in λ(_ : {})
→ { test-signal =
Genode.Init.Start.defaults
⫽ { binary = "test-signal"
, resources = { caps = 500, ram = Genode.units.MiB 10 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
}
Genode.Init.Start::{
, binary = "test-signal"
, resources = { caps = 500, ram = Genode.units.MiB 10 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
}
: Genode.Init.Start.Type
}

@ -2,23 +2,23 @@ let Genode = env:DHALL_GENODE
in λ(_ : {})
→ { solo5 =
Genode.Init.Start.defaults
⫽ { binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Block" "block"
]
}
Genode.Init.Start::{
, binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Block" "block"
]
}
, block =
Genode.Init.Start.defaults
⫽ { binary = "ram_block"
, provides = [ "Block" ]
, resources = { caps = 96, ram = Genode.units.MiB 9 }
, config =
Genode.Prelude.XML.text
''
<config size="8M" block_size="4096"/>
''
}
Genode.Init.Start::{
, binary = "ram_block"
, provides = [ "Block" ]
, resources = { caps = 96, ram = Genode.units.MiB 9 }
, config =
Genode.Prelude.XML.text
''
<config size="8M" block_size="4096"/>
''
}
}

@ -2,53 +2,52 @@ let Genode = env:DHALL_GENODE
in λ(_ : {})
→ { nic =
Genode.Init.Start.defaults
⫽ { binary = "nic_loopback", provides = [ "Nic" ] }
Genode.Init.Start::{ binary = "nic_loopback", provides = [ "Nic" ] }
, bridge =
Genode.Init.Start.defaults
⫽ { binary = "nic_bridge"
, resources = { caps = 200, ram = Genode.units.MiB 6 }
, provides = [ "Nic" ]
, routes = [ Genode.ServiceRoute.child "Nic" "nic" ]
, config =
Genode.Prelude.XML.text
''
<config mac="02:02:02:02:03:00" verbose="no">
<policy label_prefix="solo5" ip_addr="10.0.0.2"/>
<default-policy/>
</config>
''
}
Genode.Init.Start::{
, binary = "nic_bridge"
, resources = { caps = 200, ram = Genode.units.MiB 6 }
, provides = [ "Nic" ]
, routes = [ Genode.ServiceRoute.child "Nic" "nic" ]
, config =
Genode.Prelude.XML.text
''
<config mac="02:02:02:02:03:00" verbose="no">
<policy label_prefix="solo5" ip_addr="10.0.0.2"/>
<default-policy/>
</config>
''
}
, solo5 =
Genode.Init.Start.defaults
⫽ { binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Nic" "bridge"
]
, config =
Genode.Prelude.XML.text
''
<config><cmdline>limit</cmdline></config>
''
}
Genode.Init.Start::{
, binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Nic" "bridge"
]
, config =
Genode.Prelude.XML.text
''
<config><cmdline>limit</cmdline></config>
''
}
, ping =
Genode.Init.Start.defaults
⫽ { binary = "ping"
, resources = { caps = 128, ram = Genode.units.MiB 6 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Nic" "bridge"
]
, config =
Genode.Prelude.XML.text
''
<config interface="10.0.0.72/24"
dst_ip="10.0.0.2"
period_sec="1"
verbose="no"
count="8"/>
''
}
Genode.Init.Start::{
, binary = "ping"
, resources = { caps = 128, ram = Genode.units.MiB 6 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Nic" "bridge"
]
, config =
Genode.Prelude.XML.text
''
<config interface="10.0.0.72/24"
dst_ip="10.0.0.2"
period_sec="1"
verbose="no"
count="8"/>
''
}
}

@ -4,60 +4,58 @@ in λ ( _
: {}
)
→ { nic =
Genode.Init.Start.defaults
⫽ { binary = "nic_loopback", provides = [ "Nic" ] }
Genode.Init.Start::{ binary = "nic_loopback", provides = [ "Nic" ] }
, bridge =
Genode.Init.Start.defaults
⫽ { binary = "nic_bridge"
, resources = { caps = 200, ram = Genode.units.MiB 8 }
, provides = [ "Nic" ]
, routes = [ Genode.ServiceRoute.child "Nic" "nic" ]
, config =
Genode.Prelude.XML.text
''
<config mac="02:02:02:02:03:00" verbose="no">
<policy label="solo5 -> service0" ip_addr="10.0.0.2"/>
<policy label="solo5 -> service1" ip_addr="10.1.0.2"/>
<default-policy/>
</config>
''
}
Genode.Init.Start::{
, binary = "nic_bridge"
, resources = { caps = 200, ram = Genode.units.MiB 8 }
, provides = [ "Nic" ]
, routes = [ Genode.ServiceRoute.child "Nic" "nic" ]
, config =
Genode.Prelude.XML.text
''
<config mac="02:02:02:02:03:00" verbose="no">
<policy label="solo5 -> service0" ip_addr="10.0.0.2"/>
<policy label="solo5 -> service1" ip_addr="10.1.0.2"/>
<default-policy/>
</config>
''
}
, solo5 =
Genode.Init.Start.defaults
⫽ { binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 4 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Nic" "bridge"
]
, config =
Genode.Prelude.XML.text
''
<config><cmdline>limit</cmdline></config>
''
}
Genode.Init.Start::{
, binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 4 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Nic" "bridge"
]
, config =
Genode.Prelude.XML.text
''
<config><cmdline>limit</cmdline></config>
''
}
, clients =
Genode.Init.Start.defaults
⫽ { binary =
"sequence"
, resources = { caps = 256, ram = Genode.units.MiB 8 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Nic" "bridge"
]
, config =
Genode.Prelude.XML.text
''
<config>
<start name="ping0">
<binary name="ping"/>
<config interface="10.0.0.72/24" dst_ip="10.0.0.2" period_sec="1" count="4"/>
</start>
<start name="ping1">
<binary name="ping"/>
<config interface="10.1.0.72/24" dst_ip="10.1.0.2" period_sec="1" count="4"/>
</start>
</config>
''
}
Genode.Init.Start::{
, binary = "sequence"
, resources = { caps = 256, ram = Genode.units.MiB 8 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Nic" "bridge"
]
, config =
Genode.Prelude.XML.text
''
<config>
<start name="ping0">
<binary name="ping"/>
<config interface="10.0.0.72/24" dst_ip="10.0.0.2" period_sec="1" count="4"/>
</start>
<start name="ping1">
<binary name="ping"/>
<config interface="10.1.0.72/24" dst_ip="10.1.0.2" period_sec="1" count="4"/>
</start>
</config>
''
}
}

@ -2,16 +2,16 @@ let Genode = env:DHALL_GENODE
in λ(_ : {})
→ { solo5 =
Genode.Init.Start.defaults
⫽ { binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
, config =
Genode.Prelude.XML.text
''
<config>
<cmdline>Hello_Solo5</cmdline>
</config>
''
}
Genode.Init.Start::{
, binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
, config =
Genode.Prelude.XML.text
''
<config>
<cmdline>Hello_Solo5</cmdline>
</config>
''
}
}

@ -2,20 +2,18 @@ let Genode = env:DHALL_GENODE
in λ(_ : {})
→ { solo5 =
Genode.Init.Start.defaults
⫽ { binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Rtc" "clock"
]
}
Genode.Init.Start::{
, binary = "test"
, resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Rtc" "clock"
]
}
, clock =
Genode.Init.Start.defaults
⫽ { binary = "rtc_drv"
, provides = [ "Rtc" ]
, routes =
[ Genode.ServiceRoute.parent "IO_PORT"
]
}
Genode.Init.Start::{
, binary = "rtc_drv"
, provides = [ "Rtc" ]
, routes = [ Genode.ServiceRoute.parent "IO_PORT" ]
}
}

Loading…
Cancel
Save