2020-10-28 06:00:54 +00:00
|
|
|
proc redisbenchmark_tls_config {testsdir} {
|
|
|
|
set tlsdir [file join $testsdir tls]
|
2020-12-11 16:31:40 +00:00
|
|
|
set cert [file join $tlsdir client.crt]
|
|
|
|
set key [file join $tlsdir client.key]
|
2020-10-28 06:00:54 +00:00
|
|
|
set cacert [file join $tlsdir ca.crt]
|
|
|
|
|
|
|
|
if {$::tls} {
|
|
|
|
return [list --tls --cert $cert --key $key --cacert $cacert]
|
|
|
|
} else {
|
|
|
|
return {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-26 06:04:59 +00:00
|
|
|
proc redisbenchmark {host port {opts {}}} {
|
|
|
|
set cmd [list src/redis-benchmark -h $host -p $port]
|
2020-10-28 06:00:54 +00:00
|
|
|
lappend cmd {*}[redisbenchmark_tls_config "tests"]
|
2020-10-26 06:04:59 +00:00
|
|
|
lappend cmd {*}$opts
|
|
|
|
return $cmd
|
|
|
|
}
|
2021-09-14 16:45:06 +00:00
|
|
|
|
|
|
|
proc redisbenchmarkuri {host port {opts {}}} {
|
|
|
|
set cmd [list src/redis-benchmark -u redis://$host:$port]
|
|
|
|
lappend cmd {*}[redisbenchmark_tls_config "tests"]
|
|
|
|
lappend cmd {*}$opts
|
|
|
|
return $cmd
|
|
|
|
}
|
|
|
|
|
|
|
|
proc redisbenchmarkuriuserpass {host port user pass {opts {}}} {
|
|
|
|
set cmd [list src/redis-benchmark -u redis://$user:$pass@$host:$port]
|
|
|
|
lappend cmd {*}[redisbenchmark_tls_config "tests"]
|
|
|
|
lappend cmd {*}$opts
|
|
|
|
return $cmd
|
|
|
|
}
|