From 33d11182e371ff82d3a13648c6bbe4252162af5b Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Thu, 23 Jan 2020 11:39:02 +0100 Subject: [PATCH] Add Rtc test --- tests/default.nix | 2 +- tests/rtc.dhall | 29 +++++++++++++++++++++++++++++ tests/rtc.nix | 13 +++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/rtc.dhall create mode 100644 tests/rtc.nix diff --git a/tests/default.nix b/tests/default.nix index 7e00dc1..c8507d4 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -20,7 +20,7 @@ let inherit apps testPkgs hostPkgs lib depot; }).callTest; - nova = (call: ((tests call) // { pci = call ./pci.nix { }; })) + nova = (call: ((tests call) // { pci = call ./pci.nix { }; rtc = call ./rtc.nix { }; })) (import ./driver-nova.nix { inherit apps system testPkgs hostPkgs lib depot; }).callTest; diff --git a/tests/rtc.dhall b/tests/rtc.dhall new file mode 100644 index 0000000..c66e4f9 --- /dev/null +++ b/tests/rtc.dhall @@ -0,0 +1,29 @@ +-- SPDX-License-Identifier: CC0-1.0 + +let Genode = env:DHALL_GENODE + +in { config = + Genode.Init::{ + , verbose = True + , children = + toMap + { test-rtc = + Genode.Init.Start::{ + , binary = "test-rtc" + , resources = { caps = 128, ram = Genode.units.MiB 2 } + , exitPropagate = True + , routes = + [ Genode.ServiceRoute.parent "Timer" + , Genode.ServiceRoute.child "Rtc" "rtc_drv" + ] + } + , rtc_drv = + Genode.Init.Start::{ + , binary = "rtc_drv" + , provides = [ "Rtc" ] + , routes = [ Genode.ServiceRoute.parent "IO_PORT" ] + } + } + } + , rom = let os = env:OS_MANIFEST in [ os.bin.test-rtc, os.bin.rtc_drv ] + } diff --git a/tests/rtc.nix b/tests/rtc.nix new file mode 100644 index 0000000..73c5a31 --- /dev/null +++ b/tests/rtc.nix @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: CC0-1.0 + +{ testEnv, pkgs, ... }: +with pkgs; + +testEnv.mkTest { + name = "rtc"; + meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ]; + + testConfig = ./rtc.dhall; + + testScript = "run_genode_until {--- RTC test finished ---} 40"; +}