Add a test for the location submodule: Addressing.
This commit is contained in:
parent
896c5ff939
commit
9b9cfb76a9
2 changed files with 42 additions and 0 deletions
|
|
@ -31,6 +31,12 @@ in
|
|||
description = "System definitions from meta.nix.";
|
||||
};
|
||||
|
||||
policy = mkOption {
|
||||
type = types.attrs;
|
||||
readOnly = true;
|
||||
description = "Policy subtree from meta.nix.";
|
||||
};
|
||||
|
||||
# Computed addressing
|
||||
network = mkOption {
|
||||
type = types.attrs;
|
||||
|
|
|
|||
36
tests/addressing-smoke.nix
Normal file
36
tests/addressing-smoke.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
let
|
||||
lib = import <nixpkgs/lib> { };
|
||||
addressing = import ./lib/addressing { inherit lib; };
|
||||
|
||||
spec = {
|
||||
domain = "kasear.net";
|
||||
|
||||
locations = {
|
||||
home = {
|
||||
# note: owner/admins/users are *ignored* by mkNetworkFromSpec
|
||||
owner = "yaro";
|
||||
admins = [ "ops" ];
|
||||
|
||||
main = {
|
||||
vlan = 10;
|
||||
hosts = {
|
||||
deimos = {
|
||||
role = "server";
|
||||
hostId = 1;
|
||||
};
|
||||
|
||||
router = {
|
||||
role = "router";
|
||||
hostId = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
network = addressing.mkNetworkFromSpec spec;
|
||||
in
|
||||
{
|
||||
inherit spec network;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue