-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathnode.nix
33 lines (31 loc) · 874 Bytes
/
node.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
perSystem.vmTests.tests.cardano-node = {
impure = true;
module = {
nodes.machine =
{ pkgs, ... }:
{
cardano = {
network = "preview";
cli.enable = true;
node.enable = true;
};
environment.systemPackages = with pkgs; [
jq
bc
];
};
testScript =
{ nodes, ... }:
let
magic = toString nodes.machine.config.cardano.networkNumber;
in
''
machine.wait_for_unit("cardano-node")
machine.wait_until_succeeds("""[[ $(echo "$(cardano-cli query tip --testnet-magic ${magic} | jq '.syncProgress' --raw-output) > 0.001" | bc) == "1" ]]""")
print(machine.succeed("systemd-analyze security cardano-node"))
print('\nVM Test Succeeded.')
'';
};
};
}