Home /Modules/web-server-technology/TESTING.md

TESTING.md

web-server-technology/docs/TESTING.md · 66 line(s) · markdown

Testing the web server (local, no external CI)

The web-server-technology test suite is a set of self-contained, runnable scripts under native/. There is deliberately no external CI vendor and no GitHub Actions: the "CI brand" is offloaded to local scripts you (or any runner, hook, or cron) invoke directly. Each script exits non-zero on failure, so they compose into any harness without special plumbing.

Build + unit tests

cd web-server-technology/native
make            # builds build/sleela-web-server (links the SQL + slweb cores)
make check      # hardening unit tests + the CPU keep-warm convergence test

End-to-end scripts

ScriptWhat it proves
smoke-test.sh [ro|rw]Side-1 static + /db SQL (both dialects) + read-only policy
trav-test.shpath-traversal containment (..%2f.. โ†’ 403)
envelopment-test.shSide-2 Scientist gate + warrant routing (meme/static/sql)
hardening-live-test.shrate limit (503), write-token (401/ok), trusted-proxy anti-spoof
config-hardening-test.shthe hardening features driven from a config file
warm-live-test.shCPU keep-warm status, /__sleela/warm per-core readings, --no-warm
stress-fuzz-test.sh [CLIENTS] [REQS]concurrency soak + SQL fuzz + HTTP framing fuzz

Run one:

sh stress-fuzz-test.sh            # defaults: 8 clients x 25 requests
sh stress-fuzz-test.sh 16 100     # heavier soak

What the stress + fuzz harness checks

stress-fuzz-test.sh starts a fresh server (writable /db, a write token) and runs three phases, failing if any regress:

The harness is intentionally conservative about load defaults so it finishes quickly even where process spawning is expensive; raise CLIENTS/REQS for a real soak. It self-reports a clear startup health gate so a port-in-use or bind failure is diagnosed as such rather than looking like a crash.

A note on honesty

If a run reports failures, read the per-line output: phases B and C print the status for each case, and phase A prints ok/non-200 counts plus the server's post-run health. A non-200 under phase A is a genuine server defect; a 4xx in phase B/C is the expected safe rejection (those lines are labelled ok).