unicorn.git  about / heads / tags
Rack HTTP server for Unix and fast clients
blob f03c497e61d5982be8f2bf407173f019b7061419 577 bytes (raw)
$ git show HEAD:t/t0021-process_detach.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
 
#!/bin/sh
. ./test-lib.sh

t_plan 5 "Process.detach on forked background process works"

t_begin "setup and startup" && {
	t_fifos process_detach
	unicorn_setup
	TEST_FIFO=$process_detach \
	  unicorn -E none -D detach.ru -c $unicorn_config
	unicorn_wait_start
}

t_begin "read detached PID with HTTP/1.0" && {
	detached_pid=$(curl -0 -sSf http://$listen/)
	t_info "detached_pid=$detached_pid"
}

t_begin "read background FIFO" && {
	test xHIHI = x"$(cat $process_detach)"
}

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

t_begin "check stderr" && check_stderr

t_done

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