tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/h2o: reduce variable name noise
โทสฺตัล
10 months ago
454411d3
f68ad5cc
+6
-13
2 changed files
expand all
collapse all
unified
split
nixos
tests
web-servers
h2o
basic.nix
mruby.nix
+4
-9
nixos/tests/web-servers/h2o/basic.nix
···
110
};
111
};
112
};
113
-
114
testScript =
115
let
116
portStrHTTP = builtins.toString port.HTTP;
···
122
server.wait_for_open_port(${portStrHTTP})
123
server.wait_for_open_port(${portStrTLS})
124
125
-
http_hello_world_body = server.succeed("curl --fail-with-body 'http://${domain.HTTP}:${portStrHTTP}/hello_world.txt'")
126
-
assert "${sawatdi_chao_lok}" in http_hello_world_body
127
128
tls_hello_world_head = server.succeed("curl -v --head --compressed --http2 --tlsv1.3 --fail-with-body 'https://${domain.TLS}:${portStrTLS}/hello_world.rst'").lower()
129
assert "http/2 200" in tls_hello_world_head
130
assert "server: h2o" in tls_hello_world_head
131
assert "content-type: text/x-rst" in tls_hello_world_head
132
133
-
tls_hello_world_body = server.succeed("curl -v --http2 --tlsv1.3 --compressed --fail-with-body 'https://${domain.TLS}:${portStrTLS}/hello_world.rst'")
134
-
assert "${sawatdi_chao_lok}" in tls_hello_world_body
135
136
-
tls_hello_world_head_redirected = server.succeed("curl -v --head --fail-with-body 'http://${domain.TLS}:${builtins.toString port.HTTP}/hello_world.rst'").lower()
137
-
assert "redirected" in tls_hello_world_head_redirected
138
139
server.fail("curl --location --max-redirs 0 'http://${domain.TLS}:${portStrHTTP}/hello_world.rst'")
140
141
-
tls_hello_world_body_redirected = server.succeed("curl -v --location --fail-with-body 'http://${domain.TLS}:${portStrHTTP}/hello_world.rst'")
142
-
assert "${sawatdi_chao_lok}" in tls_hello_world_body_redirected
143
'';
144
}
···
110
};
111
};
112
};
0
113
testScript =
114
let
115
portStrHTTP = builtins.toString port.HTTP;
···
121
server.wait_for_open_port(${portStrHTTP})
122
server.wait_for_open_port(${portStrTLS})
123
124
+
assert "${sawatdi_chao_lok}" in server.succeed("curl --fail-with-body 'http://${domain.HTTP}:${portStrHTTP}/hello_world.txt'")
0
125
126
tls_hello_world_head = server.succeed("curl -v --head --compressed --http2 --tlsv1.3 --fail-with-body 'https://${domain.TLS}:${portStrTLS}/hello_world.rst'").lower()
127
assert "http/2 200" in tls_hello_world_head
128
assert "server: h2o" in tls_hello_world_head
129
assert "content-type: text/x-rst" in tls_hello_world_head
130
131
+
assert "${sawatdi_chao_lok}" in server.succeed("curl -v --http2 --tlsv1.3 --compressed --fail-with-body 'https://${domain.TLS}:${portStrTLS}/hello_world.rst'")
0
132
133
+
assert "redirected" in server.succeed("curl -v --head --fail-with-body 'http://${domain.TLS}:${portStrHTTP}/hello_world.rst'").lower()
0
134
135
server.fail("curl --location --max-redirs 0 'http://${domain.TLS}:${portStrHTTP}/hello_world.rst'")
136
137
+
assert "${sawatdi_chao_lok}" in server.succeed("curl -v --location --fail-with-body 'http://${domain.TLS}:${portStrHTTP}/hello_world.rst'")
0
138
'';
139
}
+2
-4
nixos/tests/web-servers/h2o/mruby.nix
···
58
server.wait_for_unit("h2o.service")
59
server.wait_for_open_port(${portStr})
60
61
-
hello_world = server.succeed("curl --fail-with-body http://${domain}:${portStr}/hello_world")
62
-
assert "${sawatdi_chao_lok}" in hello_world
63
64
-
file_handler = server.succeed("curl --fail-with-body http://${domain}:${portStr}/file_handler")
65
-
assert "FILE_HANDLER" in file_handler
66
'';
67
}
···
58
server.wait_for_unit("h2o.service")
59
server.wait_for_open_port(${portStr})
60
61
+
assert "${sawatdi_chao_lok}" in server.succeed("curl --fail-with-body http://${domain}:${portStr}/hello_world")
0
62
63
+
assert "FILE_HANDLER" in server.succeed("curl --fail-with-body http://${domain}:${portStr}/file_handler")
0
64
'';
65
}