-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathogmios.nix
38 lines (36 loc) · 1.2 KB
/
ogmios.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
34
35
36
37
38
{
perSystem.vmTests.tests.ogmios = {
impure = true;
module = {
nodes.machine =
{ pkgs, ... }:
{
cardano = {
network = "preview";
cli.enable = true;
node.enable = true;
ogmios.enable = true;
};
environment.systemPackages = with pkgs; [
jq
bc
curl
];
};
testScript =
{ nodes, ... }:
let
magic = toString nodes.machine.config.cardano.networkNumber;
in
''
machine.wait_for_unit("cardano-node")
machine.wait_for_unit("cardano-node-socket")
machine.wait_until_succeeds("""[[ $(echo "$(cardano-cli query tip --testnet-magic ${magic} | jq '.syncProgress' --raw-output) > 0.001" | bc) == "1" ]]""")
machine.wait_for_unit("ogmios")
machine.succeed("curl --silent --fail http://localhost:1337/health")
machine.wait_until_succeeds("""[[ $(echo "$(curl --silent --fail http://localhost:1337/health | jq '.networkSynchronization' --raw-output) > 0.00001" | bc) == "1" ]]""")
print(machine.succeed("systemd-analyze security ogmios"))
'';
};
};
}