mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-07 17:47:14 +00:00
test: Add stress tests
This patch introduces stress tests, which put load on the daemon to help sanity check its behaviour under stress. They are separate from the existing integration tests, which focus on correctness. Two tests are included here: a load test, which sends emails repeatedly; and a connection test which opens as many conections as possible.
This commit is contained in:
15
test/stress-01-load/config/chasquid.conf
Normal file
15
test/stress-01-load/config/chasquid.conf
Normal file
@@ -0,0 +1,15 @@
|
||||
hostname: "testserver"
|
||||
|
||||
smtp_address: ":1025"
|
||||
submission_address: ":1587"
|
||||
submission_over_tls_address: ":1465"
|
||||
monitoring_address: ":1099"
|
||||
|
||||
mail_delivery_agent_bin: "test-mda"
|
||||
mail_delivery_agent_args: "%to%"
|
||||
|
||||
data_dir: "../.data"
|
||||
mail_log_path: "../.logs/mail_log"
|
||||
|
||||
suffix_separators: "+-"
|
||||
drop_characters: "._"
|
||||
4
test/stress-01-load/config/domains/testserver/aliases
Normal file
4
test/stress-01-load/config/domains/testserver/aliases
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
null: | true
|
||||
fail: | false
|
||||
|
||||
1
test/stress-01-load/hosts
Normal file
1
test/stress-01-load/hosts
Normal file
@@ -0,0 +1 @@
|
||||
testserver localhost
|
||||
31
test/stress-01-load/run.sh
Executable file
31
test/stress-01-load/run.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
. $(dirname ${0})/../util/lib.sh
|
||||
|
||||
init
|
||||
|
||||
generate_certs_for testserver
|
||||
add_user user@testserver secretpassword
|
||||
|
||||
# Note we run the server with minimal logging, to avoid generating very large
|
||||
# log files, which are not very useful anyway.
|
||||
mkdir -p .logs
|
||||
chasquid -v=-1 --logfile=.logs/chasquid.log --config_dir=config &
|
||||
wait_until_ready 1025
|
||||
|
||||
echo Peak RAM: `chasquid_ram_peak`
|
||||
|
||||
if ! loadgen -logtime -addr=localhost:1025 -run_for=3s -noop; then
|
||||
fail
|
||||
fi
|
||||
|
||||
echo Peak RAM: `chasquid_ram_peak`
|
||||
|
||||
if ! loadgen -logtime -addr=localhost:1025 -run_for=3s; then
|
||||
fail
|
||||
fi
|
||||
|
||||
echo Peak RAM: `chasquid_ram_peak`
|
||||
|
||||
success
|
||||
Reference in New Issue
Block a user