nixos/tests/mycelium: init
This commit is contained in:
parent
b82a5ef764
commit
0f0aaa517c
4 changed files with 60 additions and 0 deletions
|
@ -561,6 +561,7 @@ in {
|
|||
munin = handleTest ./munin.nix {};
|
||||
mutableUsers = handleTest ./mutable-users.nix {};
|
||||
mxisd = handleTest ./mxisd.nix {};
|
||||
mycelium = handleTest ./mycelium {};
|
||||
mympd = handleTest ./mympd.nix {};
|
||||
mysql = handleTest ./mysql/mysql.nix {};
|
||||
mysql-autobackup = handleTest ./mysql/mysql-autobackup.nix {};
|
||||
|
|
57
nixos/tests/mycelium/default.nix
Normal file
57
nixos/tests/mycelium/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
import ../make-test-python.nix ({ lib, ... }: let
|
||||
peer1-ip = "531:c350:28c1:dfde:ea6d:77d1:a60b:7209";
|
||||
peer2-ip = "49f:3942:3a55:d100:4c78:c558:c4f:695b";
|
||||
in
|
||||
{
|
||||
name = "mycelium";
|
||||
meta.maintainers = with lib.maintainers; [ lassulus ];
|
||||
|
||||
nodes = {
|
||||
|
||||
peer1 = { config, pkgs, ... }: {
|
||||
virtualisation.vlans = [ 1 ];
|
||||
networking.interfaces.eth1.ipv4.addresses = [{
|
||||
address = "192.168.1.11";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
|
||||
services.mycelium = {
|
||||
enable = true;
|
||||
addHostedPublicNodes = false;
|
||||
openFirewall = true;
|
||||
keyFile = ./peer1.key;
|
||||
peers = [
|
||||
"quic://192.168.1.12:9651"
|
||||
"tcp://192.168.1.12:9651"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
peer2 = { config, pkgs, ... }: {
|
||||
virtualisation.vlans = [ 1 ];
|
||||
networking.interfaces.eth1.ipv4.addresses = [{
|
||||
address = "192.168.1.12";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
|
||||
services.mycelium = {
|
||||
enable = true;
|
||||
addHostedPublicNodes = false;
|
||||
openFirewall = true;
|
||||
keyFile = ./peer2.key;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
peer1.wait_for_unit("network-online.target")
|
||||
peer2.wait_for_unit("network-online.target")
|
||||
peer1.wait_for_unit("mycelium.service")
|
||||
peer2.wait_for_unit("mycelium.service")
|
||||
|
||||
peer1.succeed("ping -c5 ${peer2-ip}")
|
||||
peer2.succeed("ping -c5 ${peer1-ip}")
|
||||
'';
|
||||
})
|
1
nixos/tests/mycelium/peer1.key
Normal file
1
nixos/tests/mycelium/peer1.key
Normal file
|
@ -0,0 +1 @@
|
|||
sì B0㔟ŽdûR<C3BB>æÈôÌH¶5œu?à»í…^
|
1
nixos/tests/mycelium/peer2.key
Normal file
1
nixos/tests/mycelium/peer2.key
Normal file
|
@ -0,0 +1 @@
|
|||
ΟX<>1®yGΟΥ…<CEA5>SAM»<4D>eΘΐ«Ύ‡<0C>έ7]
|
Loading…
Reference in a new issue