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
110
};
111
111
};
112
112
};
113
113
-
114
113
testScript =
115
114
let
116
115
portStrHTTP = builtins.toString port.HTTP;
···
122
121
server.wait_for_open_port(${portStrHTTP})
123
122
server.wait_for_open_port(${portStrTLS})
124
123
125
125
-
http_hello_world_body = server.succeed("curl --fail-with-body 'http://${domain.HTTP}:${portStrHTTP}/hello_world.txt'")
126
126
-
assert "${sawatdi_chao_lok}" in http_hello_world_body
124
124
+
assert "${sawatdi_chao_lok}" in server.succeed("curl --fail-with-body 'http://${domain.HTTP}:${portStrHTTP}/hello_world.txt'")
127
125
128
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()
129
127
assert "http/2 200" in tls_hello_world_head
130
128
assert "server: h2o" in tls_hello_world_head
131
129
assert "content-type: text/x-rst" in tls_hello_world_head
132
130
133
133
-
tls_hello_world_body = server.succeed("curl -v --http2 --tlsv1.3 --compressed --fail-with-body 'https://${domain.TLS}:${portStrTLS}/hello_world.rst'")
134
134
-
assert "${sawatdi_chao_lok}" in tls_hello_world_body
131
131
+
assert "${sawatdi_chao_lok}" in server.succeed("curl -v --http2 --tlsv1.3 --compressed --fail-with-body 'https://${domain.TLS}:${portStrTLS}/hello_world.rst'")
135
132
136
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
137
-
assert "redirected" in tls_hello_world_head_redirected
133
133
+
assert "redirected" in server.succeed("curl -v --head --fail-with-body 'http://${domain.TLS}:${portStrHTTP}/hello_world.rst'").lower()
138
134
139
135
server.fail("curl --location --max-redirs 0 'http://${domain.TLS}:${portStrHTTP}/hello_world.rst'")
140
136
141
141
-
tls_hello_world_body_redirected = server.succeed("curl -v --location --fail-with-body 'http://${domain.TLS}:${portStrHTTP}/hello_world.rst'")
142
142
-
assert "${sawatdi_chao_lok}" in tls_hello_world_body_redirected
137
137
+
assert "${sawatdi_chao_lok}" in server.succeed("curl -v --location --fail-with-body 'http://${domain.TLS}:${portStrHTTP}/hello_world.rst'")
143
138
'';
144
139
}
+2
-4
nixos/tests/web-servers/h2o/mruby.nix
···
58
58
server.wait_for_unit("h2o.service")
59
59
server.wait_for_open_port(${portStr})
60
60
61
61
-
hello_world = server.succeed("curl --fail-with-body http://${domain}:${portStr}/hello_world")
62
62
-
assert "${sawatdi_chao_lok}" in hello_world
61
61
+
assert "${sawatdi_chao_lok}" in server.succeed("curl --fail-with-body http://${domain}:${portStr}/hello_world")
63
62
64
64
-
file_handler = server.succeed("curl --fail-with-body http://${domain}:${portStr}/file_handler")
65
65
-
assert "FILE_HANDLER" in file_handler
63
63
+
assert "FILE_HANDLER" in server.succeed("curl --fail-with-body http://${domain}:${portStr}/file_handler")
66
64
'';
67
65
}