]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
tests: Cleanup.
authorSimon Ruderich <simon@ruderich.org>
Fri, 12 Jul 2013 14:07:25 +0000 (16:07 +0200)
committerSimon Ruderich <simon@ruderich.org>
Fri, 12 Jul 2013 14:07:25 +0000 (16:07 +0200)
tests/common.sh
tests/tests-normal.sh
tests/tests-passthrough.sh

index 52b0f74bfa740318646e5fda571ab2994fb37b0c..3b08d53da77e4d286b6d17438be64c7feb6d5599 100644 (file)
@@ -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() {
index 60c56cadfedb80cf8f7ff03d5e7d232020b9fc4f..44eda5b17883b3fa4da5c9e7a0d5fd3cc7dbd315 100755 (executable)
@@ -18,9 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-# 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
 
index dcd96885309615db55cac9ebac2b5816b35f60e3..fd0c37848cade581031cb5c78a1fe7d5d16f5ada 100755 (executable)
@@ -18,9 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-# 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