unicorn.git  about / heads / tags
Rack HTTP server for Unix and fast clients
blob 5dd0d651b22d755d30525a14150aecc57c6763a8 849 bytes (raw)
$ git show v4.4.0:t/t0600-https-server-basic.sh	# shows this blob on the CLI

 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
39
40
41
42
43
44
45
46
47
48
 
#!/bin/sh
. ./test-lib.sh
t_plan 7 "simple HTTPS connection tests"

t_begin "setup and start" && {
	rtmpfiles curl_err
	unicorn_setup
cat > $unicorn_config <<EOF
ssl do
  listen "$listen"
  ssl_certificate "server.crt"
  ssl_certificate_key "server.key"
end
pid "$pid"
stderr_path "$r_err"
stdout_path "$r_out"
EOF
	unicorn -D -c $unicorn_config env.ru
	unicorn_wait_start
}

t_begin "single request" && {
	curl -sSfv --cacert ca.crt https://$listen/
}

t_begin "check stderr has no errors" && {
	check_stderr
}

t_begin "multiple requests" && {
	curl -sSfv --no-keepalive --cacert ca.crt \
		https://$listen/ https://$listen/ 2>> $curl_err >> $tmp
		dbgcat curl_err
}

t_begin "check stderr has no errors" && {
	check_stderr
}

t_begin "killing succeeds" && {
	kill $unicorn_pid
}

t_begin "check stderr has no errors" && {
	check_stderr
}

t_done

git clone https://yhbt.net/unicorn.git