tests: explicitly specify services to be sourced from self
See previous commit
This commit is contained in:
@@ -28,6 +28,7 @@ nixosLib.runTest (
|
||||
borgone = {
|
||||
|
||||
module.name = "@clan/borgbackup";
|
||||
module.input = "self";
|
||||
|
||||
roles.client.machines."clientone" = { };
|
||||
roles.server.machines."serverone".settings.directory = "/tmp/borg-test";
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
instances."test" = {
|
||||
module.name = "new-service";
|
||||
module.input = "self";
|
||||
roles.peer.machines.peer1 = { };
|
||||
};
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ nixosLib.runTest (
|
||||
|
||||
instances."test" = {
|
||||
module.name = "new-service";
|
||||
module.input = "self";
|
||||
roles.peer.machines.peer1 = { };
|
||||
};
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ nixosLib.runTest (
|
||||
instances = {
|
||||
mycelium-test = {
|
||||
module.name = "@clan/mycelium";
|
||||
module.input = "self";
|
||||
roles.peer.machines."server".settings = {
|
||||
openFirewall = true;
|
||||
addHostedPublicNodes = true;
|
||||
|
||||
@@ -14,6 +14,7 @@ in
|
||||
instances = {
|
||||
ssh-test-one = {
|
||||
module.name = "@clan/admin";
|
||||
module.input = "self";
|
||||
roles.default.machines."server".settings = {
|
||||
allowedKeys.testkey = public-key;
|
||||
};
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
borgone = {
|
||||
|
||||
module.name = "@clan/borgbackup";
|
||||
module.input = "self";
|
||||
|
||||
roles.client.machines."clientone" = { };
|
||||
roles.server.machines."serverone".settings.directory = "/tmp/borg-test";
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
instances = {
|
||||
garage-test = {
|
||||
module.name = "@clan/garage";
|
||||
module.input = "self";
|
||||
roles.default.machines."server".settings = { };
|
||||
};
|
||||
};
|
||||
|
||||
@@ -24,6 +24,7 @@ let
|
||||
inventory.instances = {
|
||||
"hello" = {
|
||||
module.name = "hello-world";
|
||||
module.input = "self";
|
||||
|
||||
roles.peer.machines.jon = { };
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
instances."test" = {
|
||||
module.name = "hello-service";
|
||||
module.input = "self";
|
||||
roles.peer.machines.peer1 = { };
|
||||
};
|
||||
};
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
instances = {
|
||||
mycelium-test = {
|
||||
module.name = "@clan/mycelium";
|
||||
module.input = "self";
|
||||
roles.peer.machines."server".settings = {
|
||||
openFirewall = true;
|
||||
addHostedPublicNodes = true;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
{
|
||||
module,
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "packages";
|
||||
|
||||
@@ -12,6 +8,7 @@
|
||||
|
||||
instances.default = {
|
||||
module.name = "@clan/packages";
|
||||
module.input = "self";
|
||||
roles.default.machines."server".settings = {
|
||||
packages = [ "cbonsai" ];
|
||||
};
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
instances = {
|
||||
sshd-test = {
|
||||
module.name = "@clan/sshd";
|
||||
module.input = "self";
|
||||
roles.server.machines."server".settings = {
|
||||
certificate.searchDomains = [ "example.com" ];
|
||||
hostKeys.rsa.enable = true;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
machines.server = { };
|
||||
instances.default = {
|
||||
module.name = "@clan/state-version";
|
||||
module.input = "self";
|
||||
roles.default.machines."server" = { };
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
instances = {
|
||||
trusted-nix-caches = {
|
||||
module.name = "@clan/trusted-nix-caches";
|
||||
module.input = "self";
|
||||
roles.default.machines."server" = { };
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
instances = {
|
||||
root-password-test = {
|
||||
module.name = "@clan/users";
|
||||
module.input = "self";
|
||||
roles.default.machines."server".settings = {
|
||||
user = "root";
|
||||
prompt = false;
|
||||
@@ -16,6 +17,7 @@
|
||||
};
|
||||
user-password-test = {
|
||||
module.name = "@clan/users";
|
||||
module.input = "self";
|
||||
roles.default.machines."server".settings = {
|
||||
user = "testuser";
|
||||
prompt = false;
|
||||
|
||||
@@ -24,6 +24,7 @@ let
|
||||
inventory.instances = {
|
||||
"default" = {
|
||||
module.name = "wifi";
|
||||
module.input = "self";
|
||||
roles.default.tags.all = { };
|
||||
roles.default.settings.networks.one = { };
|
||||
roles.default.settings.networks.two = { };
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
instances = {
|
||||
wg-test-one = {
|
||||
module.name = "@clan/wifi";
|
||||
module.input = "self";
|
||||
|
||||
roles.default.machines = {
|
||||
test.settings.networks.one = { };
|
||||
|
||||
@@ -22,6 +22,7 @@ let
|
||||
inventory.instances = {
|
||||
zerotier = {
|
||||
module.name = "zerotier";
|
||||
module.input = "self";
|
||||
|
||||
roles.peer.tags.all = { };
|
||||
roles.moon.machines.sara.settings.stableEndpoints = [ "10.0.0.3/9993" ];
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
instances = {
|
||||
"zerotier" = {
|
||||
module.name = "zerotier";
|
||||
module.input = "self";
|
||||
|
||||
roles.peer.tags.all = { };
|
||||
roles.controller.machines.bam = { };
|
||||
|
||||
@@ -151,16 +151,19 @@ in
|
||||
instances."instance_foo" = {
|
||||
module = {
|
||||
name = "A";
|
||||
input = "self";
|
||||
};
|
||||
};
|
||||
instances."instance_bar" = {
|
||||
module = {
|
||||
name = "A";
|
||||
input = "self";
|
||||
};
|
||||
};
|
||||
instances."instance_zaza" = {
|
||||
module = {
|
||||
name = "B";
|
||||
input = "self";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -186,6 +189,7 @@ in
|
||||
_class = "clan.service";
|
||||
manifest = {
|
||||
name = "network";
|
||||
input = "self";
|
||||
};
|
||||
# Define a role without special behavior
|
||||
roles.peer = { };
|
||||
@@ -200,18 +204,21 @@ in
|
||||
instances."instance_foo" = {
|
||||
module = {
|
||||
name = "A";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.machines.jon = { };
|
||||
};
|
||||
instances."instance_bar" = {
|
||||
module = {
|
||||
name = "A";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.machines.sara = { };
|
||||
};
|
||||
instances."instance_zaza" = {
|
||||
module = {
|
||||
name = "B";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.tags.all = { };
|
||||
};
|
||||
@@ -256,12 +263,14 @@ in
|
||||
instances."instance_foo" = {
|
||||
module = {
|
||||
name = "A";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.tags.foo = { };
|
||||
};
|
||||
instances."instance_zaza" = {
|
||||
module = {
|
||||
name = "B";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.tags.all = { };
|
||||
};
|
||||
|
||||
@@ -32,7 +32,11 @@ let
|
||||
in
|
||||
{
|
||||
test_import_local_module_by_name = {
|
||||
expr = (resolve { name = "A"; }).importedModuleWithInstances.instance_foo.resolvedModule;
|
||||
expr =
|
||||
(resolve {
|
||||
name = "A";
|
||||
input = "self";
|
||||
}).importedModuleWithInstances.instance_foo.resolvedModule;
|
||||
expected = {
|
||||
_class = "clan.service";
|
||||
manifest = {
|
||||
|
||||
@@ -62,6 +62,7 @@ let
|
||||
instances."instance_foo" = {
|
||||
module = {
|
||||
name = "A";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.machines.jon = {
|
||||
settings.timeout = lib.mkForce "foo-peer-jon";
|
||||
@@ -74,6 +75,7 @@ let
|
||||
instances."instance_bar" = {
|
||||
module = {
|
||||
name = "A";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.machines.jon = {
|
||||
settings.timeout = "bar-peer-jon";
|
||||
|
||||
@@ -44,6 +44,7 @@ let
|
||||
instances."instance_foo" = {
|
||||
module = {
|
||||
name = "A";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.machines.jon = {
|
||||
settings.timeout = lib.mkForce "foo-peer-jon";
|
||||
@@ -55,6 +56,7 @@ let
|
||||
instances."instance_bar" = {
|
||||
module = {
|
||||
name = "A";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.machines.jon = {
|
||||
settings.timeout = "bar-peer-jon";
|
||||
@@ -63,6 +65,7 @@ let
|
||||
instances."instance_zaza" = {
|
||||
module = {
|
||||
name = "B";
|
||||
input = "self";
|
||||
};
|
||||
roles.peer.tags.all = { };
|
||||
};
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
machines.server = { };
|
||||
instances.importer = {
|
||||
module.name = "@clan/importer";
|
||||
module.input = "self";
|
||||
roles.default.tags.all = { };
|
||||
roles.default.extraModules = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user