summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorfilipe oliveira <filipecosta.90@gmail.com>2020-10-28 06:00:54 +0000
committerGitHub <noreply@github.com>2020-10-28 08:00:54 +0200
commit39436b21527d878f23eef0bd64edbff47af073c5 (patch)
tree96a6e2384a2a6aa6a66102a45e421404dc505061 /tests
parent66037309c63c53a28c9553070a4557fabb84ed5a (diff)
downloadredis-39436b21527d878f23eef0bd64edbff47af073c5.tar.gz
TLS Support for redis-benchmark (#7959)
Diffstat (limited to 'tests')
-rw-r--r--tests/support/benchmark.tcl14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/support/benchmark.tcl b/tests/support/benchmark.tcl
index 1130c9992..ed75bfeda 100644
--- a/tests/support/benchmark.tcl
+++ b/tests/support/benchmark.tcl
@@ -1,5 +1,19 @@
+proc redisbenchmark_tls_config {testsdir} {
+ set tlsdir [file join $testsdir tls]
+ set cert [file join $tlsdir redis.crt]
+ set key [file join $tlsdir redis.key]
+ set cacert [file join $tlsdir ca.crt]
+
+ if {$::tls} {
+ return [list --tls --cert $cert --key $key --cacert $cacert]
+ } else {
+ return {}
+ }
+}
+
proc redisbenchmark {host port {opts {}}} {
set cmd [list src/redis-benchmark -h $host -p $port]
+ lappend cmd {*}[redisbenchmark_tls_config "tests"]
lappend cmd {*}$opts
return $cmd
}