Browse Source

dhall: policy specification

remotes/praha/master
Emery Hemingway 1 year ago
parent
commit
100be5270a
  1. 4
      packages/dhall/genode.nix
  2. 4
      tests/posix.dhall
  3. 14
      tests/solo5/net.dhall
  4. 19
      tests/solo5/net_2if.dhall
  5. 7
      tests/test-wrapper.dhall
  6. 9
      tests/vmm_arm.dhall
  7. 15
      tests/x86.dhall

4
packages/dhall/genode.nix

@ -8,8 +8,8 @@ dhallPackages.buildDhallPackage {
code = let
src = fetchgit {
url = "https://git.sr.ht/~ehmry/dhall-genode";
rev = "aecb2db8b23421addb57aa29cfc17d9c4601b6e5";
sha256 = "17wv761fmbk6wzjjrlzj4lb2lazl5p95izni000xf7lra5xllilq";
rev = "b9630af18be8956562ffba026f7bfc3b55b093b1";
sha256 = "072w6g3561qnhfw2j721584c6ds9bw4f9xq1j5ggj3p0fhf5yp5z";
};
in src + "/package.dhall";

4
tests/posix.dhall

@ -35,9 +35,11 @@ in λ(params : { bash : Text, coreutils : Text, script : Text })
<dir name="tmp"><ram/></dir>
<dir name="nix"><fs label="nix" root="nix"/></dir>
</vfs>
<default-policy root="/" writeable="yes"/>
''
]
, defaultPolicy = Some Init.Config.DefaultPolicy::{
, attributes = toMap { root = "/", writeable = "yes" }
}
}
, provides = [ "File_system" ]
, resources = Genode.Init.Resources::{

14
tests/solo5/net.dhall

@ -32,13 +32,15 @@ let init =
, routes = [ ServiceRoute.child "Nic" "nic" ]
, config = Init.Config::{
, attributes = toMap { mac = "02:02:02:02:03:00" }
, content =
[ Genode.Prelude.XML.text
''
<policy label_prefix="solo5" ip_addr="10.0.0.2"/>
<default-policy/>
''
, policies =
[ Init.Config.Policy::{
, attributes = toMap { ip_addr = "10.0.0.2" }
, label =
Init.LabelSelector.Type.Partial
{ prefix = Some "solo5", suffix = None Text }
}
]
, defaultPolicy = Some Init.Config.DefaultPolicy::{=}
}
}
, solo5 =

19
tests/solo5/net_2if.dhall

@ -29,13 +29,18 @@ let init =
, provides = [ "Nic" ]
, routes = [ Genode.Init.ServiceRoute.child "Nic" "nic" ]
, config = Init.Config::{
, content =
[ Genode.Prelude.XML.text
''
<policy label="solo5 -> service0" ip_addr="10.0.0.2"/>
<policy label="solo5 -> service1" ip_addr="10.1.0.2"/>
<default-policy/>
''
, defaultPolicy = Some Init.Config.DefaultPolicy::{=}
, policies =
[ Init.Config.Policy::{
, attributes = toMap { ip_addr = "10.0.0.2" }
, label =
Init.LabelSelector.Type.Scoped "solo5 -> service0"
}
, Init.Config.Policy::{
, attributes = toMap { ip_addr = "10.1.0.2" }
, label =
Init.LabelSelector.Type.Scoped "solo5 -> service1"
}
]
}
}

7
tests/test-wrapper.dhall

@ -129,11 +129,10 @@ in λ(test : Test.Type)
}
]
}
, XML.leaf
{ name = "default-policy"
, attributes = toMap { root = "/", writeable = "no" }
}
]
, defaultPolicy = Some Init.Config.DefaultPolicy::{
, attributes = toMap { root = "/", writeable = "no" }
}
}
, provides = [ "File_system" ]
}

9
tests/vmm_arm.dhall

@ -22,11 +22,7 @@ in λ(guest : { linux : Text, dtb : Text, initrd : Text })
, binary = "nic_router"
, config = Init.Config::{
, content =
[ XML.leaf
{ name = "default-policy"
, attributes = toMap { domain = "default" }
}
, XML.element
[ XML.element
{ name = "domain"
, attributes = toMap
{ name = "default"
@ -43,6 +39,9 @@ in λ(guest : { linux : Text, dtb : Text, initrd : Text })
]
}
]
, defaultPolicy = Some Init.Config.Policy::{
, attributes = toMap { domain = "default" }
}
}
, provides = [ "Nic" ]
, resources = Init.Resources::{ ram = Genode.units.MiB 8 }

15
tests/x86.dhall

@ -76,11 +76,16 @@ let pciInit =
, ServiceRoute.parent "IO_PORT"
]
, config = Init.Config::{
, content =
[ XML.text
''
<policy label_prefix="test-pci"> <pci class="ALL"/> </policy>
''
, policies =
[ Init.Config.Policy::{
, content =
[ XML.leaf
{ name = "pci"
, attributes = toMap { class = "ALL" }
}
]
, label = Init.LabelSelector.Type.Scoped "test-pci"
}
]
}
}

Loading…
Cancel
Save