2020-01-12 19:52:40 +00:00
|
|
|
# Integration test, can be run without internet access.
|
|
|
|
|
2020-08-21 20:36:13 +00:00
|
|
|
# Make sure to update build() in ./run-tests.sh when adding new scenarios
|
2020-07-16 14:48:41 +00:00
|
|
|
{ scenario ? "default" }:
|
|
|
|
|
2020-01-12 19:52:40 +00:00
|
|
|
import ./make-test.nix rec {
|
2020-08-21 20:36:09 +00:00
|
|
|
name = "nix-bitcoin-${scenario}";
|
2020-01-12 19:52:40 +00:00
|
|
|
|
|
|
|
hardened = {
|
|
|
|
imports = [ <nixpkgs/nixos/modules/profiles/hardened.nix> ];
|
2020-08-04 13:32:06 +00:00
|
|
|
security.allowUserNamespaces = true; # re-enable disabled option
|
2020-01-12 19:52:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
machine = { pkgs, lib, ... }: with lib; {
|
|
|
|
imports = [
|
2020-04-07 20:47:32 +00:00
|
|
|
../modules/presets/secure-node.nix
|
2020-01-12 19:52:40 +00:00
|
|
|
../modules/secrets/generate-secrets.nix
|
|
|
|
# using the hardened profile increases total test duration by ~50%, so disable it for now
|
|
|
|
# hardened
|
|
|
|
];
|
|
|
|
|
2020-08-21 20:36:10 +00:00
|
|
|
nix-bitcoin.netns-isolation.enable = (scenario == "withnetns");
|
2020-06-18 10:22:44 +00:00
|
|
|
|
2020-01-12 19:52:40 +00:00
|
|
|
services.bitcoind.extraConfig = mkForce "connect=0";
|
|
|
|
|
|
|
|
services.clightning.enable = true;
|
|
|
|
services.spark-wallet.enable = true;
|
|
|
|
services.lightning-charge.enable = true;
|
|
|
|
services.nanopos.enable = true;
|
|
|
|
|
|
|
|
services.lnd.enable = true;
|
2020-08-04 08:24:49 +00:00
|
|
|
services.lnd.listenPort = 9736;
|
2020-07-10 14:09:31 +00:00
|
|
|
services.lightning-loop.enable = true;
|
2020-08-04 08:24:49 +00:00
|
|
|
# needed because we must control when lightning-loop starts so it doesn't
|
|
|
|
# fail before we run commands in the nb-lightning-loop netns
|
2020-07-10 14:09:31 +00:00
|
|
|
systemd.services.lightning-loop.wantedBy = mkForce [];
|
2020-01-12 19:52:40 +00:00
|
|
|
|
|
|
|
services.electrs.enable = true;
|
|
|
|
|
|
|
|
services.liquidd = {
|
|
|
|
enable = true;
|
|
|
|
listen = mkForce false;
|
|
|
|
extraConfig = "noconnect=1";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nix-bitcoin-webindex.enable = true;
|
|
|
|
|
|
|
|
services.hardware-wallets = {
|
|
|
|
trezor = true;
|
|
|
|
ledger = true;
|
|
|
|
};
|
|
|
|
|
2020-06-23 11:03:16 +00:00
|
|
|
services.backups.enable = true;
|
|
|
|
|
2020-01-12 19:52:40 +00:00
|
|
|
# to test that unused secrets are made inaccessible by 'setup-secrets'
|
|
|
|
systemd.services.generate-secrets.postStart = ''
|
|
|
|
install -o nobody -g nogroup -m777 <(:) /secrets/dummy
|
|
|
|
'';
|
|
|
|
};
|
2020-08-21 20:36:10 +00:00
|
|
|
testScript =
|
2020-08-21 20:36:12 +00:00
|
|
|
builtins.readFile ./base.py + "\n\n" + builtins.readFile "${./.}/scenarios/${scenario}.py";
|
2020-01-12 19:52:40 +00:00
|
|
|
}
|