tester42 — official 42 webserv testers
Binaries attached to the intra evaluation scale, plus the fixtures they require.
All of them are Go programs, not stripped, so their expectations can be read out of the
binaries directly — strings, nm, and go tool objdump, which still shows the original
source file and line numbers. Nothing below is guesswork, and the whole sequence has also
been executed once against a probe stub.
Layout and provenance
official/ tester, cgi_tester ← downloaded from intra. THE ONLY TRUSTED ONES.
YoupiBanane/ the fixture tree the tester requires (contents dictated by the tester
itself — see its printed instructions below, so it is reconstructable)
Both official binaries are Linux ELF x86-64 and cannot run on macOS. They run in the project's Linux container, which is also the platform the school VMs use.
What the tester requires (verbatim from the binary)
- Download the cgi_test executable on the host
- Create a directory YoupiBanane with:
- A file name youpi.bad_extension
- A file name youpi.bla
- A sub directory called nop
- A file name youpi.bad_extension in nop
- A file name other.pouic in nop
- A sub directory called Yeah
- A file name not_happy.bad_extension in Yeah
- / must answer to GET request ONLY
- /directory/ must answer to GET request and the root of it would be the repository
YoupiBanane and if no file are requested, it should search for youpi.bad_extension files
- /post_body must answer anything to POST request with a maxBody of 100
- Any file with .bla as extension must answer to POST request by calling the cgi_test executable
Test cases found in the binary
The complete executed order has now been verified against a passing probe stub.
| Area | Evidence in binary |
|---|---|
Test GET |
GET on /directory/nop, directory/Yeah/not_happy.bad_extension, directory/nop/other.pouic |
| 404 paths | directory/oulalala, directory/nop/other.pouac |
Test HEAD |
HEAD / is exercised and must return 405; general HEAD support is not tested |
Test POST |
/post_body with maxBody 100 |
| CGI | Post on /directory/youpi.bla with size 100000000 (100 MB body into CGI), bad cgi returned body content |
| Concurrency | Test multiple workers(%d) doing multiple times(%d), client disconnected |
FATAL ERROR ON LAST TEST: is the message printed when a case fails.
CGI environment the cgi_tester reads
REQUEST_METHOD SERVER_PROTOCOL CONTENT_LENGTH CONTENT_TYPE
QUERY_STRING PATH_INFO HTTP_HOST HTTP_<any request header>
The binary vendors Go's net/http/cgi, so the contract is that package's, not folklore.
Three of these are failure modes rather than niceties:
SERVER_PROTOCOLis mandatory.RequestFromMapcallshttp.ParseHTTPVersionon it and aborts withcgi: invalid SERVER_PROTOCOL versionif it is missing. The CGI never runs.PATH_INFOmust equal the request path, withSCRIPT_NAMEleft empty. The handler comparesos.Getenv("PATH_INFO")againstr.URL.Pathand answers500 PATH_INFO incorrectotherwise. Splitting them the way RFC 3875 prescribes fails this tester.- Arbitrary headers must be exported as
HTTP_*(uppercase, dashes to underscores). One test readsX-SECRET-HEADER-FOR-TEST, soHTTP_X_SECRET_HEADER_FOR_TESThas to be there. CONTENT_LENGTHmust be exact — including for the 100 MB POST. Wrong value givescgi: bad CONTENT_LENGTH in environment; a missing one makes the CGI read zero bytes, becauseRequest()wraps stdin inio.LimitReader(os.Stdin, r.ContentLength).CONTENT_TYPEarrives astest/file. Not a real MIME type — forward it verbatim.
Its output starts with a Status: NNN Text header, which the server must turn into the HTTP
status line rather than forward. No Content-Length is emitted: EOF ends the body.
Scope implications
Passing this tester requires more than the subject text asks for:
- location matched by extension (
*.bla), not only by path prefix, and taking precedence over the prefix match so thatPOST /directory/youpi.blareaches the CGI whileGETon the same path serves the file aliassemantics distinct fromroot:/directory/maps ontoYoupiBanane, which has nodirectory/subtree, so plainrootcannot express it- per-location body limit (
/post_body, 100 bytes), enforced on the decoded body — every POST the tester sends is chunked, so there is noContent-Lengthto check - a 100 MB request body streamed into a CGI without buffering it all in memory
Nested location blocks are not required by this binary; they are kept in the config
grammar because the grammar is expensive to change later, not because a test needs them.
This official binary does not execute PUT or DELETE. DELETE and uploads remain mandatory because the subject and evaluation checklist require them; they need project-owned tests.
Running
# inside the Linux container, from the directory that contains YoupiBanane
./official/tester http://localhost:8000
The config must point the .bla CGI at official/cgi_tester.