From: Simon Ruderich Date: Sun, 28 Jul 2013 23:48:01 +0000 (+0200) Subject: tests: Add tlsproxy_add() helper function. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=f30571ef2623133a3d884fe99eb65093292433ac;p=tlsproxy%2Ftlsproxy.git tests: Add tlsproxy_add() helper function. --- diff --git a/tests/common.sh b/tests/common.sh index eb60743..8a220d6 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -37,6 +37,9 @@ abort() { tlsproxy_setup() { "$srcdir/../src/tlsproxy-setup" >/dev/null 2>/dev/null } +tlsproxy_add() { + "$srcdir/../src/tlsproxy-add" "$1" "$srcdir/$2" >/dev/null 2>&1 +} tlsproxy() { ../src/tlsproxy -d2 "$@" >tlsproxy-log 2>&1 & pid_tlsproxy=$! diff --git a/tests/tests-normal.sh b/tests/tests-normal.sh index 3b9f9f3..83b63f4 100755 --- a/tests/tests-normal.sh +++ b/tests/tests-normal.sh @@ -44,8 +44,7 @@ test_proxy_successful test_invalid_certificate # Create the proxy certificate. -"$srcdir/../src/tlsproxy-add" localhost "$srcdir/server.pem" \ - >/dev/null 2>/dev/null +tlsproxy_add localhost server.pem echo missing server certificate mv certificate-localhost-server.pem .pem @@ -88,8 +87,7 @@ test_proxy_successful test_invalid_certificate # Create the proxy certificate. -"$srcdir/../src/tlsproxy-add" localhost "$srcdir/server.pem" \ - >/dev/null 2>/dev/null +tlsproxy_add localhost server.pem echo mitm missing server certificate mv certificate-localhost-server.pem .pem diff --git a/tests/tests-passthrough.sh b/tests/tests-passthrough.sh index 2e0f90e..500fb1b 100755 --- a/tests/tests-passthrough.sh +++ b/tests/tests-passthrough.sh @@ -44,8 +44,7 @@ test_proxy_successful test_invalid_certificate # Create the proxy certificate. -"$srcdir/../src/tlsproxy-add" localhost "$srcdir/server.pem" \ - >/dev/null 2>/dev/null +tlsproxy_add localhost server.pem echo missing server certificate mv certificate-localhost-server.pem .pem @@ -90,8 +89,7 @@ test_proxy_successful test_invalid_certificate # Create the proxy certificate. -"$srcdir/../src/tlsproxy-add" localhost "$srcdir/server.pem" \ - >/dev/null 2>/dev/null +tlsproxy_add localhost server.pem echo mitm missing server certificate mv certificate-localhost-server.pem .pem