This commit is contained in:
12600k-rog-d4
2026-08-24 00:35:30 +08:00
parent 32b308bc08
commit b673ed62f9
24 changed files with 483 additions and 393 deletions

View File

@@ -0,0 +1,19 @@
echo "===TEST:memnative==="
MEM_SIZE_MB=${AUTOCHECK_MEM_SIZE_MB:-0}
if [ "$MEM_SIZE_MB" -gt 0 ]; then
MEM_ARG="-M ${MEM_SIZE_MB}"
else
M=$(free -m 2>/dev/null | awk '/Mem:/{print int($7*0.6)}' || echo 512)
MEM_ARG="-M ${M}"
fi
START_TIME=$(date +%s%N)
set +e
OUTPUT=$(stressapptest -s "${AUTOCHECK_DURATION:-30}" ${MEM_ARG} -f 0 -v 2>&1)
EXIT_CODE=$?
set -e
END_TIME=$(date +%s%N)
DURATION_MS=$(( (END_TIME - START_TIME) / 1000000 ))
if [ "$EXIT_CODE" -eq 0 ]; then echo 'status:pass'; else echo 'status:fail'; fi
echo "duration:${DURATION_MS}ms"
echo "output:${OUTPUT}"
echo ''