From f30571ef2623133a3d884fe99eb65093292433ac Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 29 Jul 2013 01:48:01 +0200 Subject: [PATCH] tests: Add tlsproxy_add() helper function. --- tests/common.sh | 3 +++ tests/tests-normal.sh | 6 ++---- tests/tests-passthrough.sh | 6 ++---- 3 files changed, 7 insertions(+), 8 deletions(-) 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 -- 2.43.2