From 2dbdea63819880d93ab60ca743b4cf09abffc777 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 12 Jul 2013 16:07:25 +0200 Subject: [PATCH] tests: Cleanup. --- tests/common.sh | 7 +++++-- tests/tests-normal.sh | 8 ++------ tests/tests-passthrough.sh | 8 ++------ 3 files changed, 9 insertions(+), 14 deletions(-) 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 -- 2.43.2