1 |
#!/bin/sh |
#!/bin/sh |
2 |
# proxy-bad-request-body.sh - test jscoverage-server --proxy with a bad request body |
# proxy-bad-request-body.sh - test jscoverage-server --proxy with a bad request body |
3 |
# Copyright (C) 2008 siliconforks.com |
# Copyright (C) 2008, 2009, 2010 siliconforks.com |
4 |
# |
# |
5 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
6 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
18 |
|
|
19 |
set -e |
set -e |
20 |
|
|
21 |
function shutdown() { |
shutdown() { |
22 |
wget -q -O- --post-data= "http://127.0.0.1:${proxy_server_port}/jscoverage-shutdown" > /dev/null |
wget -q -O- --post-data= "http://127.0.0.1:${proxy_server_port}/jscoverage-shutdown" > /dev/null |
23 |
wait $proxy_server_pid |
wait $proxy_server_pid |
|
kill $python_server_pid |
|
24 |
} |
} |
25 |
|
|
26 |
function cleanup() { |
shutdown_perl() { |
27 |
|
wget -q -O- --post-data= http://127.0.0.1:8000/perl-shutdown > /dev/null |
28 |
|
wait $origin_server_pid |
29 |
|
} |
30 |
|
|
31 |
|
cleanup() { |
32 |
shutdown |
shutdown |
33 |
|
shutdown_perl |
34 |
} |
} |
35 |
|
|
36 |
trap 'cleanup' 0 1 2 3 15 |
trap 'cleanup' 0 1 2 3 15 |
45 |
fi |
fi |
46 |
|
|
47 |
cd recursive |
cd recursive |
48 |
python ../POSTServer.py > /dev/null 2> /dev/null & |
perl ../server.pl > /dev/null 2> /dev/null & |
49 |
python_server_pid=$! |
origin_server_pid=$! |
50 |
cd .. |
cd .. |
51 |
|
|
52 |
$VALGRIND jscoverage-server --proxy > OUT 2> ERR & |
$VALGRIND jscoverage-server --proxy > OUT 2> ERR & |