summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-04-25 17:14:34 -0700
committerZorro Lang <zlang@kernel.org>2023-05-01 00:04:09 +0800
commit3e85dd4fe4236d8ef8dc9f9b542a56dd00d16a17 (patch)
tree956ca595b766f85ad7327680650d7a3d42f86d0a /common
parent2b56a7d93ab05a9dde71225a25e2a1f5ab5840b4 (diff)
misc: add duration for long soak tests
Make it so that test runners can schedule long soak stress test programs for an exact number of seconds by setting the SOAK_DURATION config variable. Change the definition of the 'soak' test to specify that these tests can be controlled via SOAK_DURATION. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common')
-rw-r--r--common/config2
-rw-r--r--common/fuzzy7
-rw-r--r--common/report1
3 files changed, 9 insertions, 1 deletions
diff --git a/common/config b/common/config
index 25fbec14..e479df8d 100644
--- a/common/config
+++ b/common/config
@@ -57,11 +57,13 @@ export SOAK_PROC=3 # -p option to fsstress
export SOAK_STRESS=10000 # -n option to fsstress
export SOAK_PASSES=-1 # count of repetitions of fsstress (while soaking)
export EMAIL=root@localhost # where auto-qa will send its status messages
+
export HOST_OPTIONS=${HOST_OPTIONS:=local.config}
export CHECK_OPTIONS=${CHECK_OPTIONS:="-g auto"}
export BENCH_PASSES=${BENCH_PASSES:=5}
export TIME_FACTOR=${TIME_FACTOR:=1}
export LOAD_FACTOR=${LOAD_FACTOR:=1}
+export SOAK_DURATION=${SOAK_DURATION:=}
export DEBUGFS_MNT=${DEBUGFS_MNT:="/sys/kernel/debug"}
# some constants for overlayfs setup
diff --git a/common/fuzzy b/common/fuzzy
index 961bedc7..4365e734 100644
--- a/common/fuzzy
+++ b/common/fuzzy
@@ -1351,7 +1351,12 @@ _scratch_xfs_stress_scrub() {
fi
local start="$(date +%s)"
- local end="$((start + (30 * TIME_FACTOR) ))"
+ local end
+ if [ -n "$SOAK_DURATION" ]; then
+ end="$((start + SOAK_DURATION))"
+ else
+ end="$((start + (30 * TIME_FACTOR) ))"
+ fi
local scrub_startat="$((start + scrub_delay))"
test "$scrub_startat" -gt "$((end - 10))" &&
scrub_startat="$((end - 10))"
diff --git a/common/report b/common/report
index be930e0b..9bfa09ec 100644
--- a/common/report
+++ b/common/report
@@ -67,6 +67,7 @@ __generate_report_vars() {
REPORT_VARS["CPUS"]="$(getconf _NPROCESSORS_ONLN 2>/dev/null)"
REPORT_VARS["MEM_KB"]="$(grep MemTotal: /proc/meminfo | awk '{print $2}')"
REPORT_VARS["SWAP_KB"]="$(grep SwapTotal: /proc/meminfo | awk '{print $2}')"
+ test -n "$SOAK_DURATION" && REPORT_VARS["SOAK_DURATION"]="$SOAK_DURATION"
test -e /sys/devices/system/node/possible && \
REPORT_VARS["NUMA_NODES"]="$(cat /sys/devices/system/node/possible 2>/dev/null)"