mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-19 14:57:04 +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:
@@ -24,23 +24,21 @@ function init() {
|
||||
trap "kill 0" EXIT
|
||||
}
|
||||
|
||||
function generate_cert() {
|
||||
go run ${UTILDIR}/generate_cert.go "$@"
|
||||
}
|
||||
|
||||
function chasquid() {
|
||||
if [ "${COVER_DIR}" != "" ]; then
|
||||
chasquid_cover "$@"
|
||||
return
|
||||
fi
|
||||
|
||||
( cd ${TBASE}/../../; go build ${RACE} . )
|
||||
|
||||
# HOSTALIASES: so we "fake" hostnames.
|
||||
# PATH: so chasquid can call test-mda without path issues.
|
||||
# MDA_DIR: so our test-mda knows where to deliver emails.
|
||||
HOSTALIASES=${TBASE}/hosts \
|
||||
PATH=${UTILDIR}:${PATH} \
|
||||
MDA_DIR=${TBASE}/.mail \
|
||||
go run ${RACE} ${TBASE}/../../chasquid.go "$@"
|
||||
${TBASE}/../../chasquid "$@"
|
||||
}
|
||||
|
||||
function chasquid_cover() {
|
||||
@@ -96,6 +94,18 @@ function chamuyero() {
|
||||
${UTILDIR}/chamuyero "$@"
|
||||
}
|
||||
|
||||
function generate_cert() {
|
||||
go run ${UTILDIR}/generate_cert.go "$@"
|
||||
}
|
||||
|
||||
function loadgen() {
|
||||
go run ${UTILDIR}/loadgen.go "$@"
|
||||
}
|
||||
|
||||
function conngen() {
|
||||
go run ${UTILDIR}/conngen.go "$@"
|
||||
}
|
||||
|
||||
function success() {
|
||||
echo success
|
||||
}
|
||||
@@ -145,3 +155,11 @@ function skip_if_python_is_too_old() {
|
||||
skip "python3 >= 3.5 not available"
|
||||
fi
|
||||
}
|
||||
|
||||
function chasquid_ram_peak() {
|
||||
# Find the pid of the daemon, which we expect is running on the
|
||||
# background somewhere within our current session.
|
||||
SERVER_PID=`pgrep -s 0 -x chasquid`
|
||||
|
||||
echo $( cat /proc/$SERVER_PID/status | grep VmHWM | cut -d ':' -f 2- )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user