forked from mlabs-haskell/cardano.nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
http.nix
36 lines (33 loc) · 1.05 KB
/
http.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
{
perSystem.vmTests.tests.http = {
impure = true;
module = {
nodes.node = {config, ...}: {
cardano = {
network = "preview";
node.enable = true;
ogmios.enable = true;
};
services.ogmios.host = "0.0.0.0";
networking.firewall.allowedTCPPorts = [config.services.ogmios.port];
};
nodes.proxy = {
cardano = {
http.enable = true;
};
services.http-proxy.servers = ["node"];
};
nodes.client = {pkgs, ...}: {
environment.systemPackages = [pkgs.curl];
};
testScript = {nodes, ...}: ''
start_all()
node.wait_for_unit("ogmios")
node.wait_until_succeeds('curl --silent --fail http://127.0.0.1:1337/health')
proxy.wait_for_unit("nginx")
client.wait_until_succeeds('curl --silent --fail -H "Host: ogmios" http://proxy/health')
client.succeed('[ "${nodes.node.services.ogmios.package.version}" == "$(curl --silent --fail -H "Host: ogmios" http://proxy/version)" ]')
'';
};
};
}