2
0
Fork 0
genodepkgs/tests/tftp_rom.dhall

154 lines
4.8 KiB
Plaintext

-- SPDX-License-Identifier: CC0-1.0
let Test = ./test.dhall ? env:DHALL_GENODE_TEST
let Genode = Test.Genode
let Prelude = Genode.Prelude
let XML = Prelude.XML
let Init = Genode.Init
let Child = Init.Child
let Resources = Init.Resources
let ServiceRoute = Init.ServiceRoute
let label = λ(_ : Text) → { local = _, route = _ } : Child.Attributes.Label
let benchmarkAttrs =
Child.Attributes::{
, binary = "rom_benchmark"
, config =
{ attributes = toMap { interations = "8" }
, content =
Prelude.List.map
Text
XML.Type
( λ(label : Text)
→ XML.element
{ name = "rom"
, attributes = XML.emptyAttributes
, content = [ XML.text label ]
}
)
[ "rom_benchmark" ]
}
}
let test =
Genode.Init::{
, children = toMap
{ acpi_drv =
Child.flat
Child.Attributes::{
, binary = "acpi_drv"
, resources = Resources::{
, caps = 400
, ram = Genode.units.MiB 4
, constrainPhys = True
}
, provides = [ "Platform", "Acpi" ]
, romReports = [ label "acpi", label "smbios_table" ]
, routes =
[ ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IO_MEM"
, ServiceRoute.parent "IO_PORT"
]
}
, nic_drv =
Child.flat
Child.Attributes::{
, binary = "ipxe_nic_drv"
, exitPropagate = True
, provides = [ "Nic" ]
, resources = Resources::{
, caps = 128
, ram = Genode.units.MiB 4
}
, routes =
[ ServiceRoute.parent "Timer"
, ServiceRoute.parent "IO_MEM"
, ServiceRoute.parent "IO_PORT"
, ServiceRoute.childLabel
"Platform"
"platform_drv"
(None Text)
(Some "ipxe_nic_drv")
]
}
, platform_drv =
Child.flat
Child.Attributes::{
, binary = "platform_drv"
, resources = Resources::{
, caps = 800
, ram = Genode.units.MiB 4
, constrainPhys = True
}
, reportRoms = [ label "acpi" ]
, provides = [ "Platform", "Acpi" ]
, routes =
[ ServiceRoute.parent "Timer"
, ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IO_MEM"
, ServiceRoute.parent "IO_PORT"
]
, config = Init.Config::{
, content =
[ XML.text
''
<policy label_suffix="ipxe_nic_drv"> <pci class="ETHERNET"/> </policy>
''
]
}
}
, tftp_rom =
Child.flat
Child.Attributes::{
, binary = "tftp_rom"
, config = Init.Config::{
, attributes = toMap { verbose = "yes", dhcp = "yes" }
, content =
[ XML.text
''
<default-policy ip="10.0.2.2"/>
''
]
}
, exitPropagate = True
, provides = [ "ROM" ]
, resources = Resources::{ ram = Genode.units.MiB 32 }
, routes =
[ ServiceRoute.child "Nic" "nic_drv"
, ServiceRoute.parent "Timer"
]
}
, benchmark =
Child.flat
( benchmarkAttrs
⫽ { exitPropagate = True
, routes =
[ { service =
{ name = "ROM"
, label = Init.LabelSelector.Type.Last "ld.lib.so"
}
, route = Init.Route.parent
}
, ServiceRoute.child "ROM" "tftp_rom"
, ServiceRoute.parent "Timer"
]
}
)
}
}
in Test::{
, children = toMap
{ baseline = Child.flat benchmarkAttrs
, test = Init.toChild test Init.Attributes.default
}
}