From: Simon Ruderich Date: Fri, 12 Jul 2013 14:07:25 +0000 (+0200) Subject: tests: Cleanup. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=2dbdea63819880d93ab60ca743b4cf09abffc777;p=tlsproxy%2Ftlsproxy.git tests: Cleanup. --- diff --git a/tests/common.sh b/tests/common.sh index 52b0f74..3b08d53 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -24,10 +24,13 @@ cleanup() { certificate-localhost-proxy.pem certificate-localhost-server.pem \ proxy-ca-key.pem proxy-ca.pem proxy-invalid.pem proxy-key.pem } -abort() { - echo abort +stop_servers() { pkill -n gnutls-serv pkill -n tlsproxy +} +abort() { + echo abort + stop_servers exit 1 } server() { diff --git a/tests/tests-normal.sh b/tests/tests-normal.sh index 60c56ca..44eda5b 100755 --- a/tests/tests-normal.sh +++ b/tests/tests-normal.sh @@ -18,9 +18,7 @@ # along with this program. If not, see . -# Handle empty $srcdir. -[ "x$srcdir" = x ] && srcdir=. - +test "x$srcdir" = x && srcdir=. . "$srcdir/common.sh" @@ -113,9 +111,7 @@ test_proxy_successful test_invalid_certificate -pkill -n gnutls-serv -pkill -n tlsproxy - +stop_servers cleanup rm -f tmp diff --git a/tests/tests-passthrough.sh b/tests/tests-passthrough.sh index dcd9688..fd0c378 100755 --- a/tests/tests-passthrough.sh +++ b/tests/tests-passthrough.sh @@ -18,9 +18,7 @@ # along with this program. If not, see . -# Handle empty $srcdir. -[ "x$srcdir" = x ] && srcdir=. - +test "x$srcdir" = x && srcdir=. . "$srcdir/common.sh" @@ -117,9 +115,7 @@ test_proxy_successful test_invalid_certificate -pkill -n gnutls-serv -pkill -n tlsproxy - +stop_servers cleanup rm -f tmp